diff --git a/src/main/java/org/opensearch/performanceanalyzer/collectors/ShardStateCollector.java b/src/main/java/org/opensearch/performanceanalyzer/collectors/ShardStateCollector.java index 95f8cdd6..a1246054 100644 --- a/src/main/java/org/opensearch/performanceanalyzer/collectors/ShardStateCollector.java +++ b/src/main/java/org/opensearch/performanceanalyzer/collectors/ShardStateCollector.java @@ -68,7 +68,7 @@ public void collectMetrics(long startTime) { value.append(PerformanceAnalyzerMetrics.getJsonCurrentMilliSeconds()) .append(PerformanceAnalyzerMetrics.sMetricNewLineDelimitor); RoutingTable routingTable = clusterState.routingTable(); - String[] indices = routingTable.indicesRouting().keys().toArray(String.class); + String[] indices = routingTable.indicesRouting().keySet().toArray(new String[0]); for (String index : indices) { List allShardsIndex = routingTable.allShards(index); value.append(