stalary commented on a change in pull request #3454: URL: https://github.com/apache/incubator-doris/pull/3454#discussion_r426239219
########## File path: fe/src/main/java/org/apache/doris/external/EsIndexState.java ########## @@ -76,66 +68,45 @@ public TNetworkAddress randomAddress(Map<String, EsNodeInfo> nodesInfo) { EsNodeInfo[] nodeInfos = (EsNodeInfo[]) nodesInfo.values().toArray(); return nodeInfos[seed].getPublishAddress(); } - - public static EsIndexState parseIndexStateV55(String indexName, JSONObject indicesRoutingMap, - JSONObject nodesMap, - JSONObject indicesMetaMap, PartitionInfo partitionInfo) throws AnalysisException { + + public static EsIndexState parseIndexState(String indexName, JSONObject nodesMap, + JSONArray shards) { EsIndexState indexState = new EsIndexState(indexName); - JSONObject shardRoutings = indicesRoutingMap.getJSONObject(indexName).getJSONObject("shards"); - for (String shardKey : shardRoutings.keySet()) { + int length = shards.length(); + for (int i = 0; i < length; i++) { List<EsShardRouting> singleShardRouting = Lists.newArrayList(); - JSONArray shardRouting = shardRoutings.getJSONArray(shardKey); - for (int i = 0; i < shardRouting.length(); ++i) { - JSONObject shard = shardRouting.getJSONObject(i); + JSONArray shardsArray = shards.getJSONArray(i); + int arrayLength = shardsArray.length(); + for (int j = 0; j < arrayLength; j++) { + JSONObject shard = shardsArray.getJSONObject(j); String shardState = shard.getString("state"); if ("STARTED".equalsIgnoreCase(shardState)) { Review comment: Ok, I will modify it ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org