Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CA909200C7F for ; Wed, 24 May 2017 11:40:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C92B9160BD0; Wed, 24 May 2017 09:40:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 19201160B9C for ; Wed, 24 May 2017 11:40:08 +0200 (CEST) Received: (qmail 83941 invoked by uid 500); 24 May 2017 09:40:08 -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 83927 invoked by uid 99); 24 May 2017 09:40:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 May 2017 09:40:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 9D2CFC67B8 for ; Wed, 24 May 2017 09:40:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id jFQjlDmYeQTO for ; Wed, 24 May 2017 09:40:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id D77F45F567 for ; Wed, 24 May 2017 09:40:05 +0000 (UTC) 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 00CFFE0D49 for ; Wed, 24 May 2017 09:40:05 +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 5A30C21B59 for ; Wed, 24 May 2017 09:40:04 +0000 (UTC) Date: Wed, 24 May 2017 09:40:04 +0000 (UTC) From: "Weiwei Yang (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-11679) Ozone: SCM CLI: Implement list container command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 24 May 2017 09:40:10 -0000 [ https://issues.apache.org/jira/browse/HDFS-11679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16022617#comment-16022617 ] Weiwei Yang commented on HDFS-11679: ------------------------------------ Hi [~yuanbo] Thanks for working on this. Here some initial comments *ListContainerHandler.java* There is a findbugs warning, please fix that. *ContainerMapping.java* # The way to get a range of keys in levelDB seems inappropriate, instead of scanning all the keys in DB, can we call API {{iter.seek(byte[] key)}} and {{iter.forEachRemaining}} to get the range of keys? # Can we wrap up the code to get a range of keys into {{LevelDBStore}}? Wrap the common code in this class so other places can reuse. (When this code is added, please also add UT to make sure it behaves correctly). # Please make sure the DB iterator is closed after finishing the operation. # Two methods {{listContainer(String startName, int count)}} and {{public List listContainer(String startName, String endName) }} have too many similar code, can reduce the dup code as much as possible? *Mapping.java* Can we merge the 2 APIs into a single one? {code} List listContainer(String startName, String endName, int count) {code} *StorageContainerLocationProtocolClientSideTranslatorPB* # Minor: line 43, 44 unused imports # line 192: it says "Start container name cannot be null", I thought this argument could be optional, in that case we print all the containers in SCM. This is useful when user firstly runs the command, the container names are unknown to them, so they just simply give (null, null, 100) to print 100 containers from beginning. Does that make sense? # line 197 - 204: you cannot use if-else clause to parse the argument. If endName is not null, rest of code will not run. *StorageContainerLocationProtocolServerSideTranslatorPB* # Same comment to the argument check. I think you don't need to have the check twice on client side as well as the server side. Just make sure server side checks everything correctly should be fine. Thanks > Ozone: SCM CLI: Implement list container command > ------------------------------------------------ > > Key: HDFS-11679 > URL: https://issues.apache.org/jira/browse/HDFS-11679 > Project: Hadoop HDFS > Issue Type: Sub-task > Reporter: Weiwei Yang > Assignee: Yuanbo Liu > Labels: command-line > Attachments: HDFS-11679-HDFS-7240.001.patch > > > Implement the command to list containers > {code} > hdfs scm -container list -start [-count <100> | -end ]{code} > Lists all containers known to SCM. The option -start allows the listing to start from a specified container and -count controls the number of entries returned but it is mutually exclusive with the -end option which returns keys from the -start to -end range. -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org