File tree 2 files changed +20
-1
lines changed
main/java/bio/overture/rollcall/repository
test/java/bio/overture/rollcall/service
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ public boolean deleteIndices(@NonNull String... indices) {
140
140
}
141
141
142
142
@ SneakyThrows
143
- public Map <String , Date > getIndicesMappedToCreationDate (String ... indices ) {
143
+ public Map <String , Date > getIndicesMappedToCreationDate (@ NonNull String ... indices ) {
144
+ if (indices .length == 0 ) {
145
+ return Map .of ();
146
+ }
147
+
144
148
val response = client .indices ().get (new GetIndexRequest (indices ).indicesOptions (IndicesOptions .lenientExpand ()), RequestOptions .DEFAULT );
145
149
146
150
val indicesSettings = response .getSettings ();
Original file line number Diff line number Diff line change @@ -126,6 +126,21 @@ public void testReleaseNonDestructiveFailurePreFlight() {
126
126
assertThat (state2 .get (INDEX2 ).get (0 ).alias ()).isEqualTo ("file_centric" );
127
127
}
128
128
129
+ @ Test
130
+ @ SneakyThrows
131
+ public void testReleaseNewIndexWithRotationOn () {
132
+ val NEW_INDEX = "file_centric_sd_asdfca_re_1" ;
133
+ client .indices ().create (new CreateIndexRequest (NEW_INDEX ), RequestOptions .DEFAULT );
134
+
135
+ // release re_1 for index shard sd_asdfca
136
+ val request1 = new AliasRequest ("file_centric" , "re_1" , Lists .list ( "sd_asdfca" ));
137
+ service .release (request1 );
138
+
139
+ // verify aliases assigned to indices
140
+ val state1 = repository .getAliasState ();
141
+ assertThat (state1 .get (NEW_INDEX ).get (0 ).alias ()).isEqualTo ("file_centric" );
142
+ }
143
+
129
144
@ Test
130
145
@ SneakyThrows
131
146
public void testReleaseAndDeleteOldIndices () {
You can’t perform that action at this time.
0 commit comments