You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by bh...@apache.org on 2019/07/18 16:36:23 UTC

[hadoop] branch trunk updated: HDDS-1820. Fix numKeys metrics in OM HA. (#1116)

This is an automated email from the ASF dual-hosted git repository.

bharat pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f22818d  HDDS-1820. Fix numKeys metrics in OM HA. (#1116)
f22818d is described below

commit f22818d0d6147cbaea3cf1b043fc3f1cc4932e88
Author: Bharat Viswanadham <bh...@apache.org>
AuthorDate: Thu Jul 18 09:36:15 2019 -0700

    HDDS-1820. Fix numKeys metrics in OM HA. (#1116)
---
 .../hadoop/ozone/om/request/key/OMKeyCommitRequest.java       | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
index 678dfc9..a98a9fa 100644
--- a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
+++ b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
@@ -178,6 +178,17 @@ public class OMKeyCommitRequest extends OMKeyRequest {
     // return response after releasing lock.
     if (exception == null) {
       omResponse.setCommitKeyResponse(CommitKeyResponse.newBuilder().build());
+
+      // As when we commit the key, then it is visible in ozone, so we should
+      // increment here.
+      // As key also can have multiple versions, we need to increment keys
+      // only if version is 0. Currently we have not complete support of
+      // versioning of keys. So, this can be revisited later.
+
+      if (omKeyInfo.getKeyLocationVersions().size() == 1) {
+        omMetrics.incNumKeys();
+      }
+
       return new OMKeyCommitResponse(omKeyInfo, commitKeyRequest.getClientID(),
           omResponse.build());
     } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org