From 792ac4d08bfdef2ea66630a72bac3a483fe2a547 Mon Sep 17 00:00:00 2001 From: Nanda kumar Date: Wed, 4 Apr 2018 21:08:05 +0530 Subject: [PATCH] HDFS-13309. Ozone: Improve error message in case of missing nodes. Contributed by Elek, Marton. --- .../hadoop/ozone/scm/container/ContainerStateManager.java | 5 +++++ 1 file changed, 5 insertions(+) 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)