[GitHub] [carbondata] kunal642 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] kunal642 commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server

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

 ##########
 File path: core/src/main/java/org/apache/carbondata/core/datamap/DistributableDataMapFormat.java
 ##########
 @@ -154,4 +200,74 @@ public void close() throws IOException {
     };
   }
 
+  public CarbonTable getCarbonTable() {
+    return table;
+  }
+
+  @Override public void write(DataOutput out) throws IOException {
+    table.write(out);
+    out.writeInt(invalidSegments.size());
+    for (String invalidSegment : invalidSegments) {
+      out.writeUTF(invalidSegment);
+    }
+    out.writeBoolean(isJobToClearDataMaps);
+    out.writeBoolean(isFallbackJob);
+    if (dataMapLevel == null) {
+      out.writeBoolean(false);
+    } else {
+      out.writeBoolean(true);
+      out.writeUTF(dataMapLevel.name());
+    }
+    byte[] readCommittedBytes = ObjectSerializationUtil.convertObjectToString(readCommittedScope)
+        .getBytes(Charset.defaultCharset());
+    out.writeInt(readCommittedBytes.length);
+    out.write(readCommittedBytes);
+    out.writeInt(validSegments.size());
+    for (Segment segment : validSegments) {
+      segment.write(out);
+    }
+    out.writeUTF(ObjectSerializationUtil.convertObjectToString(partitions));
+  }
+
+  @Override public void readFields(DataInput in) throws IOException {
+    this.table = new CarbonTable();
+    table.readFields(in);
+    int invalidSegmentSize = in.readInt();
+    invalidSegments = new ArrayList<>();
+    for (int i = 0; i < invalidSegmentSize; i++) {
+      invalidSegments.add(in.readUTF());
+    }
+    this.isJobToClearDataMaps = in.readBoolean();
+    this.isFallbackJob = in.readBoolean();
+    if (in.readBoolean()) {
+      this.dataMapLevel = DataMapLevel.valueOf(in.readUTF());
+    }
+    byte[] readCommittedBytes = new byte[in.readInt()];
+    in.readFully(readCommittedBytes);
+    this.readCommittedScope = (ReadCommittedScope) ObjectSerializationUtil
+        .convertStringToObject(new String(readCommittedBytes, Charset.defaultCharset()));
+    int validSegmentSize = in.readInt();
+    validSegments = new ArrayList<>();
+    for (int i = 0; i < validSegmentSize; i++) {
+      Segment segment = new Segment();
+      segment.readFields(in);
+      segment.setReadCommittedScope(readCommittedScope);
+      validSegments.add(segment);
+    }
+    this.partitions =
+        (List<PartitionSpec>) ObjectSerializationUtil.convertStringToObject(in.readUTF());
+    generateDataMapExpr();
+  }
+
+  public void setFallbackJob() {
 
 Review comment:
   done

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