You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/21 21:00:09 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #9734: Lazy initialization of SettableByteEntityReader to avoid NPE

jihoonson commented on a change in pull request #9734:
URL: https://github.com/apache/druid/pull/9734#discussion_r412487615



##########
File path: indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/StreamChunkParser.java
##########
@@ -38,20 +45,38 @@
 {
   @Nullable
   private final InputRowParser<ByteBuffer> parser;
-  private final SettableByteEntityReader byteEntityReader;
+  private final Supplier<SettableByteEntityReader> lazyByteEntityReaderSupplier; // lazy initializer
 
-  StreamChunkParser(@Nullable InputRowParser<ByteBuffer> parser, SettableByteEntityReader byteEntityReader)
+  /**
+   * Either parser or inputFormat shouldn't be null.
+   */
+  StreamChunkParser(
+      @Nullable InputRowParser<ByteBuffer> parser,
+      @Nullable InputFormat inputFormat,
+      InputRowSchema inputRowSchema,
+      TransformSpec transformSpec,
+      File indexingTmpDir
+  )
   {
+    if (parser == null && inputFormat == null) {
+      throw new IAE("Either parser or inputFormat shouldn't be set");

Review comment:
       Oops, thanks.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org