yunfengzhou-hub commented on code in PR #97:
URL: https://github.com/apache/flink-ml/pull/97#discussion_r890707072


##########
flink-ml-iteration/src/main/java/org/apache/flink/iteration/datacache/nonkeyed/Segment.java:
##########
@@ -18,38 +18,73 @@
 
 package org.apache.flink.iteration.datacache.nonkeyed;
 
+import org.apache.flink.annotation.Internal;
 import org.apache.flink.core.fs.Path;
+import org.apache.flink.core.memory.MemorySegment;
 
-import java.io.Serializable;
+import java.util.List;
 import java.util.Objects;
 
-/** A segment represents a single file for the cache. */
-public class Segment implements Serializable {
+import static org.apache.flink.util.Preconditions.checkArgument;
+import static org.apache.flink.util.Preconditions.checkNotNull;
 
+/** A segment contains the information about a cache unit. */
+@Internal
+public class Segment {
+
+    /** The path to the file containing persisted records. */
     private final Path path;
 
-    /** The count of the records in the file. */
+    /**
+     * The count of records in the file at the path if the file size is not 
zero, otherwise the
+     * count of records in the cache.
+     */
     private final int count;
 
-    /** The total length of file. */
-    private final long size;
+    /** The total length of file containing persisted records. */
+    private long fsSize = -1L;
+
+    /** The memory segments containing cached records. */

Review Comment:
   Now the actual behavior is that the cache list is null rather than empty 
when not cached. I think it better satisfies Java's default values. How do you 
think we should treat null and empty list accordingly?



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to