Rename createNewTranslog to fileBasedRecovery (#31508)

We renamed `createNewTranslog` to `fileBasedRecovery` in the
RecoveryTarget but did not do this for RecoverySourceHandler.
This commit makes sure that we a consistent parameter in both
recovery source and target.
This commit is contained in:
Nhat Nguyen 2018-06-21 13:50:46 -04:00 committed by GitHub
parent 6f3e97f2b7
commit 048a92bf39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -449,13 +449,13 @@ public class RecoverySourceHandler {
} }
} }
void prepareTargetForTranslog(final boolean createNewTranslog, final int totalTranslogOps) throws IOException { void prepareTargetForTranslog(final boolean fileBasedRecovery, final int totalTranslogOps) throws IOException {
StopWatch stopWatch = new StopWatch().start(); StopWatch stopWatch = new StopWatch().start();
logger.trace("recovery [phase1]: prepare remote engine for translog"); logger.trace("recovery [phase1]: prepare remote engine for translog");
final long startEngineStart = stopWatch.totalTime().millis(); final long startEngineStart = stopWatch.totalTime().millis();
// Send a request preparing the new shard's translog to receive operations. This ensures the shard engine is started and disables // Send a request preparing the new shard's translog to receive operations. This ensures the shard engine is started and disables
// garbage collection (not the JVM's GC!) of tombstone deletes. // garbage collection (not the JVM's GC!) of tombstone deletes.
cancellableThreads.executeIO(() -> recoveryTarget.prepareForTranslogOperations(createNewTranslog, totalTranslogOps)); cancellableThreads.executeIO(() -> recoveryTarget.prepareForTranslogOperations(fileBasedRecovery, totalTranslogOps));
stopWatch.stop(); stopWatch.stop();
response.startTime = stopWatch.totalTime().millis() - startEngineStart; response.startTime = stopWatch.totalTime().millis() - startEngineStart;

View File

@ -423,7 +423,7 @@ public class RecoverySourceHandlerTests extends ESTestCase {
} }
@Override @Override
void prepareTargetForTranslog(final boolean createNewTranslog, final int totalTranslogOps) throws IOException { void prepareTargetForTranslog(final boolean fileBasedRecovery, final int totalTranslogOps) throws IOException {
prepareTargetForTranslogCalled.set(true); prepareTargetForTranslogCalled.set(true);
} }