protected List<ChunkGroupMetadata> getAllChunkGroupMetadata() {
    return allChunkGroupMetadata;
  }
Traverse the metadata index from MetadataIndexEntry to get TimeseriesMetadatas

@param metadataIndex MetadataIndexEntry
@param deviceId String
@param timeseriesMetadataMap map: deviceId -> timeseriesMetadata list
@param needChunkMetadata deserialize chunk metadata list or not
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/tools/TsFileSketchTool.java