-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
YARN-9425. Make initialDelay configurable for FederationStateStoreService#scheduledExecutorService #4731
YARN-9425. Make initialDelay configurable for FederationStateStoreService#scheduledExecutorService #4731
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,7 @@ public class FederationStateStoreService extends AbstractService | |
private FederationStateStore stateStoreClient = null; | ||
private SubClusterId subClusterId; | ||
private long heartbeatInterval; | ||
private long heartbeatInitialDelay; | ||
private RMContext rmContext; | ||
|
||
public FederationStateStoreService(RMContext rmContext) { | ||
|
@@ -120,6 +121,14 @@ protected void serviceInit(Configuration conf) throws Exception { | |
heartbeatInterval = | ||
YarnConfiguration.DEFAULT_FEDERATION_STATESTORE_HEARTBEAT_INTERVAL_SECS; | ||
} | ||
|
||
heartbeatInitialDelay = conf.getLong( | ||
YarnConfiguration.FEDERATION_STATESTORE_HEARTBEAT_INITIAL_DELAY_SECS, | ||
YarnConfiguration.DEFAULT_FEDERATION_STATESTORE_HEARTBEAT_INITIAL_DELAY_SECS); | ||
if (heartbeatInitialDelay <= 0) { | ||
heartbeatInitialDelay = | ||
YarnConfiguration.DEFAULT_FEDERATION_STATESTORE_HEARTBEAT_INITIAL_DELAY_SECS; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a warn log here, that the configured value for the Config is wrong it should be greater than 0, so using the default of.... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I will address this in my next commit. |
||
LOG.info("Initialized federation membership service."); | ||
|
||
super.serviceInit(conf); | ||
|
@@ -196,7 +205,7 @@ private void registerAndInitializeHeartbeat() { | |
scheduledExecutorService = | ||
HadoopExecutors.newSingleThreadScheduledExecutor(); | ||
scheduledExecutorService.scheduleWithFixedDelay(stateStoreHeartbeat, | ||
heartbeatInterval, heartbeatInterval, TimeUnit.SECONDS); | ||
heartbeatInitialDelay, heartbeatInterval, TimeUnit.SECONDS); | ||
LOG.info("Started federation membership heartbeat with interval: {}", | ||
heartbeatInterval); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the config support rather than binding it just with Seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ayushtkn for reviewing. Can you please elaborate on this? Are you suggesting to remove
-secs
and_SECS
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, don't bind it with seconds, just make seconds as the default type, in case no unit is specified use Seconds, else whatever unit is specified. conf.getTimeDuration should do it for you.
Check this if it help:
hadoop/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java
Lines 65 to 70 in e0c8c6e