YARN-4058. Miscellaneous issues in NodeManager project (Naganarasimha G R via sjlee)
This commit is contained in:
parent
451c13b1de
commit
8d9476ec5f
@ -980,22 +980,24 @@ protected void startContainerInternal(
|
|||||||
if (flowRunIdStr != null && !flowRunIdStr.isEmpty()) {
|
if (flowRunIdStr != null && !flowRunIdStr.isEmpty()) {
|
||||||
flowRunId = Long.parseLong(flowRunIdStr);
|
flowRunId = Long.parseLong(flowRunIdStr);
|
||||||
}
|
}
|
||||||
Application application = new ApplicationImpl(dispatcher, user,
|
if (!context.getApplications().containsKey(applicationID)) {
|
||||||
flowName, flowVersion, flowRunId, applicationID, credentials, context);
|
Application application =
|
||||||
if (null == context.getApplications().putIfAbsent(applicationID,
|
new ApplicationImpl(dispatcher, user, flowName, flowVersion,
|
||||||
application)) {
|
flowRunId, applicationID, credentials, context);
|
||||||
LOG.info("Creating a new application reference for app "
|
if (context.getApplications().putIfAbsent(applicationID,
|
||||||
+ applicationID);
|
application) == null) {
|
||||||
LogAggregationContext logAggregationContext =
|
LOG.info("Creating a new application reference for app "
|
||||||
containerTokenIdentifier.getLogAggregationContext();
|
+ applicationID);
|
||||||
Map<ApplicationAccessType, String> appAcls =
|
LogAggregationContext logAggregationContext =
|
||||||
container.getLaunchContext().getApplicationACLs();
|
containerTokenIdentifier.getLogAggregationContext();
|
||||||
context.getNMStateStore().storeApplication(applicationID,
|
Map<ApplicationAccessType, String> appAcls =
|
||||||
buildAppProto(applicationID, user, credentials, appAcls,
|
container.getLaunchContext().getApplicationACLs();
|
||||||
logAggregationContext));
|
context.getNMStateStore().storeApplication(applicationID,
|
||||||
dispatcher.getEventHandler().handle(
|
buildAppProto(applicationID, user, credentials, appAcls,
|
||||||
new ApplicationInitEvent(applicationID, appAcls,
|
logAggregationContext));
|
||||||
logAggregationContext));
|
dispatcher.getEventHandler().handle(new ApplicationInitEvent(
|
||||||
|
applicationID, appAcls, logAggregationContext));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatcher.getEventHandler().handle(
|
dispatcher.getEventHandler().handle(
|
||||||
|
@ -39,8 +39,6 @@
|
|||||||
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
|
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
|
||||||
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent;
|
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEvent;
|
||||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
import org.apache.hadoop.yarn.event.AsyncDispatcher;
|
|
||||||
import org.apache.hadoop.yarn.event.Dispatcher;
|
|
||||||
import org.apache.hadoop.yarn.server.metrics.AppAttemptMetricsConstants;
|
import org.apache.hadoop.yarn.server.metrics.AppAttemptMetricsConstants;
|
||||||
import org.apache.hadoop.yarn.server.metrics.ApplicationMetricsConstants;
|
import org.apache.hadoop.yarn.server.metrics.ApplicationMetricsConstants;
|
||||||
import org.apache.hadoop.yarn.server.metrics.ContainerMetricsConstants;
|
import org.apache.hadoop.yarn.server.metrics.ContainerMetricsConstants;
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
import org.apache.hadoop.fs.Path;
|
import org.apache.hadoop.fs.Path;
|
||||||
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
|
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
|
||||||
import org.apache.hadoop.yarn.api.records.ApplicationId;
|
import org.apache.hadoop.yarn.api.records.ApplicationId;
|
||||||
|
import org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext;
|
||||||
import org.apache.hadoop.yarn.api.records.Container;
|
import org.apache.hadoop.yarn.api.records.Container;
|
||||||
import org.apache.hadoop.yarn.api.records.ContainerId;
|
import org.apache.hadoop.yarn.api.records.ContainerId;
|
||||||
import org.apache.hadoop.yarn.api.records.ContainerState;
|
import org.apache.hadoop.yarn.api.records.ContainerState;
|
||||||
@ -45,7 +46,6 @@
|
|||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
|
import org.apache.hadoop.yarn.api.records.timelineservice.TimelineEntityType;
|
||||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
import org.apache.hadoop.yarn.event.AsyncDispatcher;
|
|
||||||
import org.apache.hadoop.yarn.event.Dispatcher;
|
import org.apache.hadoop.yarn.event.Dispatcher;
|
||||||
import org.apache.hadoop.yarn.event.DrainDispatcher;
|
import org.apache.hadoop.yarn.event.DrainDispatcher;
|
||||||
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
|
import org.apache.hadoop.yarn.server.resourcemanager.RMContext;
|
||||||
@ -332,6 +332,12 @@ private static RMApp createRMApp(ApplicationId appId) {
|
|||||||
when(app.getRMAppMetrics()).thenReturn(
|
when(app.getRMAppMetrics()).thenReturn(
|
||||||
new RMAppMetrics(null, 0, 0, Integer.MAX_VALUE, Long.MAX_VALUE));
|
new RMAppMetrics(null, 0, 0, Integer.MAX_VALUE, Long.MAX_VALUE));
|
||||||
when(app.getApplicationTags()).thenReturn(Collections.<String> emptySet());
|
when(app.getApplicationTags()).thenReturn(Collections.<String> emptySet());
|
||||||
|
ApplicationSubmissionContext appSubmissionContext =
|
||||||
|
mock(ApplicationSubmissionContext.class);
|
||||||
|
when(appSubmissionContext.getPriority())
|
||||||
|
.thenReturn(Priority.newInstance(0));
|
||||||
|
when(app.getApplicationSubmissionContext())
|
||||||
|
.thenReturn(appSubmissionContext);
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user