Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 855F5102F4 for ; Sun, 2 Jun 2013 17:30:36 +0000 (UTC) Received: (qmail 78889 invoked by uid 500); 2 Jun 2013 17:30:32 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 78832 invoked by uid 500); 2 Jun 2013 17:30:32 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 78824 invoked by uid 99); 2 Jun 2013 17:30:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jun 2013 17:30:32 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nidmgg@gmail.com designates 209.85.220.169 as permitted sender) Received: from [209.85.220.169] (HELO mail-vc0-f169.google.com) (209.85.220.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 02 Jun 2013 17:30:25 +0000 Received: by mail-vc0-f169.google.com with SMTP id kw10so2177900vcb.28 for ; Sun, 02 Jun 2013 10:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=WrVchF84ST8cfOfELjLA4F1OlSU4Z5EXPDLETRkEPD8=; b=A3bocPhXFB+jbXgAaSfUAK2AbNZjvepwG87N1rfGmAq3CQ3iwRVfsVF8+0cEp2Cl+z vyMstR8PDVtM16qUBvtcdgcJBddqjNouAA/HF/A05RXyIKffUcTIeQwzuWdfNAMO3htK hGQOTodCwX0L0DXq/uZpvSKfFcaFT5ZA7MuwwUkB27D1m1eGWvJg5hMZOzukhjY8UJxb ybymiQNavfQcCZpKAVQ1HkguZhzD1SrTbyzYOwFtTNUZVUcDMHdJSF2njeJtjcKuT3v9 Y5VW1xC9v+gTK6YUJ1Tszgh1BJcolFr/GTNoFEIAJjI9HBCg0ZDgmQN4wKpUt99u4nlF W5Bg== MIME-Version: 1.0 X-Received: by 10.52.76.6 with SMTP id g6mr13367604vdw.13.1370194204669; Sun, 02 Jun 2013 10:30:04 -0700 (PDT) Received: by 10.220.145.199 with HTTP; Sun, 2 Jun 2013 10:30:04 -0700 (PDT) Date: Sun, 2 Jun 2013 10:30:04 -0700 Message-ID: Subject: how to use HBase Shell formatter? From: N Dm To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=20cf307f3522d7c77104de2f3290 X-Virus-Checked: Checked by ClamAV on apache.org --20cf307f3522d7c77104de2f3290 Content-Type: text/plain; charset=ISO-8859-1 hi, folks, Can someone point me to a sample about how to use 'formatter.rb' inside hbase ruby code? The version I am using is 94.3 I am trying to implement a 'list_replicated_table' command on hbase shell, and leveraging 'formatter" to lay out the output. The code segement is like: formatter.header(["TABLE","COLUMNFAMILY", "TARGET_CLUSTER"]) ...... list.each do |e| formatter.row([e[0],e[1],e[2]]) end ..... formatter.footer(now) where e[0],e[1], and e[2] are entries from a String array. I was hoping to have a nice output with column aligned. However, I got the output with a blank as delimiter. hbase(main):002:0> list_replicated_tables TABLE COLUMNFAMILY TARGET_CLUSTER scores course hdtest017.svl.ibm.com:2181:/hbase t3_dn cf1 hdtest017.svl.ibm.com:2181:/hbase usertable family hdtest017.svl.ibm.com:2181:/hbase I am looking for something like: TABLE COLUMNFAMILY TARGET_CLUSTER scores course hdtest017.svl.ibm.com:2181:/hbase I was following the way 'list_peers' did, seems don't work over there either. I also changed the formatter input as: formatter.header(["TABLE","COLUMNFAMILY", "TARGET_CLUSTER"],[18,18,48]) formatter.row([e[0],e[1],e[2]],true,[18,18,48]) which doesn't change the output either. The 'scan.rb' works fine, however, I can't tell what's the differnce. Any suggestion is really appreciated. Thanks! Demai --20cf307f3522d7c77104de2f3290--