}
logger.trace("[{}][{}] starting recovery to {}, mark_as_relocated {}", request.shardId().index().name(), request.shardId().id(), request.targetNode(), request.markAsRelocated());
final RecoveryResponse response = new RecoveryResponse();
final BlobRecoveryHandler blobRecoveryHandler;
if (BlobIndices.isBlobIndex(shard.shardId().getIndex())) {
blobRecoveryHandler = new BlobRecoveryHandler(
transportService, recoverySettings, blobTransferTarget, blobIndices, shard, request);
} else {
blobRecoveryHandler = null;
}
shard.recover(new Engine.RecoveryHandler() {
@Override
public void phase1(final SnapshotIndexCommit snapshot) throws ElasticsearchException {
long totalSize = 0;
long existingTotalSize = 0;
try {
if (blobRecoveryHandler != null) {
blobRecoveryHandler.phase1();
}
StopWatch stopWatch = new StopWatch().start();
for (String name : snapshot.getFiles()) {
StoreFileMetaData md = shard.store().getMetadata().get(name);