Skip to content

Commit 305c2af

Browse files
author
elasticsearchmachine
committed
[CI] Auto commit changes from spotless
1 parent bf272d9 commit 305c2af

File tree

2 files changed

+27
-37
lines changed

2 files changed

+27
-37
lines changed

server/src/main/java/org/elasticsearch/node/NodeConstruction.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,14 +1139,7 @@ public Map<String, String> searchFields() {
11391139

11401140
final ShutdownPrepareService shutdownPrepareService = new ShutdownPrepareService(settings, httpServerTransport, terminationHandler);
11411141

1142-
modules.add(
1143-
loadPersistentTasksService(
1144-
settingsModule,
1145-
clusterService,
1146-
threadPool,
1147-
clusterModule.getIndexNameExpressionResolver()
1148-
)
1149-
);
1142+
modules.add(loadPersistentTasksService(settingsModule, clusterService, threadPool, clusterModule.getIndexNameExpressionResolver()));
11501143

11511144
modules.add(
11521145
loadPluginShutdownService(clusterService),

x-pack/plugin/migrate/src/test/java/org/elasticsearch/system_indices/task/SystemIndexMigrationMetadataTests.java

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import org.elasticsearch.client.internal.Client;
1111
import org.elasticsearch.cluster.ClusterModule;
1212
import org.elasticsearch.cluster.metadata.Metadata;
13-
import org.elasticsearch.cluster.metadata.MetadataCreateIndexService;
14-
import org.elasticsearch.cluster.metadata.MetadataUpdateSettingsService;
1513
import org.elasticsearch.cluster.metadata.ProjectId;
1614
import org.elasticsearch.cluster.metadata.ProjectMetadata;
1715
import org.elasticsearch.cluster.service.ClusterService;
@@ -98,10 +96,7 @@ public void testParseXContentFormatBeforeMultiProject() throws IOException {
9896
clusterTasks.tasks().stream().map(PersistentTasksCustomMetadata.PersistentTask::getTaskName).toList(),
9997
containsInAnyOrder("health-node")
10098
);
101-
assertThat(
102-
metadata.getProject().customs().keySet(),
103-
containsInAnyOrder("persistent_tasks", "index-graveyard")
104-
);
99+
assertThat(metadata.getProject().customs().keySet(), containsInAnyOrder("persistent_tasks", "index-graveyard"));
105100
final var projectTasks = PersistentTasksCustomMetadata.get(metadata.getProject());
106101
assertThat(
107102
projectTasks.tasks().stream().map(PersistentTasksCustomMetadata.PersistentTask::getTaskName).toList(),
@@ -141,25 +136,28 @@ private Metadata fromJsonXContentStringWithPersistentTasks(String json) throws I
141136

142137
public void testMultiProjectXContent() throws IOException {
143138
final long lastAllocationId = randomNonNegativeLong();
144-
final List<ProjectMetadata> projects = randomList(1, 5, () -> ProjectMetadata.builder(randomUniqueProjectId())
145-
.putCustom(
146-
PersistentTasksCustomMetadata.TYPE,
147-
new PersistentTasksCustomMetadata(
148-
lastAllocationId,
149-
Map.of(
139+
final List<ProjectMetadata> projects = randomList(
140+
1,
141+
5,
142+
() -> ProjectMetadata.builder(randomUniqueProjectId())
143+
.putCustom(
144+
PersistentTasksCustomMetadata.TYPE,
145+
new PersistentTasksCustomMetadata(
146+
lastAllocationId,
147+
Map.of(
148+
SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME,
149+
new PersistentTasksCustomMetadata.PersistentTask<>(
150150
SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME,
151-
new PersistentTasksCustomMetadata.PersistentTask<>(
152-
SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME,
153-
SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME,
154-
new SystemIndexMigrationTaskParams(),
155-
lastAllocationId,
156-
PersistentTasks.INITIAL_ASSIGNMENT
157-
)
151+
SystemIndexMigrationTaskParams.SYSTEM_INDEX_UPGRADE_TASK_NAME,
152+
new SystemIndexMigrationTaskParams(),
153+
lastAllocationId,
154+
PersistentTasks.INITIAL_ASSIGNMENT
158155
)
159156
)
160157
)
161-
.build()
162-
);
158+
)
159+
.build()
160+
);
163161

164162
Metadata.Builder metadataBuilder = Metadata.builder()
165163
.putCustom(
@@ -181,8 +179,7 @@ public void testMultiProjectXContent() throws IOException {
181179
for (ProjectMetadata project : projects) {
182180
metadataBuilder.put(project);
183181
}
184-
final Metadata originalMeta = metadataBuilder
185-
.build();
182+
final Metadata originalMeta = metadataBuilder.build();
186183

187184
ToXContent.Params p = new ToXContent.MapParams(
188185
Map.of("multi-project", "true", Metadata.CONTEXT_MODE_PARAM, Metadata.CONTEXT_MODE_GATEWAY)
@@ -198,12 +195,12 @@ public void testMultiProjectXContent() throws IOException {
198195
assertThat(objectPath.evaluate("meta-data.cluster_persistent_tasks.tasks.0.id"), equalTo(HealthNode.TASK_NAME));
199196
assertThat(objectPath.evaluate("meta-data.projects"), hasSize(projects.size()));
200197
assertThat(IntStream.range(0, projects.size()).mapToObj(i -> {
201-
try {
202-
return (String) objectPath.evaluate("meta-data.projects." + i + ".id");
203-
} catch (IOException e) {
204-
throw new UncheckedIOException(e);
205-
}
206-
}).collect(Collectors.toUnmodifiableSet()),
198+
try {
199+
return (String) objectPath.evaluate("meta-data.projects." + i + ".id");
200+
} catch (IOException e) {
201+
throw new UncheckedIOException(e);
202+
}
203+
}).collect(Collectors.toUnmodifiableSet()),
207204
equalTo(projects.stream().map(pp -> pp.id().id()).collect(Collectors.toUnmodifiableSet()))
208205
);
209206

0 commit comments

Comments
 (0)