Example usage for com.google.common.base Service.State equals

List of usage examples for com.google.common.base Service.State equals

Introduction

In this page you can find the example usage for com.google.common.base Service.State equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:io.fluo.cluster.runner.YarnAppRunner.java

public void status(boolean extraInfo) {
    checkIfInitialized();//ww w .jav  a2  s  .c o m
    if (!twillIdExists()) {
        System.out.print("A Fluo '" + config.getApplicationName() + "' application is not running in YARN.");
        return;
    }
    String twillId = getTwillId();
    TwillController controller = getTwillRunner().lookup(config.getApplicationName(),
            RunIds.fromString(twillId));
    if (controller == null) {
        logExistsButNotRunning();
        System.err
                .println("You can clean up this reference by running 'fluo stop <app>' or 'fluo kill <app>'.");
    } else {
        Service.State state = controller.state();
        System.out.println("A Fluo '" + config.getApplicationName() + "' application is " + state + " in YARN "
                + getFullInfo());

        if (state.equals(Service.State.RUNNING) && !allContainersRunning(controller)) {
            System.out.println(
                    "\nWARNING - The Fluo application is not running all desired containers!  YARN may not have enough available resources.  Application is currently running "
                            + containerStatus(controller));
        }

        if (extraInfo) {
            Collection<TwillRunResources> resources = controller.getResourceReport()
                    .getRunnableResources(FluoOracleMain.ORACLE_NAME);
            System.out.println("\nThe application has " + resources.size() + " of "
                    + config.getOracleInstances() + " desired Oracle containers:\n");
            TwillUtil.printResources(resources);

            resources = controller.getResourceReport().getRunnableResources(FluoWorkerMain.WORKER_NAME);
            System.out.println("\nThe application has " + resources.size() + " of "
                    + config.getWorkerInstances() + " desired Worker containers:\n");
            TwillUtil.printResources(resources);
        }
    }
}