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 3ED86200BE0 for ; Wed, 9 Nov 2016 00:16:02 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3D7B4160B0C; Tue, 8 Nov 2016 23:16:02 +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 8818C160B13 for ; Wed, 9 Nov 2016 00:16:01 +0100 (CET) Received: (qmail 1300 invoked by uid 500); 8 Nov 2016 23:16:00 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 887 invoked by uid 99); 8 Nov 2016 23:16:00 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Nov 2016 23:16:00 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 3201B2C2A6B for ; Tue, 8 Nov 2016 23:16:00 +0000 (UTC) Date: Tue, 8 Nov 2016 23:16:00 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-16982) Better integrate Apache CLI in AbstractHBaseTool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 08 Nov 2016 23:16:02 -0000 [ https://issues.apache.org/jira/browse/HBASE-16982?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15649155#comment-15649155 ] Hudson commented on HBASE-16982: -------------------------------- FAILURE: Integrated in Jenkins build HBase-Trunk_matrix #1940 (See [https://builds.apache.org/job/HBase-Trunk_matrix/1940/]) HBASE-16982 Better integrate Apache CLI in AbstractHBaseTool. - (appy: rev 52241c90e4eab19b6613278d2e8107ab56c8a57a) * (edit) hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java * (edit) hbase-common/src/main/java/org/apache/hadoop/hbase/util/AbstractHBaseTool.java * (edit) hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java * (add) hbase-common/src/test/java/org/apache/hadoop/hbase/util/AbstractHBaseToolTest.java > Better integrate Apache CLI in AbstractHBaseTool > ------------------------------------------------ > > Key: HBASE-16982 > URL: https://issues.apache.org/jira/browse/HBASE-16982 > Project: HBase > Issue Type: Sub-task > Reporter: Appy > Assignee: Appy > Fix For: 2.0.0 > > Attachments: HBASE-16982.master.001.patch, HBASE-16982.master.002.patch, HBASE-16982.master.003.patch, HBASE-16982.master.004.patch, HBASE-16982.master.005.patch > > > Problem > 1. Inconsistencies in our user facing tools. > - options: > start with single/double dash > words separated by dash or underscore or just joined together > someplace use '=' to separate value, other use space (ExportSnapshot vs HashTable) > - Description > Manually formatting options and their descriptions in printUsage() > Inconsistant formatting, sometimes even weird. > Incomplete. Sometimes people forget to add new option to description > 2. Manual parsing of options (those huge if-else loops iterating over args) > Solution > Use Apache CLI > - It has various validations for option names which'll fix first set of issues. > - using AbstractHBaseTool's print usage function will ensure consistent formatting (although we loose the power to order the options) > - If we enforce the method of defining options as in patch, it's highly unlikely to forget adding description. > - CLI parses the options for us. > Using Apache CLI when writing new tools is straight forward, but it's not easy when porting exiting tools since some option names are not valid as per CLI's validation. > New method, processOldArgs(), will allow to port these tools in a backward compatible manner. -- This message was sent by Atlassian JIRA (v6.3.4#6332)