update the current recvoerd files size in peer recovery

This commit is contained in:
kimchy 2010-08-16 09:11:51 +03:00
parent a012e0f1bd
commit 92aa91d7b2
2 changed files with 3 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();