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 GitHub
parent 07c0eeebb3
commit 00981643d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -2636,13 +2636,6 @@ public class HRegionServer extends Thread implements RegionServerServices, LastS
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();