-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Removing dead code in RecoveryTarget. #4278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,51 +177,6 @@ public boolean reset(CancellableThreads newTargetCancellableThreads) throws IOEx | |
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * cancel the recovery. calling this method will clean temporary files and release the store | ||
| * unless this object is in use (in which case it will be cleaned once all ongoing users call | ||
| * {@link #decRef()} | ||
| * <p> | ||
| * if {@link #cancellableThreads()} was used, the threads will be interrupted. | ||
| */ | ||
| public void cancel(String reason) { | ||
| if (finished.compareAndSet(false, true)) { | ||
| try { | ||
| logger.debug("recovery canceled (reason: [{}])", reason); | ||
| cancellableThreads.cancel(reason); | ||
| } finally { | ||
| // release the initial reference. recovery files will be cleaned as soon as ref count goes to zero, potentially now | ||
| decRef(); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * fail the recovery and call listener | ||
| * | ||
| * @param e exception that encapsulating the failure | ||
| * @param sendShardFailure indicates whether to notify the cluster-manager of the shard failure | ||
| */ | ||
| public void fail(RecoveryFailedException e, boolean sendShardFailure) { | ||
|
||
| super.fail(e, sendShardFailure); | ||
| } | ||
|
|
||
| /** mark the current recovery as done */ | ||
| public void markAsDone() { | ||
| if (finished.compareAndSet(false, true)) { | ||
| assert multiFileWriter.tempFileNames.isEmpty() : "not all temporary files are renamed"; | ||
| try { | ||
| // this might still throw an exception ie. if the shard is CLOSED due to some other event. | ||
kartg marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // it's safer to decrement the reference in a try finally here. | ||
| indexShard.postRecovery("peer recovery done"); | ||
| } finally { | ||
| // release the initial reference. recovery files will be cleaned as soon as ref count goes to zero, potentially now | ||
| decRef(); | ||
| } | ||
| listener.onDone(state()); | ||
| } | ||
| } | ||
|
|
||
| @Override | ||
| protected void closeInternal() { | ||
| try { | ||
|
|
@@ -246,8 +201,6 @@ protected String getPrefix() { | |
| @Override | ||
| protected void onDone() { | ||
| assert multiFileWriter.tempFileNames.isEmpty() : "not all temporary files are renamed"; | ||
| // this might still throw an exception ie. if the shard is CLOSED due to some other event. | ||
| // it's safer to decrement the reference in a try finally here. | ||
| indexShard.postRecovery("peer recovery done"); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.