saurabhd336 commented on code in PR #3699:
URL: https://github.com/apache/celeborn/pull/3699#discussion_r3386343566


##########
common/src/main/java/org/apache/celeborn/common/network/buffer/FileChunkBuffers.java:
##########
@@ -27,15 +27,25 @@
 public class FileChunkBuffers extends ChunkBuffers {
   private final File file;
   private final TransportConf conf;
+  private final boolean isChunkCompressed;
 
   public FileChunkBuffers(DiskFileInfo fileInfo, TransportConf conf) {
     super(fileInfo.getReduceFileMeta());
+    isChunkCompressed = fileInfo.isChunkCompressionEnabled();
     file = fileInfo.getFile();
     this.conf = conf;
   }
 
   @Override
   public ManagedBuffer chunk(int chunkIndex, int offset, int len) {
+    if (isChunkCompressed && (offset != 0 || len != Integer.MAX_VALUE)) {
+      throw new IllegalArgumentException(
+          "Sliced reads (offset="
+              + offset
+              + ", len="
+              + len
+              + ") are not supported for chunk-compressed files");
+    }

Review Comment:
   I'd rather not allow sliced reads for a few chunks and not for other. This 
feature is largely intended for Spark shuffle, where chunk is never sliced



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to