/** * Creates a new instance of {@link DefaultMetaMaster}. * * @param blockMaster a block master handle * @param masterContext the context for Alluxio master * @param executorServiceFactory a factory for creating the executor service to use for running * maintenance threads */ DefaultMetaMaster(BlockMaster blockMaster, CoreMasterContext masterContext, ExecutorServiceFactory executorServiceFactory) { super(masterContext, new SystemClock(), executorServiceFactory); mMasterAddress = new Address().setHost(ServerConfiguration.getOrDefault(PropertyKey.MASTER_HOSTNAME, "localhost")) .setRpcPort(mPort); mBlockMaster = blockMaster; mBlockMaster.registerLostWorkerFoundListener(mWorkerConfigStore::lostNodeFound); mBlockMaster.registerWorkerLostListener(mWorkerConfigStore::handleNodeLost); mBlockMaster.registerNewWorkerConfListener(mWorkerConfigStore::registerNewConf); if (URIUtils.isLocalFilesystem(ServerConfiguration .get(PropertyKey.MASTER_MOUNT_TABLE_ROOT_UFS))) { mUfs = UnderFileSystem.Factory .create("/", UnderFileSystemConfiguration.defaults()); } else { mUfs = UnderFileSystem.Factory.createForRoot(ServerConfiguration.global()); } }
/** * Creates a new instance of {@link DefaultMetaMaster}. * * @param blockMaster a block master handle * @param masterContext the context for Alluxio master * @param executorServiceFactory a factory for creating the executor service to use for running * maintenance threads */ DefaultMetaMaster(BlockMaster blockMaster, MasterContext masterContext, ExecutorServiceFactory executorServiceFactory) { super(masterContext, new SystemClock(), executorServiceFactory); mSafeModeManager = masterContext.getSafeModeManager(); mStartTimeMs = masterContext.getStartTimeMs(); mMasterAddress = new Address().setHost(Configuration.getOrDefault(PropertyKey.MASTER_HOSTNAME, "localhost")) .setRpcPort(masterContext.getPort()); mBlockMaster = blockMaster; mBlockMaster.registerLostWorkerFoundListener(mWorkerConfigStore::lostNodeFound); mBlockMaster.registerWorkerLostListener(mWorkerConfigStore::handleNodeLost); mBlockMaster.registerNewWorkerConfListener(mWorkerConfigStore::registerNewConf); }