@Private
protected TezClient(String name, TezConfiguration tezConf, boolean isSession,
@Nullable Map<String, LocalResource> localResources,
@Nullable Credentials credentials, ServicePluginsDescriptor servicePluginsDescriptor) {
this.clientName = name;
this.isSession = isSession;
tezConf.setBoolean(TezConfiguration.TEZ_AM_SESSION_MODE, isSession);
try {
InetAddress ip = InetAddress.getLocalHost();
if (ip != null) {
tezConf.set(TezConfigurationConstants.TEZ_SUBMIT_HOST, ip.getCanonicalHostName());
tezConf.set(TezConfigurationConstants.TEZ_SUBMIT_HOST_ADDRESS, ip.getHostAddress());
}
} catch (UnknownHostException e) {
LOG.warn("The host name of the client the tez application was submitted from was unable to be retrieved", e);
}
this.amConfig = new AMConfiguration(tezConf, localResources, credentials);
this.apiVersionInfo = new TezApiVersionInfo();
this.servicePluginsDescriptor = servicePluginsDescriptor;
this.maxSubmitDAGRequestSizeThroughIPC = tezConf.getInt(CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH,
CommonConfigurationKeys.IPC_MAXIMUM_DATA_LENGTH_DEFAULT) -
tezConf.getInt(TezConfiguration.TEZ_IPC_PAYLOAD_RESERVED_BYTES,
TezConfiguration.TEZ_IPC_PAYLOAD_RESERVED_BYTES_DEFAULT);
Limits.setConfiguration(tezConf);
LOG.info("Tez Client Version: " + apiVersionInfo.toString());
}