HDFS-13309. Ozone: Improve error message in case of missing nodes. Contributed by Elek, Marton.

This commit is contained in:
Nanda kumar 2018-04-04 21:08:05 +05:30 committed by Owen O'Malley
parent 43f7307829
commit 792ac4d08b

View File

@ -291,6 +291,11 @@ public ContainerInfo allocateContainer(PipelineSelector selector, HdslProtos
Pipeline pipeline = selector.getReplicationPipeline(type, Pipeline pipeline = selector.getReplicationPipeline(type,
replicationFactor, containerName); replicationFactor, containerName);
Preconditions.checkNotNull(pipeline, "Pipeline type=%s/"
+ "replication=%s couldn't be found for the new container. "
+ "Do you have enough nodes?", type, replicationFactor);
ContainerInfo containerInfo = new ContainerInfo.Builder() ContainerInfo containerInfo = new ContainerInfo.Builder()
.setContainerName(containerName) .setContainerName(containerName)
.setState(HdslProtos.LifeCycleState.ALLOCATED) .setState(HdslProtos.LifeCycleState.ALLOCATED)