timmylicheng commented on a change in pull request #393: HDDS-1590 Aggregate 
bytes write metrics from container to datanode and to SCM
URL: https://github.com/apache/hadoop-ozone/pull/393#discussion_r382691320
 
 

 ##########
 File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/pipeline/SCMPipelineManager.java
 ##########
 @@ -159,21 +159,14 @@ protected void initializePipelineState() throws 
IOException {
     }
   }
 
-  @Override
-  public synchronized Pipeline createPipeline(ReplicationType type,
-      ReplicationFactor factor) throws IOException {
-    lock.writeLock().lock();
-    try {
-      Pipeline pipeline = pipelineFactory.create(type, factor);
-      pipelineStore.put(pipeline.getId().getProtobuf().toByteArray(),
-          pipeline.getProtobufMessage().toByteArray());
-      stateManager.addPipeline(pipeline);
-      nodeManager.addPipeline(pipeline);
-      metrics.incNumPipelineAllocated();
+  private void recordMetricsForPipeline(Pipeline pipeline) {
+    switch (pipeline.getType()) {
+    case STAND_ALONE:
       if (pipeline.isOpen()) {
 
 Review comment:
   Works as a kind of protection. Current way to create STAND_ALONE pipeline is 
to put the state as OPEN indeed. But it's not guaranteed.

----------------------------------------------------------------
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