diff --git a/hadoop-hdsl/server-scm/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerStateManager.java b/hadoop-hdsl/server-scm/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerStateManager.java index 2638994e4e..b9f0e4c8d4 100644 --- a/hadoop-hdsl/server-scm/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerStateManager.java +++ b/hadoop-hdsl/server-scm/src/main/java/org/apache/hadoop/ozone/scm/container/ContainerStateManager.java @@ -291,6 +291,11 @@ public ContainerInfo allocateContainer(PipelineSelector selector, HdslProtos Pipeline pipeline = selector.getReplicationPipeline(type, 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() .setContainerName(containerName) .setState(HdslProtos.LifeCycleState.ALLOCATED)