Skip to content

Commit e44e34f

Browse files
committed
Rename deleteLocalTranslog to createNewTranslog
We introduced a new option `createNewTranslog` in #28181. However, we named that parameter as deleteLocalTranslog in other places. This commit makes sure to have a consistent naming in these places. Relates #28181
1 parent fafdb8d commit e44e34f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

server/src/main/java/org/elasticsearch/indices/recovery/PeerRecoveryTargetService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ class PrepareForTranslogOperationsRequestHandler implements TransportRequestHand
393393
public void messageReceived(RecoveryPrepareForTranslogOperationsRequest request, TransportChannel channel) throws Exception {
394394
try (RecoveryRef recoveryRef = onGoingRecoveries.getRecoverySafe(request.recoveryId(), request.shardId()
395395
)) {
396-
recoveryRef.target().prepareForTranslogOperations(request.deleteLocalTranslog(), request.totalTranslogOps());
396+
recoveryRef.target().prepareForTranslogOperations(request.createNewTranslog(), request.totalTranslogOps());
397397
}
398398
channel.sendResponse(TransportResponse.Empty.INSTANCE);
399399
}

server/src/main/java/org/elasticsearch/indices/recovery/RecoveryPrepareForTranslogOperationsRequest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class RecoveryPrepareForTranslogOperationsRequest extends TransportRequest {
3333
private final long recoveryId;
3434
private final ShardId shardId;
3535
private final int totalTranslogOps;
36-
private final boolean deleteLocalTranslog;
36+
private final boolean createNewTranslog;
3737

38-
RecoveryPrepareForTranslogOperationsRequest(long recoveryId, ShardId shardId, int totalTranslogOps, boolean deleteLocalTranslog) {
38+
RecoveryPrepareForTranslogOperationsRequest(long recoveryId, ShardId shardId, int totalTranslogOps, boolean createNewTranslog) {
3939
this.recoveryId = recoveryId;
4040
this.shardId = shardId;
4141
this.totalTranslogOps = totalTranslogOps;
42-
this.deleteLocalTranslog = deleteLocalTranslog;
42+
this.createNewTranslog = createNewTranslog;
4343
}
4444

4545
RecoveryPrepareForTranslogOperationsRequest(StreamInput in) throws IOException {
@@ -51,9 +51,9 @@ class RecoveryPrepareForTranslogOperationsRequest extends TransportRequest {
5151
in.readLong(); // maxUnsafeAutoIdTimestamp
5252
}
5353
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
54-
deleteLocalTranslog = in.readBoolean();
54+
createNewTranslog = in.readBoolean();
5555
} else {
56-
deleteLocalTranslog = true;
56+
createNewTranslog = true;
5757
}
5858
}
5959

@@ -70,10 +70,10 @@ public int totalTranslogOps() {
7070
}
7171

7272
/**
73-
* Whether or not the recover target should delete its local translog
73+
* Whether or not the recover target should create a new local translog
7474
*/
75-
boolean deleteLocalTranslog() {
76-
return deleteLocalTranslog;
75+
boolean createNewTranslog() {
76+
return createNewTranslog;
7777
}
7878

7979
@Override
@@ -86,7 +86,7 @@ public void writeTo(StreamOutput out) throws IOException {
8686
out.writeLong(IndexRequest.UNSET_AUTO_GENERATED_TIMESTAMP); // maxUnsafeAutoIdTimestamp
8787
}
8888
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
89-
out.writeBoolean(deleteLocalTranslog);
89+
out.writeBoolean(createNewTranslog);
9090
}
9191
}
9292
}

0 commit comments

Comments
 (0)