Skip to content

Commit edb2dd0

Browse files
author
slfan1989
committed
YARN-11424. Fix CheckStyle.
1 parent c84c007 commit edb2dd0

File tree

6 files changed

+746
-43
lines changed

6 files changed

+746
-43
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,16 @@ private static void addDeprecatedKeys() {
217217

218218
public static final int DEFAULT_RM_APPLICATION_MAX_TAG_LENGTH = 100;
219219

220+
public static final String NODE_STORE_ROOT_DIR_NUM_RETRIES =
221+
RM_PREFIX + "nodestore-rootdir.num-retries";
222+
223+
public static final int NODE_STORE_ROOT_DIR_NUM_DEFAULT_RETRIES = 1000;
224+
225+
public static final String NODE_STORE_ROOT_DIR_RETRY_INTERVAL =
226+
RM_PREFIX + "nodestore-rootdir.retry-interval-ms";
227+
228+
public static final int NODE_STORE_ROOT_DIR_RETRY_DEFAULT_INTERVAL = 1000;
229+
220230
public static final String RM_APPLICATION_MASTER_SERVICE_PROCESSORS =
221231
RM_PREFIX + "application-master-service.processors";
222232

@@ -3070,6 +3080,10 @@ public static boolean isAclEnabled(Configuration conf) {
30703080
+ "amrmproxy.ha.enable";
30713081
public static final boolean DEFAULT_AMRM_PROXY_HA_ENABLED = false;
30723082

3083+
// Enable NM Dispatcher Metric default False.
3084+
public static final String NM_DISPATCHER_METRIC_ENABLED = NM_PREFIX + "dispatcher.metric.enable";
3085+
public static final boolean DEFAULT_NM_DISPATCHER_METRIC_ENABLED = false;
3086+
30733087
/**
30743088
* Default platform-agnostic CLASSPATH for YARN applications. A
30753089
* comma-separated list of CLASSPATH entries. The parameter expansion marker
@@ -4249,6 +4263,13 @@ public static boolean isAclEnabled(Configuration conf) {
42494263
"org.apache.hadoop.yarn.server.router.webapp."
42504264
+ "DefaultRequestInterceptorREST";
42514265

4266+
/**
4267+
* ApplicationSubmissionContextInterceptor configurations.
4268+
**/
4269+
public static final String ROUTER_ASC_INTERCEPTOR_MAX_SIZE =
4270+
ROUTER_PREFIX + "asc-interceptor-max-size";
4271+
public static final String DEFAULT_ROUTER_ASC_INTERCEPTOR_MAX_SIZE = "1MB";
4272+
42524273
/**
42534274
* The interceptor class used in FederationInterceptorREST should return
42544275
* partial AppReports.

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5065,6 +5065,16 @@
50655065
</description>
50665066
</property>
50675067

5068+
<property>
5069+
<name>yarn.nodemanager.dispatcher.metric.enable</name>
5070+
<value>false</value>
5071+
<description>
5072+
Yarn NodeManager enables Dispatcher Metric.
5073+
if true, will enable dispatcher metric; if false, will not enable dispatcher metric;
5074+
Default is false.
5075+
</description>
5076+
</property>
5077+
50685078
<property>
50695079
<name>yarn.router.interceptor.user-thread-pool.minimum-pool-size</name>
50705080
<value>5</value>
@@ -5184,4 +5194,20 @@
51845194
<value>1</value>
51855195
</property>
51865196

5197+
<property>
5198+
<description>
5199+
Number of Retries while trying to make root directory for node store.
5200+
</description>
5201+
<name>yarn.resourcemanager.nodestore-rootdir.num-retries</name>
5202+
<value>1000</value>
5203+
</property>
5204+
5205+
<property>
5206+
<description>
5207+
Interval in ms between retries while trying to make root directory for node store.
5208+
</description>
5209+
<name>yarn.resourcemanager.nodestore-rootdir.retry-interval-ms</name>
5210+
<value>1000</value>
5211+
</property>
5212+
51875213
</configuration>

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-common/src/main/java/org/apache/hadoop/yarn/server/federation/utils/FederationStateStoreFacade.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import java.util.Map;
2727
import java.util.concurrent.TimeUnit;
2828
import java.util.Random;
29+
import java.util.Collection;
2930

3031
import javax.cache.Cache;
3132
import javax.cache.CacheManager;
@@ -93,6 +94,7 @@
9394
import org.apache.hadoop.yarn.server.federation.store.records.SubClusterDeregisterRequest;
9495
import org.apache.hadoop.yarn.server.federation.store.records.SubClusterDeregisterResponse;
9596
import org.apache.hadoop.yarn.security.client.RMDelegationTokenIdentifier;
97+
import org.apache.hadoop.yarn.webapp.NotFoundException;
9698
import org.slf4j.Logger;
9799
import org.slf4j.LoggerFactory;
98100

@@ -812,6 +814,24 @@ public void storeNewToken(RMDelegationTokenIdentifier identifier,
812814
stateStore.storeNewToken(request);
813815
}
814816

817+
/**
818+
* The Router Supports Store RMDelegationTokenIdentifier{@link RMDelegationTokenIdentifier}.
819+
*
820+
* @param identifier delegation tokens from the RM.
821+
* @param renewDate renewDate.
822+
* @param tokenInfo tokenInfo.
823+
* @throws YarnException if the call to the state store is unsuccessful.
824+
* @throws IOException An IO Error occurred.
825+
*/
826+
public void storeNewToken(RMDelegationTokenIdentifier identifier,
827+
long renewDate, String tokenInfo) throws YarnException, IOException {
828+
LOG.info("storing RMDelegation token with sequence number: {}.",
829+
identifier.getSequenceNumber());
830+
RouterStoreToken storeToken = RouterStoreToken.newInstance(identifier, renewDate, tokenInfo);
831+
RouterRMTokenRequest request = RouterRMTokenRequest.newInstance(storeToken);
832+
stateStore.storeNewToken(request);
833+
}
834+
815835
/**
816836
* The Router Supports Update RMDelegationTokenIdentifier{@link RMDelegationTokenIdentifier}.
817837
*
@@ -829,6 +849,24 @@ public void updateStoredToken(RMDelegationTokenIdentifier identifier,
829849
stateStore.updateStoredToken(request);
830850
}
831851

852+
/**
853+
* The Router Supports Update RMDelegationTokenIdentifier{@link RMDelegationTokenIdentifier}.
854+
*
855+
* @param identifier delegation tokens from the RM
856+
* @param renewDate renewDate
857+
* @param tokenInfo tokenInfo.
858+
* @throws YarnException if the call to the state store is unsuccessful.
859+
* @throws IOException An IO Error occurred.
860+
*/
861+
public void updateStoredToken(RMDelegationTokenIdentifier identifier,
862+
long renewDate, String tokenInfo) throws YarnException, IOException {
863+
LOG.info("updating RMDelegation token with sequence number: {}.",
864+
identifier.getSequenceNumber());
865+
RouterStoreToken storeToken = RouterStoreToken.newInstance(identifier, renewDate, tokenInfo);
866+
RouterRMTokenRequest request = RouterRMTokenRequest.newInstance(storeToken);
867+
stateStore.updateStoredToken(request);
868+
}
869+
832870
/**
833871
* The Router Supports Remove RMDelegationTokenIdentifier{@link RMDelegationTokenIdentifier}.
834872
*
@@ -1176,4 +1214,23 @@ public boolean deregisterSubCluster(SubClusterId subClusterId,
11761214
}
11771215
return false;
11781216
}
1217+
1218+
/**
1219+
* Get active subclusters.
1220+
*
1221+
* @return We will return a list of active subclusters as a Collection.
1222+
*/
1223+
public Collection<SubClusterInfo> getActiveSubClusters()
1224+
throws NotFoundException {
1225+
try {
1226+
Map<SubClusterId, SubClusterInfo> subClusterMap = getSubClusters(true);
1227+
if (MapUtils.isEmpty(subClusterMap)) {
1228+
throw new NotFoundException("Not Found SubClusters.");
1229+
}
1230+
return subClusterMap.values();
1231+
} catch (Exception e) {
1232+
LOG.error("getActiveSubClusters failed.", e);
1233+
return null;
1234+
}
1235+
}
11791236
}

0 commit comments

Comments
 (0)