@@ -575,14 +575,14 @@ private UploadedMetadataResults writeMetadataInParallel(
575
575
throw exception ;
576
576
}
577
577
UploadedMetadataResults response = new UploadedMetadataResults ();
578
- for (Map .Entry <String , ClusterMetadataManifest .UploadedMetadata > entry : results .entrySet ()) {
579
- final String name = entry .getKey ();
580
- final ClusterMetadataManifest .UploadedMetadata uploadedMetadata = entry .getValue ();
578
+ results .forEach ((name , uploadedMetadata ) -> {
581
579
if (uploadedMetadata .getClass ().equals (UploadedIndexMetadata .class )) {
582
580
response .uploadedIndexMetadata .add ((UploadedIndexMetadata ) uploadedMetadata );
583
581
} else if (uploadedMetadata .getComponent ().contains (CUSTOM_METADATA )) {
584
582
// component name for custom metadata will look like custom__<metadata-attribute>
585
- response .uploadedCustomMetadataMap .put (name .split (DELIMITER )[1 ], (UploadedMetadataAttribute ) uploadedMetadata );
583
+ String custom = name .split (DELIMITER )[1 ];
584
+ response .uploadedCustomMetadataMap .put (custom ,
585
+ new UploadedMetadataAttribute (custom , uploadedMetadata .getUploadedFilename ()));
586
586
} else if (COORDINATION_METADATA .equals (uploadedMetadata .getComponent ())) {
587
587
response .uploadedCoordinationMetadata = (UploadedMetadataAttribute ) uploadedMetadata ;
588
588
} else if (SETTING_METADATA .equals (uploadedMetadata .getComponent ())) {
@@ -592,7 +592,7 @@ private UploadedMetadataResults writeMetadataInParallel(
592
592
} else {
593
593
throw new IllegalStateException ("Unexpected metadata component " + uploadedMetadata .getComponent ());
594
594
}
595
- }
595
+ });
596
596
return response ;
597
597
}
598
598
@@ -957,7 +957,7 @@ private static String globalMetadataFileName(Metadata metadata) {
957
957
}
958
958
959
959
private static String metadataAttributeFileName (String componentPrefix , Long metadataVersion ) {
960
- // 123456789012_test-cluster/cluster-state/dsgYj10Nkso7/global-metadata/settings__ <inverted_metadata_version>__<inverted__timestamp>__<codec_version>
960
+ // 123456789012_test-cluster/cluster-state/dsgYj10Nkso7/global-metadata/<componentPrefix>__ <inverted_metadata_version>__<inverted__timestamp>__<codec_version>
961
961
return String .join (
962
962
DELIMITER ,
963
963
componentPrefix ,
@@ -1081,10 +1081,8 @@ private Metadata getGlobalMetadata(String clusterName, String clusterUUID, Clust
1081
1081
builder .coordinationMetadata (coordinationMetadata );
1082
1082
builder .persistentSettings (settingsMetadata );
1083
1083
builder .templates (templatesMetadata );
1084
- clusterMetadataManifest .getCustomMetadataMap ().forEach ((key , value ) -> {
1085
- String custom = key .split (DELIMITER )[1 ];
1086
- builder .putCustom (custom , getCustomsMetadata (clusterName , clusterUUID , value .getUploadedFilename (), custom ));
1087
- });
1084
+ clusterMetadataManifest .getCustomMetadataMap ().forEach ((key , value ) ->
1085
+ builder .putCustom (key , getCustomsMetadata (clusterName , clusterUUID , value .getUploadedFilename (), key )));
1088
1086
return builder .build ();
1089
1087
} else {
1090
1088
return Metadata .EMPTY_METADATA ;
@@ -1099,7 +1097,7 @@ private Metadata getGlobalMetadata(String clusterName, String clusterUUID, Clust
1099
1097
1100
1098
private CoordinationMetadata getCoordinationMetadata (String clusterName , String clusterUUID , String coordinationMetadataFileName ) {
1101
1099
try {
1102
- // Fetch Coordintaion metadata
1100
+ // Fetch Coordination metadata
1103
1101
if (coordinationMetadataFileName != null ) {
1104
1102
String [] splitPath = coordinationMetadataFileName .split ("/" );
1105
1103
return COORDINATION_METADATA_FORMAT .read (
0 commit comments