Skip to content

Commit ceb3099

Browse files
authored
Rename AsyncLucenePersistedState to AsyncPersistedState (#73652)
This class actually has nothing to do with Lucene. This commit adjusts the name to match.
1 parent 92fb60d commit ceb3099

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

server/src/main/java/org/elasticsearch/gateway/GatewayMetaState.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void start(Settings settings, TransportService transportService, ClusterS
122122
if (DiscoveryNode.isMasterNode(settings)) {
123123
persistedState = new LucenePersistedState(persistedClusterStateService, currentTerm, clusterState);
124124
} else {
125-
persistedState = new AsyncLucenePersistedState(settings, transportService.getThreadPool(),
125+
persistedState = new AsyncPersistedState(settings, transportService.getThreadPool(),
126126
new LucenePersistedState(persistedClusterStateService, currentTerm, clusterState));
127127
}
128128
if (DiscoveryNode.canContainData(settings)) {
@@ -244,16 +244,16 @@ public void close() throws IOException {
244244
// visible for testing
245245
public boolean allPendingAsyncStatesWritten() {
246246
final PersistedState ps = persistedState.get();
247-
if (ps instanceof AsyncLucenePersistedState) {
248-
return ((AsyncLucenePersistedState) ps).allPendingAsyncStatesWritten();
247+
if (ps instanceof AsyncPersistedState) {
248+
return ((AsyncPersistedState) ps).allPendingAsyncStatesWritten();
249249
} else {
250250
return true;
251251
}
252252
}
253253

254-
static class AsyncLucenePersistedState extends InMemoryPersistedState {
254+
static class AsyncPersistedState extends InMemoryPersistedState {
255255

256-
private static final Logger logger = LogManager.getLogger(AsyncLucenePersistedState.class);
256+
private static final Logger logger = LogManager.getLogger(AsyncPersistedState.class);
257257

258258
static final String THREAD_NAME = "AsyncLucenePersistedState#updateTask";
259259

@@ -265,7 +265,7 @@ static class AsyncLucenePersistedState extends InMemoryPersistedState {
265265

266266
private final Object mutex = new Object();
267267

268-
AsyncLucenePersistedState(Settings settings, ThreadPool threadPool, PersistedState persistedState) {
268+
AsyncPersistedState(Settings settings, ThreadPool threadPool, PersistedState persistedState) {
269269
super(persistedState.getCurrentTerm(), persistedState.getLastAcceptedState());
270270
final String nodeName = Objects.requireNonNull(Node.NODE_NAME_SETTING.get(settings));
271271
threadPoolExecutor = EsExecutors.newFixed(

server/src/test/java/org/elasticsearch/gateway/GatewayMetaStatePersistedStateTests.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public void testDataOnlyNodePersistence() throws Exception {
352352
gateway.start(settings, transportService, clusterService,
353353
new MetaStateService(nodeEnvironment, xContentRegistry()), null, null, persistedClusterStateService);
354354
final CoordinationState.PersistedState persistedState = gateway.getPersistedState();
355-
assertThat(persistedState, instanceOf(GatewayMetaState.AsyncLucenePersistedState.class));
355+
assertThat(persistedState, instanceOf(GatewayMetaState.AsyncPersistedState.class));
356356

357357
//generate random coordinationMetadata with different lastAcceptedConfiguration and lastCommittedConfiguration
358358
CoordinationMetadata coordinationMetadata;
@@ -372,9 +372,9 @@ public void testDataOnlyNodePersistence() throws Exception {
372372
CoordinationMetadata persistedCoordinationMetadata =
373373
persistedClusterStateService.loadOnDiskState().metadata.coordinationMetadata();
374374
assertThat(persistedCoordinationMetadata.getLastAcceptedConfiguration(),
375-
equalTo(GatewayMetaState.AsyncLucenePersistedState.staleStateConfiguration));
375+
equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration));
376376
assertThat(persistedCoordinationMetadata.getLastCommittedConfiguration(),
377-
equalTo(GatewayMetaState.AsyncLucenePersistedState.staleStateConfiguration));
377+
equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration));
378378

379379
persistedState.markLastAcceptedStateAsCommitted();
380380
assertBusy(() -> assertTrue(gateway.allPendingAsyncStatesWritten()));
@@ -388,9 +388,9 @@ public void testDataOnlyNodePersistence() throws Exception {
388388
assertClusterStateEqual(expectedClusterState, persistedState.getLastAcceptedState());
389389
persistedCoordinationMetadata = persistedClusterStateService.loadOnDiskState().metadata.coordinationMetadata();
390390
assertThat(persistedCoordinationMetadata.getLastAcceptedConfiguration(),
391-
equalTo(GatewayMetaState.AsyncLucenePersistedState.staleStateConfiguration));
391+
equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration));
392392
assertThat(persistedCoordinationMetadata.getLastCommittedConfiguration(),
393-
equalTo(GatewayMetaState.AsyncLucenePersistedState.staleStateConfiguration));
393+
equalTo(GatewayMetaState.AsyncPersistedState.staleStateConfiguration));
394394
assertTrue(persistedClusterStateService.loadOnDiskState().metadata.clusterUUIDCommitted());
395395

396396
// generate a series of updates and check if batching works
@@ -421,7 +421,7 @@ public void testDataOnlyNodePersistence() throws Exception {
421421

422422
try (CoordinationState.PersistedState reloadedPersistedState = newGatewayPersistedState()) {
423423
assertEquals(currentTerm, reloadedPersistedState.getCurrentTerm());
424-
assertClusterStateEqual(GatewayMetaState.AsyncLucenePersistedState.resetVotingConfiguration(state),
424+
assertClusterStateEqual(GatewayMetaState.AsyncPersistedState.resetVotingConfiguration(state),
425425
reloadedPersistedState.getLastAcceptedState());
426426
assertNotNull(reloadedPersistedState.getLastAcceptedState().metadata().index(indexName));
427427
}

0 commit comments

Comments
 (0)