Search in sources :

Example 1 with MasterStorageTierAssoc

use of alluxio.MasterStorageTierAssoc in project alluxio by Alluxio.

the class AlluxioMasterRestServiceHandler method getTierAliasComparator.

private Comparator<String> getTierAliasComparator() {
    return new Comparator<String>() {

        private MasterStorageTierAssoc mTierAssoc = new MasterStorageTierAssoc();

        @Override
        public int compare(String tier1, String tier2) {
            int ordinal1 = mTierAssoc.getOrdinal(tier1);
            int ordinal2 = mTierAssoc.getOrdinal(tier2);
            if (ordinal1 < ordinal2) {
                return -1;
            }
            if (ordinal1 == ordinal2) {
                return 0;
            }
            return 1;
        }
    };
}
Also used : MasterStorageTierAssoc(alluxio.MasterStorageTierAssoc) Comparator(java.util.Comparator)

Example 2 with MasterStorageTierAssoc

use of alluxio.MasterStorageTierAssoc in project alluxio by Alluxio.

the class BlockMaster method start.

@Override
public void start(boolean isLeader) throws IOException {
    super.start(isLeader);
    mGlobalStorageTierAssoc = new MasterStorageTierAssoc();
    if (isLeader) {
        mLostWorkerDetectionService = getExecutorService().submit(new HeartbeatThread(HeartbeatContext.MASTER_LOST_WORKER_DETECTION, new LostWorkerDetectionHeartbeatExecutor(), Configuration.getInt(PropertyKey.MASTER_HEARTBEAT_INTERVAL_MS)));
    }
}
Also used : MasterStorageTierAssoc(alluxio.MasterStorageTierAssoc) HeartbeatThread(alluxio.heartbeat.HeartbeatThread)

Aggregations

MasterStorageTierAssoc (alluxio.MasterStorageTierAssoc)2 HeartbeatThread (alluxio.heartbeat.HeartbeatThread)1 Comparator (java.util.Comparator)1