@Override public boolean supportsPath(String path) { if (path == null) { return false; } return URIUtils.isLocalFilesystem(path); } }
private void initFromBackup(AlluxioURI backup) throws IOException { UnderFileSystem ufs; if (URIUtils.isLocalFilesystem(backup.toString())) { ufs = UnderFileSystem.Factory.create("/", UnderFileSystemConfiguration.defaults(ServerConfiguration.global())); } else { ufs = UnderFileSystem.Factory.createForRoot(ServerConfiguration.global()); } try (UnderFileSystem closeUfs = ufs; InputStream ufsIn = ufs.open(backup.getPath())) { LOG.info("Initializing metadata from backup {}", backup); mBackupManager.initFromBackup(ufsIn); } }
/** * 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()); } }
private void initFromBackup(AlluxioURI backup) throws IOException { UnderFileSystem ufs; if (URIUtils.isLocalFilesystem(backup.toString())) { ufs = UnderFileSystem.Factory.create("/", UnderFileSystemConfiguration.defaults()); } else { ufs = UnderFileSystem.Factory.createForRoot(); } try (UnderFileSystem closeUfs = ufs; InputStream ufsIn = ufs.open(backup.getPath())) { LOG.info("Initializing metadata from backup {}", backup); mBackupManager.initFromBackup(ufsIn); } }