Skip to content

Commit

Permalink
Rename deleteLocalTranslog to createNewTranslog
Browse files Browse the repository at this point in the history
We introduced a new option `createNewTranslog` in elastic#28181. However, we
named that parameter as deleteLocalTranslog in other places. This commit
makes sure to have a consistent naming in these places.

Relates elastic#28181
  • Loading branch information
dnhatn committed Jan 13, 2018
1 parent fafdb8d commit e44e34f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ class PrepareForTranslogOperationsRequestHandler implements TransportRequestHand
public void messageReceived(RecoveryPrepareForTranslogOperationsRequest request, TransportChannel channel) throws Exception {
try (RecoveryRef recoveryRef = onGoingRecoveries.getRecoverySafe(request.recoveryId(), request.shardId()
)) {
recoveryRef.target().prepareForTranslogOperations(request.deleteLocalTranslog(), request.totalTranslogOps());
recoveryRef.target().prepareForTranslogOperations(request.createNewTranslog(), request.totalTranslogOps());
}
channel.sendResponse(TransportResponse.Empty.INSTANCE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class RecoveryPrepareForTranslogOperationsRequest extends TransportRequest {
private final long recoveryId;
private final ShardId shardId;
private final int totalTranslogOps;
private final boolean deleteLocalTranslog;
private final boolean createNewTranslog;

RecoveryPrepareForTranslogOperationsRequest(long recoveryId, ShardId shardId, int totalTranslogOps, boolean deleteLocalTranslog) {
RecoveryPrepareForTranslogOperationsRequest(long recoveryId, ShardId shardId, int totalTranslogOps, boolean createNewTranslog) {
this.recoveryId = recoveryId;
this.shardId = shardId;
this.totalTranslogOps = totalTranslogOps;
this.deleteLocalTranslog = deleteLocalTranslog;
this.createNewTranslog = createNewTranslog;
}

RecoveryPrepareForTranslogOperationsRequest(StreamInput in) throws IOException {
Expand All @@ -51,9 +51,9 @@ class RecoveryPrepareForTranslogOperationsRequest extends TransportRequest {
in.readLong(); // maxUnsafeAutoIdTimestamp
}
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
deleteLocalTranslog = in.readBoolean();
createNewTranslog = in.readBoolean();
} else {
deleteLocalTranslog = true;
createNewTranslog = true;
}
}

Expand All @@ -70,10 +70,10 @@ public int totalTranslogOps() {
}

/**
* Whether or not the recover target should delete its local translog
* Whether or not the recover target should create a new local translog
*/
boolean deleteLocalTranslog() {
return deleteLocalTranslog;
boolean createNewTranslog() {
return createNewTranslog;
}

@Override
Expand All @@ -86,7 +86,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeLong(IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP); // maxUnsafeAutoIdTimestamp
}
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
out.writeBoolean(deleteLocalTranslog);
out.writeBoolean(createNewTranslog);
}
}
}

0 comments on commit e44e34f

Please sign in to comment.