From hdfs-issues-return-270538-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Wed Jul 3 23:47:02 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 012141801A7 for ; Thu, 4 Jul 2019 01:47:01 +0200 (CEST) Received: (qmail 56938 invoked by uid 500); 3 Jul 2019 23:47:01 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 56735 invoked by uid 99); 3 Jul 2019 23:47:01 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jul 2019 23:47:01 +0000 Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5C368E00D3 for ; Wed, 3 Jul 2019 23:47:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2269426251 for ; Wed, 3 Jul 2019 23:47:00 +0000 (UTC) Date: Wed, 3 Jul 2019 23:47:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Work logged] (HDDS-1705) Recon: Add estimatedTotalCount to the response of containers and containers/{id} endpoints MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDDS-1705?focusedWorklogId=271943&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-271943 ] ASF GitHub Bot logged work on HDDS-1705: ---------------------------------------- Author: ASF GitHub Bot Created on: 03/Jul/19 23:46 Start Date: 03/Jul/19 23:46 Worklog Time Spent: 10m Work Description: swagle commented on pull request #1055: HDDS-1705. Recon: Add estimatedTotalCount to the response of ... URL: https://github.com/apache/hadoop/pull/1055#discussion_r300188458 ########## File path: hadoop-ozone/ozone-recon/src/main/java/org/apache/hadoop/ozone/recon/tasks/ContainerKeyMapperTask.java ########## @@ -144,24 +150,35 @@ private void deleteOMKeyFromContainerDB(String key) Table.KeyValue> containerIterator = containerDBServiceProvider.getContainerTableIterator(); - Set keysToDeDeleted = new HashSet<>(); + Set keysToBeDeleted = new HashSet<>(); while (containerIterator.hasNext()) { Table.KeyValue keyValue = containerIterator.next(); String keyPrefix = keyValue.getKey().getKeyPrefix(); if (keyPrefix.equals(key)) { - keysToDeDeleted.add(keyValue.getKey()); + keysToBeDeleted.add(keyValue.getKey()); } } - for (ContainerKeyPrefix containerKeyPrefix : keysToDeDeleted) { + for (ContainerKeyPrefix containerKeyPrefix : keysToBeDeleted) { containerDBServiceProvider.deleteContainerMapping(containerKeyPrefix); + + // decrement count and update containerKeyCount. + Long containerID = containerKeyPrefix.getContainerId(); + long keyCount = + containerDBServiceProvider.getKeyCountForContainer(containerID); + if (keyCount > 0) { + containerDBServiceProvider.storeContainerKeyCount(containerID, Review comment: Is this to keep counts up to date? Seems this change is not needed for this test, right? ---------------------------------------------------------------- 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: users@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 271943) Time Spent: 2h (was: 1h 50m) > Recon: Add estimatedTotalCount to the response of containers and containers/{id} endpoints > ------------------------------------------------------------------------------------------ > > Key: HDDS-1705 > URL: https://issues.apache.org/jira/browse/HDDS-1705 > Project: Hadoop Distributed Data Store > Issue Type: Sub-task > Components: Ozone Recon > Affects Versions: 0.4.0 > Reporter: Vivek Ratnavel Subramanian > Assignee: Vivek Ratnavel Subramanian > Priority: Major > Labels: pull-request-available > Time Spent: 2h > Remaining Estimate: 0h > -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org