/** * Constructs a new {@link ImpersonationAuthenticator}. */ public ImpersonationAuthenticator() { mImpersonationGroups = new HashMap<>(); mImpersonationUsers = new HashMap<>(); for (PropertyKey key : Configuration.keySet()) { String value = Configuration.getOrDefault(key, null); // Process impersonation groups Matcher matcher = PropertyKey.Template.MASTER_IMPERSONATION_GROUPS_OPTION.match(key.getName()); if (matcher.matches()) { String connectionUser = matcher.group(1); if (connectionUser != null) { mImpersonationGroups.put(connectionUser, Sets.newHashSet(SPLITTER.split(value))); } } // Process impersonation users matcher = PropertyKey.Template.MASTER_IMPERSONATION_USERS_OPTION.match(key.getName()); if (matcher.matches()) { String connectionUser = matcher.group(1); if (connectionUser != null) { mImpersonationUsers.put(connectionUser, Sets.newHashSet(SPLITTER.split(value))); } } } }
@Override public List<ConfigProperty> getConfiguration(GetConfigurationOptions options) { List<ConfigProperty> configInfoList = new ArrayList<>(); for (PropertyKey key : Configuration.keySet()) { if (key.isBuiltIn()) { String source = Configuration.getSource(key).toString(); String value = Configuration.getOrDefault(key, null, ConfigurationValueOptions.defaults().useDisplayValue(true) .useRawValue(options.isRawValue())); configInfoList .add(new ConfigProperty().setName(key.getName()).setValue(value).setSource(source)); } } return configInfoList; }
/** * 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); }