Skip to content

Commit e79c8f3

Browse files
committed
mvg feedback
1 parent 0348221 commit e79c8f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/AutoFollowCoordinator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ abstract static class AutoFollower {
347347
private volatile CountDown autoFollowPatternsCountDown;
348348
private volatile AtomicArray<AutoFollowResult> autoFollowResults;
349349
private volatile boolean stop;
350-
private volatile List<String> lastActivePatterns = Collections.emptyList();
350+
private volatile List<String> lastActivePatterns = List.of();
351351

352352
AutoFollower(final String remoteCluster,
353353
final Consumer<List<AutoFollowResult>> statsUpdater,
@@ -404,7 +404,7 @@ void start() {
404404
// order to avoid timeouts when waiting for the next remote cluster state
405405
// version that might never arrive
406406
final long nextMetadataVersion = Objects.equals(patterns, lastActivePatterns) ? metadataVersion + 1 : metadataVersion;
407-
this.lastActivePatterns = Collections.unmodifiableList(patterns);
407+
this.lastActivePatterns = List.copyOf(patterns);
408408

409409
final Thread thread = Thread.currentThread();
410410
getRemoteClusterState(remoteCluster, Math.max(1L, nextMetadataVersion), (remoteClusterStateResponse, remoteError) -> {

0 commit comments

Comments
 (0)