Search in sources :

Example 1 with MasterInfoField

use of alluxio.grpc.MasterInfoField in project alluxio by Alluxio.

the class SummaryCommand method printMetaMasterInfo.

/**
 * Prints Alluxio meta master information.
 */
private void printMetaMasterInfo() throws IOException {
    mIndentationLevel++;
    Set<MasterInfoField> masterInfoFilter = new HashSet<>(Arrays.asList(MasterInfoField.LEADER_MASTER_ADDRESS, MasterInfoField.WEB_PORT, MasterInfoField.RPC_PORT, MasterInfoField.START_TIME_MS, MasterInfoField.UP_TIME_MS, MasterInfoField.VERSION, MasterInfoField.SAFE_MODE, MasterInfoField.ZOOKEEPER_ADDRESSES));
    MasterInfo masterInfo = mMetaMasterClient.getMasterInfo(masterInfoFilter);
    print("Master Address: " + masterInfo.getLeaderMasterAddress());
    print("Web Port: " + masterInfo.getWebPort());
    print("Rpc Port: " + masterInfo.getRpcPort());
    print("Started: " + CommonUtils.convertMsToDate(masterInfo.getStartTimeMs(), mDateFormatPattern));
    print("Uptime: " + CommonUtils.convertMsToClockTime(masterInfo.getUpTimeMs()));
    print("Version: " + masterInfo.getVersion());
    print("Safe Mode: " + masterInfo.getSafeMode());
    List<String> zookeeperAddresses = masterInfo.getZookeeperAddressesList();
    if (zookeeperAddresses == null || zookeeperAddresses.isEmpty()) {
        print("Zookeeper Enabled: false");
    } else {
        print("Zookeeper Enabled: true");
        print("Zookeeper Addresses: ");
        mIndentationLevel++;
        for (String zkAddress : zookeeperAddresses) {
            print(zkAddress);
        }
        mIndentationLevel--;
    }
}
Also used : BlockMasterInfo(alluxio.wire.BlockMasterInfo) MasterInfo(alluxio.grpc.MasterInfo) BlockMasterInfoField(alluxio.wire.BlockMasterInfo.BlockMasterInfoField) MasterInfoField(alluxio.grpc.MasterInfoField) HashSet(java.util.HashSet)

Aggregations

MasterInfo (alluxio.grpc.MasterInfo)1 MasterInfoField (alluxio.grpc.MasterInfoField)1 BlockMasterInfo (alluxio.wire.BlockMasterInfo)1 BlockMasterInfoField (alluxio.wire.BlockMasterInfo.BlockMasterInfoField)1 HashSet (java.util.HashSet)1