update the current recvoerd files size in peer recovery
This commit is contained in:
parent
a012e0f1bd
commit
92aa91d7b2
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue