xvrl commented on a change in pull request #10730:
URL: https://github.com/apache/druid/pull/10730#discussion_r553586787



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/common/OrderedPartitionableRecord.java
##########
@@ -74,7 +74,7 @@ public SequenceOffsetType getSequenceNumber()
   }
 
   @NotNull
-  public List<byte[]> getData()
+  public List<? extends ByteEntity> getData()

Review comment:
       I did encounter some of this in test cases, where we would call getData 
on a record multiple times, causing issues. In general however, an InputEntity 
doesn't support being read multiple times, e.g. for `ByteEntity`, once it's 
been read via `InputEntity.open()`, the underlying buffer would have been 
exhausted and return an empty stream on subsequent calls to `open()`.
   
   Except for one logging case, all the calls to 
`OrderedPartitionableRecord.getData()` I could find would only be executed once 
per record, for the purpose of exposing InputEntities to parsers, which should 
ensure the buffers only get read once or treated appropriately as needed. I 
updated the logging case to make sure it wouldn't modify the buffer position.




----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to