Example usage for org.apache.hadoop.ha HAServiceStatus setNotReadyToBecomeActive

List of usage examples for org.apache.hadoop.ha HAServiceStatus setNotReadyToBecomeActive

Introduction

In this page you can find the example usage for org.apache.hadoop.ha HAServiceStatus setNotReadyToBecomeActive.

Prototype

public HAServiceStatus setNotReadyToBecomeActive(String reason) 

Source Link

Usage

From source file:io.hops.util.GroupMembershipService.java

License:Apache License

@Override
public synchronized HAServiceStatus getServiceStatus() throws IOException {
    checkAccess("getServiceState");
    HAServiceState haState = rmContext.getHAServiceState();
    HAServiceStatus ret = new HAServiceStatus(haState);
    if (isRMActive() || haState == HAServiceProtocol.HAServiceState.STANDBY) {
        ret.setReadyToBecomeActive();/*from   w ww . j a va 2s.c  om*/
    } else {
        ret.setNotReadyToBecomeActive("State is " + haState);
    }
    return ret;
}