Skip to content

Commit f5d737b

Browse files
committed
Rename method
1 parent b2cccfc commit f5d737b

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

server/src/main/java/org/elasticsearch/cluster/ProjectState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public ClusterState updatedState(Consumer<ProjectMetadata.Builder> projectBuilde
7979
/**
8080
* Build a new {@link ProjectState} with the updated {@code project}.
8181
*/
82-
public ProjectState withProject(ProjectMetadata updatedProject) {
82+
public ProjectState updateProject(ProjectMetadata updatedProject) {
8383
// No need to build a new object if the project is unchanged.
8484
if (metadata() == updatedProject) {
8585
return this;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
101101
newLifecycleState.setAction(action);
102102
newLifecycleState.setStep(step);
103103

104-
return projectState.withProject(
104+
return projectState.updateProject(
105105
projectState.metadata().withLifecycleState(targetIndexMetadata.getIndex(), newLifecycleState.build())
106106
);
107107
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
9797
IndexMetadata.Builder updatedIndex = IndexMetadata.builder(targetIndexMetadata)
9898
.settingsVersion(targetIndexMetadata.getSettingsVersion() + 1)
9999
.settings(settings);
100-
return projectState.withProject(ProjectMetadata.builder(projectState.metadata()).put(updatedIndex).build());
100+
return projectState.updateProject(ProjectMetadata.builder(projectState.metadata()).put(updatedIndex).build());
101101
}
102102

103103
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
4949
final String downsampleIndexName = generateDownsampleIndexName(DOWNSAMPLED_INDEX_PREFIX, indexMetadata, fixedInterval);
5050
newLifecycleState.setDownsampleIndexName(downsampleIndexName);
5151

52-
return projectState.withProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
52+
return projectState.updateProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
5353
}
5454

5555
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
9595
newLifecycleState.setSnapshotName(snapshotName);
9696
}
9797

98-
return projectState.withProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
98+
return projectState.updateProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
9999
}
100100

101101
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
8686
}
8787
lifecycleStateSetter.apply(generatedIndexName, newLifecycleState);
8888

89-
return projectState.withProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
89+
return projectState.updateProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
9090
}
9191

9292
@Override

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
6363

6464
if (parsedOriginationDate == null) {
6565
// we don't need to update the LifecycleSettings.LIFECYCLE_ORIGINATION_DATE, so we can use the fast path
66-
return projectState.withProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState));
66+
return projectState.updateProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState));
6767
} else {
6868
// we do need to update the LifecycleSettings.LIFECYCLE_ORIGINATION_DATE, so we can't use the fast path
6969
IndexMetadata.Builder builder = IndexMetadata.builder(indexMetadata);
@@ -75,7 +75,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
7575
.build()
7676
);
7777
builder.putCustom(ILM_CUSTOM_METADATA_KEY, newLifecycleState.asMap());
78-
return projectState.withProject(ProjectMetadata.builder(projectState.metadata()).put(builder).build());
78+
return projectState.updateProject(ProjectMetadata.builder(projectState.metadata()).put(builder).build());
7979
}
8080
}
8181

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
115115
DataStream updatedDataStream = dataStream.isFailureStoreIndex(originalIndex)
116116
? dataStream.replaceFailureStoreIndex(index, targetIndexMetadata.getIndex())
117117
: dataStream.replaceBackingIndex(index, targetIndexMetadata.getIndex());
118-
return projectState.withProject(ProjectMetadata.builder(projectState.metadata()).put(updatedDataStream).build());
118+
return projectState.updateProject(ProjectMetadata.builder(projectState.metadata()).put(updatedDataStream).build());
119119
}
120120

121121
@Override

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ProjectState performAction(Index index, ProjectState projectState) {
6969

7070
LifecycleExecutionState.Builder newLifecycleState = LifecycleExecutionState.builder(indexMetadata.getLifecycleExecutionState());
7171
newLifecycleState.setIndexCreationDate(newIndexTime);
72-
return projectState.withProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
72+
return projectState.updateProject(projectState.metadata().withLifecycleState(indexMetadata.getIndex(), newLifecycleState.build()));
7373
}
7474

7575
private static String getRolloverTarget(Index index, ProjectMetadata project) {

0 commit comments

Comments
 (0)