YARN-7954. Set component status to STOPPED when YARN service is stopped. Contributed by Gour Saha
This commit is contained in:
parent
f20e10b2dd
commit
31009034bd
@ -96,6 +96,7 @@
|
|||||||
|
|
||||||
import static org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY;
|
import static org.apache.hadoop.fs.FileSystem.FS_DEFAULT_NAME_KEY;
|
||||||
import static org.apache.hadoop.registry.client.api.RegistryConstants.*;
|
import static org.apache.hadoop.registry.client.api.RegistryConstants.*;
|
||||||
|
import static org.apache.hadoop.yarn.api.records.ContainerExitStatus.KILLED_AFTER_APP_COMPLETION;
|
||||||
import static org.apache.hadoop.yarn.service.api.ServiceApiConstants.*;
|
import static org.apache.hadoop.yarn.service.api.ServiceApiConstants.*;
|
||||||
import static org.apache.hadoop.yarn.service.component.ComponentEventType.*;
|
import static org.apache.hadoop.yarn.service.component.ComponentEventType.*;
|
||||||
|
|
||||||
@ -253,6 +254,13 @@ public void serviceInit(Configuration conf) throws Exception {
|
|||||||
public void serviceStop() throws Exception {
|
public void serviceStop() throws Exception {
|
||||||
LOG.info("Stopping service scheduler");
|
LOG.info("Stopping service scheduler");
|
||||||
|
|
||||||
|
// Mark component-instances/containers as STOPPED
|
||||||
|
if (YarnConfiguration.timelineServiceV2Enabled(getConfig())) {
|
||||||
|
for (ContainerId containerId : getLiveInstances().keySet()) {
|
||||||
|
serviceTimelinePublisher.componentInstanceFinished(containerId,
|
||||||
|
KILLED_AFTER_APP_COMPLETION, diagnostics.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
if (executorService != null) {
|
if (executorService != null) {
|
||||||
executorService.shutdownNow();
|
executorService.shutdownNow();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user