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:
parent
3b1482ef60
commit
033ff757fd
|
@ -37,6 +37,16 @@ public interface Abortable {
|
||||||
*/
|
*/
|
||||||
void abort(String why, Throwable e);
|
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.
|
* Check if the server or client was aborted.
|
||||||
* @return true if the server or client was aborted, false otherwise
|
* @return true if the server or client was aborted, false otherwise
|
||||||
|
|
|
@ -2647,13 +2647,6 @@ public class HRegionServer extends Thread implements
|
||||||
return abortRequested.compareAndSet(false, true);
|
return abortRequested.compareAndSet(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see HRegionServer#abort(String, Throwable)
|
|
||||||
*/
|
|
||||||
public void abort(String reason) {
|
|
||||||
abort(reason, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAborted() {
|
public boolean isAborted() {
|
||||||
return abortRequested.get();
|
return abortRequested.get();
|
||||||
|
|
Loading…
Reference in New Issue