morningman commented on a change in pull request #2237: Optimize Doris On 
Elasticsearch performance
URL: https://github.com/apache/incubator-doris/pull/2237#discussion_r351663961
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/catalog/EsTable.java
 ##########
 @@ -160,34 +225,60 @@ public int getSignature(int signatureVersion) {
     @Override
     public void write(DataOutput out) throws IOException {
         super.write(out);
-        Text.writeString(out, hosts);
-        Text.writeString(out, userName);
-        Text.writeString(out, passwd);
-        Text.writeString(out, indexName);
-        Text.writeString(out, mappingType);
+        out.writeInt(tableContext.size());
+        for (Map.Entry<String, String> entry : tableContext.entrySet()) {
+            Text.writeString(out, entry.getKey());
+            Text.writeString(out, entry.getValue());
+        }
         Text.writeString(out, partitionInfo.getType().name());
         partitionInfo.write(out);
-        Text.writeString(out, transport);
     }
 
     @Override
     public void readFields(DataInput in) throws IOException {
         super.readFields(in);
-        hosts = Text.readString(in);
-        seeds = hosts.split(",");
-        userName = Text.readString(in);
-        passwd = Text.readString(in);
-        indexName = Text.readString(in);
-        mappingType = Text.readString(in);
-        PartitionType partType = PartitionType.valueOf(Text.readString(in));
-        if (partType == PartitionType.UNPARTITIONED) {
-            partitionInfo = SinglePartitionInfo.read(in);
-        } else if (partType == PartitionType.RANGE) {
-            partitionInfo = RangePartitionInfo.read(in);
+        if (Catalog.getCurrentCatalogJournalVersion() >= 
FeMetaVersion.VERSION_66) {
+            int size = in.readInt();
+            for (int i = 0; i < size; ++i) {
+                String key = Text.readString(in);
+                String value = Text.readString(in);
+                tableContext.put(key, value);
+            }
+            hosts = tableContext.get("hosts");
+            seeds = hosts.split(",");
+            userName = tableContext.get("userName");
+            passwd = tableContext.get("passwd");
+            indexName = tableContext.get("indexName");
+            mappingType = tableContext.get("mappingType");
+            transport = tableContext.get("transport");
+
+            enableDocValueScan = 
Boolean.parseBoolean(tableContext.get("enableDocValueScan"));
+
+            PartitionType partType = 
PartitionType.valueOf(Text.readString(in));
+            if (partType == PartitionType.UNPARTITIONED) {
+                partitionInfo = SinglePartitionInfo.read(in);
+            } else if (partType == PartitionType.RANGE) {
+                partitionInfo = RangePartitionInfo.read(in);
+            } else {
+                throw new IOException("invalid partition type: " + partType);
+            }
         } else {
-            throw new IOException("invalid partition type: " + partType);
+            hosts = Text.readString(in);
+            seeds = hosts.split(",");
+            userName = Text.readString(in);
+            passwd = Text.readString(in);
+            indexName = Text.readString(in);
+            mappingType = Text.readString(in);
+            PartitionType partType = 
PartitionType.valueOf(Text.readString(in));
 
 Review comment:
   Don't you need to put these variables back to the tableContext?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to