From 92aa91d7b2ee0cafae7eb364bd55562fb983ea7d Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 16 Aug 2010 09:11:51 +0300 Subject: [PATCH] update the current recvoerd files size in peer recovery --- .../org/elasticsearch/index/shard/recovery/OnGoingRecovery.java | 2 ++ .../org/elasticsearch/index/shard/recovery/RecoveryTarget.java | 1 + 2 files changed, 3 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/OnGoingRecovery.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/OnGoingRecovery.java index eb6487b2a9f..5bf2978ebff 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/OnGoingRecovery.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/OnGoingRecovery.java @@ -24,6 +24,7 @@ import org.elasticsearch.common.util.concurrent.ConcurrentCollections; import java.util.List; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.atomic.AtomicLong; /** * @author kimchy (shay.banon) @@ -48,4 +49,5 @@ public class OnGoingRecovery { volatile Stage stage = Stage.INIT; volatile long currentTranslogOperations = 0; + AtomicLong currentFilesSize = new AtomicLong(); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/RecoveryTarget.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/RecoveryTarget.java index f0cbb6cd37d..07ba60320c0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/RecoveryTarget.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/shard/recovery/RecoveryTarget.java @@ -395,6 +395,7 @@ public class RecoveryTarget extends AbstractComponent { synchronized (indexOutput) { try { indexOutput.writeBytes(request.content(), request.contentLength()); + onGoingRecovery.currentFilesSize.addAndGet(request.contentLength()); if (indexOutput.getFilePointer() == request.length()) { // we are done indexOutput.close();