|
@@ -133,7 +133,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
this.maxThreadPoolSize = conf.getInt(
|
|
|
YarnConfiguration.NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE,
|
|
|
YarnConfiguration.DEFAULT_NM_CLIENT_ASYNC_THREAD_POOL_MAX_SIZE);
|
|
|
- LOG.info("Upper bound of the thread pool size is " + maxThreadPoolSize);
|
|
|
+ LOG.info("Upper bound of the thread pool size is {}.", maxThreadPoolSize);
|
|
|
|
|
|
client.init(conf);
|
|
|
super.serviceInit(conf);
|
|
@@ -186,9 +186,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
// always increasing the pool-size
|
|
|
int newThreadPoolSize = Math.min(maxThreadPoolSize,
|
|
|
idealThreadPoolSize + INITIAL_THREAD_POOL_SIZE);
|
|
|
- LOG.info("Set NMClientAsync thread pool size to " +
|
|
|
- newThreadPoolSize + " as the number of nodes to talk to is "
|
|
|
- + nodeNum);
|
|
|
+ LOG.info("Set NMClientAsync thread pool size to {} " +
|
|
|
+ "as the number of nodes to talk to is {}.", newThreadPoolSize, nodeNum);
|
|
|
threadPool.setCorePoolSize(newThreadPoolSize);
|
|
|
}
|
|
|
}
|
|
@@ -252,8 +251,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
try {
|
|
|
events.put(new StartContainerEvent(container, containerLaunchContext));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of starting Container " +
|
|
|
- container.getId());
|
|
|
+ LOG.warn("Exception when scheduling the event of starting Container {}", container.getId());
|
|
|
callbackHandler.onStartContainerError(container.getId(), e);
|
|
|
}
|
|
|
}
|
|
@@ -276,8 +274,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
try {
|
|
|
events.put(new UpdateContainerResourceEvent(container, true));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of increasing resource of "
|
|
|
- + "Container " + container.getId());
|
|
|
+ LOG.warn("Exception when scheduling the event of increasing " +
|
|
|
+ "resource of Container {}", container.getId());
|
|
|
handler.onIncreaseContainerResourceError(container.getId(), e);
|
|
|
}
|
|
|
}
|
|
@@ -300,8 +298,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
try {
|
|
|
events.put(new UpdateContainerResourceEvent(container, false));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of increasing resource of "
|
|
|
- + "Container " + container.getId());
|
|
|
+ LOG.warn("Exception when scheduling the event of " +
|
|
|
+ "increasing resource of Container {}.", container.getId());
|
|
|
handler.onUpdateContainerResourceError(container.getId(), e);
|
|
|
}
|
|
|
}
|
|
@@ -325,8 +323,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
client.getNodeIdOfStartedContainer(containerId),
|
|
|
containerLaunchContex, autoCommit));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of re-initializing of "
|
|
|
- + "Container " + containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event of " +
|
|
|
+ "re-initializing of Container {}", containerId);
|
|
|
handler.onContainerReInitializeError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -349,8 +347,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
client.getNodeIdOfStartedContainer(containerId),
|
|
|
null, ContainerEventType.RESTART_CONTAINER));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of restart of "
|
|
|
- + "Container " + containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event of restart of Container {}", containerId);
|
|
|
handler.onContainerRestartError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -373,8 +370,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
client.getNodeIdOfStartedContainer(containerId),
|
|
|
null, ContainerEventType.ROLLBACK_LAST_REINIT));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event Rollback re-initialization"
|
|
|
- + " of Container " + containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event Rollback " +
|
|
|
+ "re-initialization of Container {}", containerId);
|
|
|
handler.onRollbackLastReInitializationError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -397,8 +394,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
client.getNodeIdOfStartedContainer(containerId),
|
|
|
null, ContainerEventType.COMMIT_LAST_REINT));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event Commit re-initialization"
|
|
|
- + " of Container " + containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event " +
|
|
|
+ "Commit re-initialization of Container {}", containerId);
|
|
|
handler.onCommitLastReInitializationError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -413,8 +410,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
events.put(new ContainerEvent(containerId, nodeId, null,
|
|
|
ContainerEventType.STOP_CONTAINER));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of stopping Container " +
|
|
|
- containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event of stopping Container {}", containerId);
|
|
|
callbackHandler.onStopContainerError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -424,8 +420,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
events.put(new ContainerEvent(containerId, nodeId, null,
|
|
|
ContainerEventType.QUERY_CONTAINER));
|
|
|
} catch (InterruptedException e) {
|
|
|
- LOG.warn("Exception when scheduling the event of querying the status" +
|
|
|
- " of Container " + containerId);
|
|
|
+ LOG.warn("Exception when scheduling the event of querying " +
|
|
|
+ "the status of Container {}", containerId);
|
|
|
callbackHandler.onGetContainerStatusError(containerId, e);
|
|
|
}
|
|
|
}
|
|
@@ -730,7 +726,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
switch(containerEvent.getType()) {
|
|
|
case REINITIALIZE_CONTAINER:
|
|
|
if (!(containerEvent instanceof ReInitializeContainerEvevnt)) {
|
|
|
- LOG.error("Unexpected Event.. [" +containerEvent.getType() + "]");
|
|
|
+ LOG.error("Unexpected Event.. [{}]", containerEvent.getType());
|
|
|
return ContainerState.FAILED;
|
|
|
}
|
|
|
ReInitializeContainerEvevnt rEvent =
|
|
@@ -771,8 +767,8 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
|
- LOG.warn("Event of type [" + containerEvent.getType() + "] not" +
|
|
|
- " expected here..");
|
|
|
+ LOG.warn("Event of type [{}] not" +
|
|
|
+ " expected here..", containerEvent.getType());
|
|
|
break;
|
|
|
}
|
|
|
if (handlerError != null) {
|
|
@@ -942,7 +938,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
@Override
|
|
|
public void run() {
|
|
|
ContainerId containerId = event.getContainerId();
|
|
|
- LOG.info("Processing Event " + event + " for Container " + containerId);
|
|
|
+ LOG.info("Processing Event {} for Container {}", event, containerId);
|
|
|
if (event.getType() == ContainerEventType.QUERY_CONTAINER) {
|
|
|
try {
|
|
|
ContainerStatus containerStatus = client.getContainerStatus(
|
|
@@ -962,7 +958,7 @@ public class NMClientAsyncImpl extends NMClientAsync {
|
|
|
} else {
|
|
|
StatefulContainer container = containers.get(containerId);
|
|
|
if (container == null) {
|
|
|
- LOG.info("Container " + containerId + " is already stopped or failed");
|
|
|
+ LOG.info("Container {} is already stopped or failed", containerId);
|
|
|
} else {
|
|
|
container.handle(event);
|
|
|
if (isCompletelyDone(container)) {
|