diff --git a/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java b/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java index f3d2a50d1d943..679c56fbc79c3 100644 --- a/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java +++ b/server/src/main/java/org/opensearch/indices/replication/OngoingSegmentReplications.java @@ -99,7 +99,7 @@ void startSegmentCopy(GetSegmentFilesRequest request, ActionListener future = new ListenableFuture<>(); private final List resources = new CopyOnWriteArrayList<>(); private final Logger logger; - private final AtomicBoolean active = new AtomicBoolean(); + private final AtomicBoolean isReplicating = new AtomicBoolean(); /** * Constructor. @@ -99,7 +99,7 @@ class SegmentReplicationSourceHandler { * @param listener {@link ActionListener} that completes with the list of files sent. */ public synchronized void sendFiles(GetSegmentFilesRequest request, ActionListener listener) { - if (active.compareAndSet(false, true) == false) { + if (isReplicating.compareAndSet(false, true) == false) { throw new OpenSearchException("Replication to {} is already running.", shard.shardId()); } future.addListener(listener, OpenSearchExecutors.newDirectExecutorService()); @@ -164,7 +164,7 @@ CopyState getCopyState() { return copyState; } - public boolean isActive() { - return active.get(); + public boolean isReplicating() { + return isReplicating.get(); } }