[GitHub] [carbondata] jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[GitHub] [carbondata] jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server

GitBox
jackylk commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server
URL: https://github.com/apache/carbondata/pull/3177#discussion_r277920820
 
 

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datamap/Segment.java
 ##########
 @@ -257,4 +270,56 @@ public void setFilteredIndexShardName(String filteredIndexShardName) {
   public LoadMetadataDetails getLoadMetadataDetails() {
     return loadMetadataDetails;
   }
+
+  public String getIndexSize() {
+    return indexSize;
+  }
+
+  public void setIndexSize(String size) {
+    indexSize = size;
+  }
+
+  public ReadCommittedScope getReadCommittedScope() {
+    return readCommittedScope;
+  }
+
+  public boolean isCacheable() {
+    return isCacheable;
+  }
+
+  public void setCacheable(boolean cacheable) {
+    isCacheable = cacheable;
+  }
+
+  @Override public void write(DataOutput out) throws IOException {
+    out.writeUTF(segmentNo);
+    boolean writeSegmentFileName = segmentFileName != null;
+    out.writeBoolean(writeSegmentFileName);
+    if (writeSegmentFileName) {
+      out.writeUTF(segmentFileName);
+    }
+    out.writeInt(filteredIndexShardNames.size());
+    for (String name: filteredIndexShardNames) {
+      out.writeUTF(name);
+    }
+    out.writeUTF(ObjectSerializationUtil.convertObjectToString(loadMetadataDetails));
+    out.writeUTF(segmentString);
+    out.writeUTF(indexSize);
+  }
+
+  @Override public void readFields(DataInput in) throws IOException {
+    this.segmentNo = in.readUTF();
+    if (in.readBoolean()) {
+      this.segmentFileName = in.readUTF();
+    }
+    filteredIndexShardNames = new HashSet<>();
+    int indexShardNameSize = in.readInt();
+    for (int i = 0; i < indexShardNameSize; i++) {
+      filteredIndexShardNames.add(in.readUTF());
+    }
+    this.loadMetadataDetails =
+        (LoadMetadataDetails) ObjectSerializationUtil.convertStringToObject(in.readUTF());
 
 Review comment:
   Why not implement `write` and `readFields` in `LoadMetadataDetails`?

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


With regards,
Apache Git Services