YARN-3634. TestMRTimelineEventHandling and TestApplication are broken. Contributed by Sangjin Lee.
(cherry picked from commit b059dd4882fd759e4762cc11c019be4b68fb74c1)
This commit is contained in:
parent
51d092faef
commit
d275677e24
@ -1053,6 +1053,13 @@
|
||||
<groupId>org.apache.hbase</groupId>
|
||||
<artifactId>hbase-client</artifactId>
|
||||
<version>${hbase.version}</version>
|
||||
<exclusions>
|
||||
<!-- exclude jdk.tools (1.7) as we're not managing it -->
|
||||
<exclusion>
|
||||
<groupId>jdk.tools</groupId>
|
||||
<artifactId>jdk.tools</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.phoenix</groupId>
|
||||
@ -1091,6 +1098,11 @@
|
||||
<scope>test</scope>
|
||||
<optional>true</optional>
|
||||
<exclusions>
|
||||
<!-- exclude jdk.tools (1.7) as we're not managing it -->
|
||||
<exclusion>
|
||||
<groupId>jdk.tools</groupId>
|
||||
<artifactId>jdk.tools</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.jruby</groupId>
|
||||
<artifactId>jruby-complete</artifactId>
|
||||
|
@ -81,6 +81,11 @@ protected void serviceStart() throws Exception {
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_THREAD_COUNT));
|
||||
|
||||
server.start();
|
||||
collectorServerAddress = conf.updateConnectAddr(
|
||||
YarnConfiguration.NM_BIND_HOST,
|
||||
YarnConfiguration.NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
server.getListenerAddress());
|
||||
// start remaining services
|
||||
super.serviceStart();
|
||||
LOG.info("NMCollectorService started at " + collectorServerAddress);
|
||||
|
@ -962,7 +962,7 @@ protected void startContainerInternal(
|
||||
TimelineUtils.FLOW_RUN_ID_TAG_PREFIX);
|
||||
long flowRunId = 0L;
|
||||
if (flowRunIdStr != null && !flowRunIdStr.isEmpty()) {
|
||||
flowRunId = Long.valueOf(flowRunIdStr);
|
||||
flowRunId = Long.parseLong(flowRunIdStr);
|
||||
}
|
||||
Application application = new ApplicationImpl(dispatcher, user,
|
||||
flowName, flowVersion, flowRunId, applicationID, credentials, context);
|
||||
|
@ -539,7 +539,8 @@ private class WrappedApplication {
|
||||
new ApplicationACLsManager(conf));
|
||||
when(context.getNMTokenSecretManager()).thenReturn(nmTokenSecretMgr);
|
||||
when(context.getNMStateStore()).thenReturn(stateStoreService);
|
||||
|
||||
when(context.getConf()).thenReturn(conf);
|
||||
|
||||
// Setting master key
|
||||
MasterKey masterKey = new MasterKeyPBImpl();
|
||||
masterKey.setKeyId(123);
|
||||
|
@ -69,9 +69,7 @@ public class NodeTimelineCollectorManager extends TimelineCollectorManager {
|
||||
|
||||
private String timelineRestServerBindAddress;
|
||||
|
||||
private CollectorNodemanagerProtocol nmCollectorService;
|
||||
|
||||
private InetSocketAddress nmCollectorServiceAddress;
|
||||
private volatile CollectorNodemanagerProtocol nmCollectorService;
|
||||
|
||||
static final String COLLECTOR_MANAGER_ATTR_KEY = "collector.manager";
|
||||
|
||||
@ -84,19 +82,8 @@ protected NodeTimelineCollectorManager() {
|
||||
super(NodeTimelineCollectorManager.class.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serviceInit(Configuration conf) throws Exception {
|
||||
this.nmCollectorServiceAddress = conf.getSocketAddr(
|
||||
YarnConfiguration.NM_BIND_HOST,
|
||||
YarnConfiguration.NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_PORT);
|
||||
super.serviceInit(conf);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void serviceStart() throws Exception {
|
||||
nmCollectorService = getNMCollectorService();
|
||||
startWebApp();
|
||||
super.serviceStart();
|
||||
}
|
||||
@ -176,7 +163,7 @@ private void reportNewCollectorToNM(ApplicationId appId)
|
||||
this.timelineRestServerBindAddress);
|
||||
LOG.info("Report a new collector for application: " + appId +
|
||||
" to the NM Collector Service.");
|
||||
nmCollectorService.reportNewCollectorInfo(request);
|
||||
getNMCollectorService().reportNewCollectorInfo(request);
|
||||
}
|
||||
|
||||
private void updateTimelineCollectorContext(
|
||||
@ -186,7 +173,7 @@ private void updateTimelineCollectorContext(
|
||||
GetTimelineCollectorContextRequest.newInstance(appId);
|
||||
LOG.info("Get timeline collector context for " + appId);
|
||||
GetTimelineCollectorContextResponse response =
|
||||
nmCollectorService.getTimelineCollectorContext(request);
|
||||
getNMCollectorService().getTimelineCollectorContext(request);
|
||||
String userId = response.getUserId();
|
||||
if (userId != null && !userId.isEmpty()) {
|
||||
collector.getTimelineEntityContext().setUserId(userId);
|
||||
@ -207,13 +194,26 @@ private void updateTimelineCollectorContext(
|
||||
|
||||
@VisibleForTesting
|
||||
protected CollectorNodemanagerProtocol getNMCollectorService() {
|
||||
Configuration conf = getConfig();
|
||||
final YarnRPC rpc = YarnRPC.create(conf);
|
||||
if (nmCollectorService == null) {
|
||||
synchronized (this) {
|
||||
if (nmCollectorService == null) {
|
||||
Configuration conf = getConfig();
|
||||
InetSocketAddress nmCollectorServiceAddress = conf.getSocketAddr(
|
||||
YarnConfiguration.NM_BIND_HOST,
|
||||
YarnConfiguration.NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_ADDRESS,
|
||||
YarnConfiguration.DEFAULT_NM_COLLECTOR_SERVICE_PORT);
|
||||
LOG.info("nmCollectorServiceAddress: " + nmCollectorServiceAddress);
|
||||
final YarnRPC rpc = YarnRPC.create(conf);
|
||||
|
||||
// TODO Security settings.
|
||||
return (CollectorNodemanagerProtocol) rpc.getProxy(
|
||||
CollectorNodemanagerProtocol.class,
|
||||
nmCollectorServiceAddress, conf);
|
||||
// TODO Security settings.
|
||||
nmCollectorService = (CollectorNodemanagerProtocol) rpc.getProxy(
|
||||
CollectorNodemanagerProtocol.class,
|
||||
nmCollectorServiceAddress, conf);
|
||||
}
|
||||
}
|
||||
}
|
||||
return nmCollectorService;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
Loading…
Reference in New Issue
Block a user