/** * Create RMDelegatedNodeLabelsUpdater based on configuration. */ protected RMDelegatedNodeLabelsUpdater createRMDelegatedNodeLabelsUpdater() { if (conf.getBoolean(YarnConfiguration.NODE_LABELS_ENABLED, YarnConfiguration.DEFAULT_NODE_LABELS_ENABLED) && YarnConfiguration.isDelegatedCentralizedNodeLabelConfiguration( conf)) { return new RMDelegatedNodeLabelsUpdater(rmContext); } else { return null; } }
@Override protected void serviceInit(Configuration conf) throws Exception { allNodesLabelUpdateInterval = conf.getLong( YarnConfiguration.RM_NODE_LABELS_PROVIDER_FETCH_INTERVAL_MS, YarnConfiguration.DEFAULT_RM_NODE_LABELS_PROVIDER_FETCH_INTERVAL_MS); rmNodeLabelsMappingProvider = createRMNodeLabelsMappingProvider(conf); addService(rmNodeLabelsMappingProvider); super.serviceInit(conf); }
this.rmContext.getRMDelegatedNodeLabelsUpdater().updateNodeLabels(nodeId);