YARN-7152. [ATSv2] Registering timeline client before AMRMClient service init throw exception (Rohith Sharma K S via Varun Saxena)
This commit is contained in:
parent
8b2235b367
commit
6e0d50d6ae
|
@ -28,7 +28,6 @@ import org.apache.hadoop.classification.InterfaceAudience;
|
||||||
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
import org.apache.hadoop.classification.InterfaceAudience.Private;
|
||||||
import org.apache.hadoop.classification.InterfaceAudience.Public;
|
import org.apache.hadoop.classification.InterfaceAudience.Public;
|
||||||
import org.apache.hadoop.classification.InterfaceStability;
|
import org.apache.hadoop.classification.InterfaceStability;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
|
||||||
import org.apache.hadoop.service.AbstractService;
|
import org.apache.hadoop.service.AbstractService;
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
|
import org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse;
|
||||||
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
|
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
|
||||||
|
@ -42,7 +41,6 @@ import org.apache.hadoop.yarn.api.records.Priority;
|
||||||
import org.apache.hadoop.yarn.api.records.Resource;
|
import org.apache.hadoop.yarn.api.records.Resource;
|
||||||
import org.apache.hadoop.yarn.api.records.UpdateContainerRequest;
|
import org.apache.hadoop.yarn.api.records.UpdateContainerRequest;
|
||||||
import org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl;
|
import org.apache.hadoop.yarn.client.api.impl.AMRMClientImpl;
|
||||||
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
|
||||||
import org.apache.hadoop.yarn.exceptions.YarnException;
|
import org.apache.hadoop.yarn.exceptions.YarnException;
|
||||||
import org.apache.hadoop.yarn.util.resource.Resources;
|
import org.apache.hadoop.yarn.util.resource.Resources;
|
||||||
|
|
||||||
|
@ -57,7 +55,6 @@ public abstract class AMRMClient<T extends AMRMClient.ContainerRequest> extends
|
||||||
private static final Log LOG = LogFactory.getLog(AMRMClient.class);
|
private static final Log LOG = LogFactory.getLog(AMRMClient.class);
|
||||||
|
|
||||||
private TimelineV2Client timelineV2Client;
|
private TimelineV2Client timelineV2Client;
|
||||||
private boolean timelineServiceV2Enabled;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new instance of AMRMClient.
|
* Create a new instance of AMRMClient.
|
||||||
|
@ -82,12 +79,6 @@ public abstract class AMRMClient<T extends AMRMClient.ContainerRequest> extends
|
||||||
nmTokenCache = NMTokenCache.getSingleton();
|
nmTokenCache = NMTokenCache.getSingleton();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void serviceInit(Configuration conf) throws Exception {
|
|
||||||
super.serviceInit(conf);
|
|
||||||
timelineServiceV2Enabled = YarnConfiguration.timelineServiceV2Enabled(conf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object to represent a single container request for resources. Scheduler
|
* Object to represent a single container request for resources. Scheduler
|
||||||
* documentation should be consulted for the specifics of how the parameters
|
* documentation should be consulted for the specifics of how the parameters
|
||||||
|
@ -696,18 +687,9 @@ public abstract class AMRMClient<T extends AMRMClient.ContainerRequest> extends
|
||||||
* V2 client will be updated dynamically if registered.
|
* V2 client will be updated dynamically if registered.
|
||||||
*
|
*
|
||||||
* @param client the timeline v2 client to register
|
* @param client the timeline v2 client to register
|
||||||
* @throws YarnException when this method is invoked even when ATS V2 is not
|
|
||||||
* configured.
|
|
||||||
*/
|
*/
|
||||||
public void registerTimelineV2Client(TimelineV2Client client)
|
public void registerTimelineV2Client(TimelineV2Client client) {
|
||||||
throws YarnException {
|
|
||||||
if (timelineServiceV2Enabled) {
|
|
||||||
timelineV2Client = client;
|
timelineV2Client = client;
|
||||||
} else {
|
|
||||||
LOG.error("Trying to register timeline v2 client when not configured.");
|
|
||||||
throw new YarnException(
|
|
||||||
"register timeline v2 client when not configured.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue