HBASE-26216 Move HRegionServer.abort(String) to Abortable as a default method (#3642)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
This commit is contained in:
GeorryHuang 2021-08-28 22:23:23 +08:00 committed by Duo Zhang
parent 3b1482ef60
commit 033ff757fd
2 changed files with 10 additions and 7 deletions

View File

@ -37,6 +37,16 @@ public interface Abortable {
*/
void abort(String why, Throwable e);
/**
* It just call another abort method and the Throwable
* parameter is null.
* @param why Why we're aborting.
* @see Abortable#abort(String, Throwable)
*/
default void abort(String why) {
abort(why, null);
}
/**
* Check if the server or client was aborted.
* @return true if the server or client was aborted, false otherwise

View File

@ -2647,13 +2647,6 @@ public class HRegionServer extends Thread implements
return abortRequested.compareAndSet(false, true);
}
/**
* @see HRegionServer#abort(String, Throwable)
*/
public void abort(String reason) {
abort(reason, null);
}
@Override
public boolean isAborted() {
return abortRequested.get();