nandakumar131 commented on issue #663: HDDS-3156 update allocateContainer to 
remove additional createPipeline step.
URL: https://github.com/apache/hadoop-ozone/pull/663#issuecomment-600269488
 
 
   
   Thanks @timmylicheng for working on this.
   
   We don't need any complex conditions here. The below logic should be enough 
to handle
   
   ```
   try {
     final List<Pipeline> pipelines = pipelineManager.getPipelines(type, 
replicationFactor, Pipeline.PipelineState.OPEN);
     Pipeline pipeline;
     if (pipelines.isEmpty()) {
       pipeline = pipelineManager.createPipeline(type, replicationFactor);
       pipelineManager.waitPipelineReady(pipeline.getId(), 0);
     } else {
       pipeline = pipelines.get((int) containerCount.get() % pipelines.size());
     }
   } catch (IOException e) {
     throw new IOException("Could not allocate container. Cannot get any" +
                 " matching pipeline for Type:" + type +
                 ", Factor:" + replicationFactor + ", 
State:PipelineState.OPEN");
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to