You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2019/12/01 15:07:41 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #2237: Optimize Doris On Elasticsearch performance

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

 ##########
 File path: fe/src/main/java/org/apache/doris/catalog/EsTable.java
 ##########
 @@ -160,34 +224,75 @@ 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_68) {
+            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");
+            if (tableContext.containsKey("majorVersion")) {
+                try {
+                    majorVersion = EsMajorVersion.parse(tableContext.get("majorVersion"));
+                } catch (Exception e) {
+                    majorVersion = EsMajorVersion.V_5_X;
+                }
+            }
+
+            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);
 
 Review comment:
   This is ok, shouldn't let FE start if this happens

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org