@@ -835,70 +835,73 @@ private void assertFieldMappings(
835
835
}
836
836
837
837
private void assertRollupIndexSettings (String sourceIndex , String rollupIndex , GetIndexResponse indexSettingsResp ) {
838
+ Settings sourceSettings = indexSettingsResp .settings ().get (sourceIndex );
839
+ Settings rollupSettings = indexSettingsResp .settings ().get (rollupIndex );
840
+
838
841
// Assert rollup metadata are set in index settings
839
- assertEquals ("success" , indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .INDEX_DOWNSAMPLE_STATUS_KEY ));
842
+ assertEquals ("success" , rollupSettings . get ( IndexMetadata .INDEX_DOWNSAMPLE_STATUS_KEY ));
840
843
841
- assertNotNull (indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .SETTING_INDEX_UUID ));
842
- assertNotNull (indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_UUID_KEY ));
844
+ assertNotNull (sourceSettings . get ( IndexMetadata .SETTING_INDEX_UUID ));
845
+ assertNotNull (rollupSettings . get ( IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_UUID_KEY ));
843
846
assertEquals (
844
- indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .SETTING_INDEX_UUID ),
845
- indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_UUID_KEY )
847
+ sourceSettings . get ( IndexMetadata .SETTING_INDEX_UUID ),
848
+ rollupSettings . get ( IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_UUID_KEY )
846
849
);
847
850
848
- assertEquals (sourceIndex , indexSettingsResp .getSetting (rollupIndex , IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_NAME_KEY ));
849
- assertEquals (
850
- indexSettingsResp .getSetting (sourceIndex , IndexSettings .MODE .getKey ()),
851
- indexSettingsResp .getSetting (rollupIndex , IndexSettings .MODE .getKey ())
852
- );
851
+ assertEquals (sourceIndex , rollupSettings .get (IndexMetadata .INDEX_DOWNSAMPLE_SOURCE_NAME_KEY ));
852
+ assertEquals (sourceSettings .get (IndexSettings .MODE .getKey ()), rollupSettings .get (IndexSettings .MODE .getKey ()));
853
853
854
- assertNotNull (indexSettingsResp . getSetting ( sourceIndex , IndexSettings .TIME_SERIES_START_TIME .getKey ()));
855
- assertNotNull (indexSettingsResp . getSetting ( rollupIndex , IndexSettings .TIME_SERIES_START_TIME .getKey ()));
854
+ assertNotNull (sourceSettings . get ( IndexSettings .TIME_SERIES_START_TIME .getKey ()));
855
+ assertNotNull (rollupSettings . get ( IndexSettings .TIME_SERIES_START_TIME .getKey ()));
856
856
assertEquals (
857
- indexSettingsResp . getSetting ( sourceIndex , IndexSettings .TIME_SERIES_START_TIME .getKey ()),
858
- indexSettingsResp . getSetting ( rollupIndex , IndexSettings .TIME_SERIES_START_TIME .getKey ())
857
+ sourceSettings . get ( IndexSettings .TIME_SERIES_START_TIME .getKey ()),
858
+ rollupSettings . get ( IndexSettings .TIME_SERIES_START_TIME .getKey ())
859
859
);
860
860
861
- assertNotNull (indexSettingsResp . getSetting ( sourceIndex , IndexSettings .TIME_SERIES_END_TIME .getKey ()));
862
- assertNotNull (indexSettingsResp . getSetting ( rollupIndex , IndexSettings .TIME_SERIES_END_TIME .getKey ()));
861
+ assertNotNull (sourceSettings . get ( IndexSettings .TIME_SERIES_END_TIME .getKey ()));
862
+ assertNotNull (rollupSettings . get ( IndexSettings .TIME_SERIES_END_TIME .getKey ()));
863
863
assertEquals (
864
- indexSettingsResp . getSetting ( sourceIndex , IndexSettings .TIME_SERIES_END_TIME .getKey ()),
865
- indexSettingsResp . getSetting ( rollupIndex , IndexSettings .TIME_SERIES_END_TIME .getKey ())
864
+ sourceSettings . get ( IndexSettings .TIME_SERIES_END_TIME .getKey ()),
865
+ rollupSettings . get ( IndexSettings .TIME_SERIES_END_TIME .getKey ())
866
866
);
867
- assertNotNull (indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .INDEX_ROUTING_PATH .getKey ()));
868
- assertNotNull (indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .INDEX_ROUTING_PATH .getKey ()));
867
+ assertNotNull (sourceSettings . get ( IndexMetadata .INDEX_ROUTING_PATH .getKey ()));
868
+ assertNotNull (rollupSettings . get ( IndexMetadata .INDEX_ROUTING_PATH .getKey ()));
869
869
assertEquals (
870
- indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .INDEX_ROUTING_PATH .getKey ()),
871
- indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .INDEX_ROUTING_PATH .getKey ())
870
+ sourceSettings . get ( IndexMetadata .INDEX_ROUTING_PATH .getKey ()),
871
+ rollupSettings . get ( IndexMetadata .INDEX_ROUTING_PATH .getKey ())
872
872
);
873
873
874
- assertNotNull (indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .SETTING_NUMBER_OF_SHARDS ));
875
- assertNotNull (indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .SETTING_NUMBER_OF_SHARDS ));
874
+ assertNotNull (sourceSettings . get ( IndexMetadata .SETTING_NUMBER_OF_SHARDS ));
875
+ assertNotNull (rollupSettings . get ( IndexMetadata .SETTING_NUMBER_OF_SHARDS ));
876
876
assertEquals (
877
- indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .SETTING_NUMBER_OF_SHARDS ),
878
- indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .SETTING_NUMBER_OF_SHARDS )
877
+ sourceSettings . get ( IndexMetadata .SETTING_NUMBER_OF_SHARDS ),
878
+ rollupSettings . get ( IndexMetadata .SETTING_NUMBER_OF_SHARDS )
879
879
);
880
880
881
- assertNotNull (indexSettingsResp .getSetting (sourceIndex , IndexMetadata .SETTING_NUMBER_OF_REPLICAS ));
882
- assertNotNull (indexSettingsResp .getSetting (rollupIndex , IndexMetadata .SETTING_NUMBER_OF_REPLICAS ));
883
- assertEquals (
884
- indexSettingsResp .getSetting (sourceIndex , IndexMetadata .SETTING_NUMBER_OF_REPLICAS ),
885
- indexSettingsResp .getSetting (rollupIndex , IndexMetadata .SETTING_NUMBER_OF_REPLICAS )
886
- );
887
- assertEquals ("true" , indexSettingsResp .getSetting (rollupIndex , IndexMetadata .SETTING_BLOCKS_WRITE ));
881
+ assertNotNull (sourceSettings .get (IndexMetadata .SETTING_NUMBER_OF_REPLICAS ));
882
+ assertNotNull (rollupSettings .get (IndexMetadata .SETTING_NUMBER_OF_REPLICAS ));
888
883
assertEquals (
889
- indexSettingsResp . getSetting ( sourceIndex , IndexMetadata .SETTING_INDEX_HIDDEN ),
890
- indexSettingsResp . getSetting ( rollupIndex , IndexMetadata .SETTING_INDEX_HIDDEN )
884
+ sourceSettings . get ( IndexMetadata .SETTING_NUMBER_OF_REPLICAS ),
885
+ rollupSettings . get ( IndexMetadata .SETTING_NUMBER_OF_REPLICAS )
891
886
);
892
887
893
- if (indexSettingsResp .getSetting (sourceIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()) != null ) {
888
+ assertEquals ("true" , rollupSettings .get (IndexMetadata .SETTING_BLOCKS_WRITE ));
889
+ assertEquals (sourceSettings .get (IndexMetadata .SETTING_INDEX_HIDDEN ), rollupSettings .get (IndexMetadata .SETTING_INDEX_HIDDEN ));
890
+
891
+ if (sourceSettings .keySet ().contains (MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ())) {
894
892
assertNotNull (indexSettingsResp .getSetting (rollupIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()));
895
893
}
896
- if (indexSettingsResp .getSetting (sourceIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()) != null
897
- && indexSettingsResp .getSetting (rollupIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()) != null )
894
+
895
+ if (sourceSettings .keySet ().contains (MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ())
896
+ && rollupSettings .keySet ().contains (MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ())) {
898
897
assertEquals (
899
- indexSettingsResp . getSetting ( sourceIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()),
900
- indexSettingsResp . getSetting ( rollupIndex , MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ())
898
+ sourceSettings . get ( MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()),
899
+ rollupSettings . get ( MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ())
901
900
);
901
+ } else {
902
+ assertFalse (sourceSettings .keySet ().contains (MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()));
903
+ assertFalse (rollupSettings .keySet ().contains (MapperService .INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING .getKey ()));
904
+ }
902
905
}
903
906
904
907
private AggregationBuilder buildAggregations (
0 commit comments