[ 
https://issues.apache.org/jira/browse/HDDS-816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16679344#comment-16679344
 ] 

Yiqun Lin commented on HDDS-816:
--------------------------------

Thanks for working on this, [~bharatviswa]. Two comments from me:
 * For the metric of {{NumKey}}, why not is that added in {{openKey}}?
{code:java}
if (value != null) {
        // the key already exist, the new blocks will be added as new version
        keyInfo = OmKeyInfo.getFromProtobuf(KeyInfo.parseFrom(value));
        // when locations.size = 0, the new version will have identical blocks
        // as its previous version
        openVersion = keyInfo.addNewVersion(locations);
        keyInfo.setDataSize(size + keyInfo.getDataSize());
      } else {
        // the key does not exist, create a new object, the new blocks are the
        // version 0
        ===> // add the metrics
        keyInfo = new OmKeyInfo.Builder()
{code}
the key operationed in call commitKey is also got from multiple open keys.

 * For the volume/bucket metrics for S3Bucket, I prefer to pass OMMetric 
instance into S3BucketManagerImpl rather than refactor it. In current logic, we 
always create ozone volume firstly whenever the bucket name is valid. And the 
name verification, volume creating should be the part of creating S3Bucket I 
think. Please correct me If I am wrong.

Another place:
{code:java}
+      } catch (IOException ex) {
+        // We need to increment volume creates also because this is first
+        // time we are trying to create a volume, it failed. As we increment
+        // ops and create when we try to do that operation.
+        metrics.incNumVolumeCreates();
+        metrics.incNumVolumeCreateFails();
+        throw ex;
+      }
{code}
I still not understand why we increase the count for volume creates. If 
IOException threw, two cases: 1. volume already created. 2. volume create 
failed. Any case of this, we all no need to increase count of volumes. It 
should keep the same count.

> Create OM metrics for bucket, volume, keys
> ------------------------------------------
>
>                 Key: HDDS-816
>                 URL: https://issues.apache.org/jira/browse/HDDS-816
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>          Components: Ozone Manager
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>         Attachments: HDDS-816.00.patch
>
>
> This Jira is used to create the following metrics in Ozone manager.
>  # number of volumes 
>  # number of buckets
>  # number of keys



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to