File tree Expand file tree Collapse file tree
hadoop-hdds/server-scm/src
main/java/org/apache/hadoop/hdds/scm/server
test/java/org/apache/hadoop/hdds/scm/container Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,6 +255,13 @@ public ContainerWithPipeline allocateContainer(ReplicationConfig replicationConf
255255 getScm ().checkAdminAccess (getRemoteUser (), false );
256256 final ContainerInfo container = scm .getContainerManager ()
257257 .allocateContainer (replicationConfig , owner );
258+ if (container == null ) {
259+ throw new SCMException (
260+ "Could not allocate container for replication " + replicationConfig
261+ + ", owner=" + owner
262+ + ": no suitable open pipeline with enough space" ,
263+ ResultCodes .FAILED_TO_ALLOCATE_CONTAINER );
264+ }
258265 final Pipeline pipeline = scm .getPipelineManager ()
259266 .getPipeline (container .getPipelineID ());
260267 ContainerWithPipeline cp = new ContainerWithPipeline (container , pipeline );
Original file line number Diff line number Diff line change @@ -533,13 +533,6 @@ public int getPipelinesCount(DatanodeDetails datanodeDetails) {
533533 @ Override
534534 public void addPipeline (Pipeline pipeline ) {
535535 node2PipelineMap .addPipeline (pipeline );
536- // Pipeline creation uses DNs that may not be the pre-registered fake nodes; ensure each
537- // pipeline member has metrics so {@link #getDatanodeInfo} and space checks work.
538- for (DatanodeDetails dn : pipeline .getNodes ()) {
539- if (nodeMetricMap .get (dn ) == null ) {
540- populateNodeMetric (dn , 0 );
541- }
542- }
543536 }
544537
545538 /**
You can’t perform that action at this time.
0 commit comments