ravipesala commented on a change in pull request #3177: [CARBONDATA-3337][CARBONDATA-3306] Distributed index server
URL: https://github.com/apache/carbondata/pull/3177#discussion_r279635364 ########## File path: core/src/main/java/org/apache/carbondata/core/datamap/DistributableDataMapFormat.java ########## @@ -154,4 +246,117 @@ 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()); + } + out.writeInt(validSegments.size()); + for (Segment segment : validSegments) { + segment.write(out); + } + if (partitions == null) { + out.writeBoolean(false); + } else { + out.writeInt(partitions.size()); + for (PartitionSpec partitionSpec : partitions) { + partitionSpec.write(out); + } + } + if (filterResolverIntf != null) { + out.writeBoolean(true); + out.writeUTF(ObjectSerializationUtil.convertObjectToString(filterResolverIntf)); + } else { + out.writeBoolean(false); + } + out.writeUTF(dataMapToClear); + } + + @Override + public void readFields(DataInput in) throws IOException { + this.table = new CarbonTable(); + table.readFields(in); + int invalidSegmentSize = in.readInt(); + invalidSegments = new ArrayList<>(invalidSegmentSize); + 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()); + } + initReadCommittedScope(); + int validSegmentSize = in.readInt(); + validSegments = new ArrayList<>(validSegmentSize); + for (int i = 0; i < validSegmentSize; i++) { + Segment segment = new Segment(); + segment.readFields(in); + segment.setReadCommittedScope(readCommittedScope); + validSegments.add(segment); + } + if (in.readBoolean()) { + int numPartitions = in.readInt(); + partitions = new ArrayList<>(numPartitions); + for (int i = 0; i < numPartitions; i++) { + PartitionSpec partitionSpec = new PartitionSpec(); + partitionSpec.readFields(in); + partitions.add(partitionSpec); + } + } + if (in.readBoolean()) { + this.filterResolverIntf = + (FilterResolverIntf) ObjectSerializationUtil.convertStringToObject(in.readUTF()); + } + this.dataMapToClear = in.readUTF(); + generateDataMapExpr(); + } + + private void initReadCommittedScope() throws IOException { Review comment: I think it is not required to read the tablestatus files for each executor. Get the index files from segment by calling direct API's instead of from commited scope ---------------------------------------------------------------- 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 |
Free forum by Nabble | Edit this page |