Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaochen-zhou committed Apr 1, 2024
1 parent 202a21f commit b063d56
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,15 +254,13 @@ public boolean taskIsEnded(@NonNull TaskGroupLocation taskGroupLocation) {
public boolean isMasterNode() {
// must retry until the cluster have master node
try {
return Boolean.TRUE.equals(
RetryUtils.retryWithException(
() -> nodeEngine.getThisAddress().equals(nodeEngine.getMasterAddress()),
new RetryUtils.RetryMaterial(
Constant.OPERATION_RETRY_TIME,
true,
exception ->
exception instanceof NullPointerException && isRunning,
Constant.OPERATION_RETRY_SLEEP)));
return RetryUtils.retryWithException(
() -> nodeEngine.getThisAddress().equals(nodeEngine.getMasterAddress()),
new RetryUtils.RetryMaterial(
Constant.OPERATION_RETRY_TIME,
true,
exception -> exception instanceof NullPointerException && isRunning,
Constant.OPERATION_RETRY_SLEEP));
} catch (InterruptedException e) {
LOGGER.info("master node check interrupted");
return false;
Expand Down

0 comments on commit b063d56

Please sign in to comment.