Skip to content

Commit 6acbb7c

Browse files
committed
Rename method
1 parent ff3ec37 commit 6acbb7c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/IndexLifecycleService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ PolicyStepsRegistry getPolicyRegistry() {
590590
return policyRegistry;
591591
}
592592

593-
static boolean indicesOnShuttingDownNodesInDangerousStep(ClusterState state, String nodeId) {
593+
static boolean hasIndicesInDangerousStepForNodeShutdown(ClusterState state, String nodeId) {
594594
final Set<String> shutdownNodes = PluginShutdownService.shutdownTypeNodes(
595595
state,
596596
SingleNodeShutdownMetadata.Type.REMOVE,
@@ -649,7 +649,7 @@ public boolean safeToShutdown(String nodeId, SingleNodeShutdownMetadata.Type shu
649649
case REPLACE:
650650
case REMOVE:
651651
case SIGTERM:
652-
return indicesOnShuttingDownNodesInDangerousStep(clusterService.state(), nodeId);
652+
return hasIndicesInDangerousStepForNodeShutdown(clusterService.state(), nodeId);
653653
default:
654654
throw new IllegalArgumentException("unknown shutdown type: " + shutdownType);
655655
}

x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/IndexLifecycleServiceTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,16 @@ public void testParsingOriginationDateBeforeIndexCreation() {
524524
}
525525
}
526526

527-
public void testIndicesOnShuttingDownNodesInDangerousStep() {
527+
public void testHasIndicesInDangerousStepForNodeShutdown() {
528528
for (SingleNodeShutdownMetadata.Type type : List.of(
529529
SingleNodeShutdownMetadata.Type.REMOVE,
530530
SingleNodeShutdownMetadata.Type.SIGTERM,
531531
SingleNodeShutdownMetadata.Type.REPLACE
532532
)) {
533533
final var project = ProjectMetadata.builder(randomProjectIdOrDefault()).build();
534534
ClusterState state = ClusterState.builder(ClusterName.DEFAULT).putProjectMetadata(project).build();
535-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "regular_node"), equalTo(true));
536-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "shutdown_node"), equalTo(true));
535+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "regular_node"), equalTo(true));
536+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "shutdown_node"), equalTo(true));
537537

538538
IndexMetadata nonDangerousIndex = IndexMetadata.builder("no_danger")
539539
.settings(settings(IndexVersion.current()).put(LifecycleSettings.LIFECYCLE_NAME, "mypolicy"))
@@ -603,8 +603,8 @@ public void testIndicesOnShuttingDownNodesInDangerousStep() {
603603
.build();
604604

605605
// No danger yet, because no node is shutting down
606-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "regular_node"), equalTo(true));
607-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "shutdown_node"), equalTo(true));
606+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "regular_node"), equalTo(true));
607+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "shutdown_node"), equalTo(true));
608608

609609
state = ClusterState.builder(state)
610610
.metadata(
@@ -628,11 +628,11 @@ public void testIndicesOnShuttingDownNodesInDangerousStep() {
628628
)
629629
.build();
630630

631-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "regular_node"), equalTo(true));
631+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "regular_node"), equalTo(true));
632632
// No danger, because this is a "RESTART" type shutdown
633633
assertThat(
634634
"restart type shutdowns are not considered dangerous",
635-
IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "shutdown_node"),
635+
IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "shutdown_node"),
636636
equalTo(true)
637637
);
638638

@@ -663,7 +663,7 @@ public void testIndicesOnShuttingDownNodesInDangerousStep() {
663663
.build();
664664

665665
// The dangerous index should be calculated as being in danger now
666-
assertThat(IndexLifecycleService.indicesOnShuttingDownNodesInDangerousStep(state, "shutdown_node"), equalTo(false));
666+
assertThat(IndexLifecycleService.hasIndicesInDangerousStepForNodeShutdown(state, "shutdown_node"), equalTo(false));
667667
}
668668
}
669669
}

0 commit comments

Comments
 (0)