Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9324AEE35 for ; Tue, 29 Jan 2013 20:26:01 +0000 (UTC) Received: (qmail 73591 invoked by uid 500); 29 Jan 2013 20:25:59 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 73536 invoked by uid 500); 29 Jan 2013 20:25:59 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 73528 invoked by uid 99); 29 Jan 2013 20:25:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2013 20:25:59 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [74.125.82.172] (HELO mail-we0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Jan 2013 20:25:53 +0000 Received: by mail-we0-f172.google.com with SMTP id x10so646460wey.3 for ; Tue, 29 Jan 2013 12:25:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:content-transfer-encoding :x-gm-message-state; bh=B0/yKgEXNmCnKuIAcrJWPVNJcuON5Tpy9lFApRo7fyg=; b=CEChGH7VnHJhVCunGOubz7TQ0KaKXL9/24MHqzfvioMBqft4fRDG6y2rQfOi9Q76kg BI1ScbGbcg1kK0J621wJczntGLZFhhrjqv7BLPiRqs6/d/EZE0VPGC8whvIdvB8MRFKZ rRssQthpSf1oE2vsaqpolfoxds/wJgNsm1gP13WGR2q/sUULNgGMwucg2q4dhSAqVliv vI2e07qq3a+0zCNGrWXvbGJvP99QOg9gH3BzSrwviZI5vOeW0KM0qvEaALhM2t7/5RUz obWR3K2POST7hVkqji9isTjFdiijkGiGswWRuLijP8gwC9En1tYkdnfuVFtglB1Bx7Ax QSWg== MIME-Version: 1.0 X-Received: by 10.194.75.197 with SMTP id e5mr4677985wjw.55.1359491133081; Tue, 29 Jan 2013 12:25:33 -0800 (PST) Received: by 10.194.11.103 with HTTP; Tue, 29 Jan 2013 12:25:32 -0800 (PST) In-Reply-To: References: <1358991856.92023.YahooMailNeo@web74305.mail.tp2.yahoo.com> Date: Tue, 29 Jan 2013 15:25:32 -0500 Message-ID: Subject: Re: How to get coprocessor list by client API From: Jean-Marc Spaggiari To: user@hbase.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmpCQu1nxrEwERhKIE+X9G0sNeGi2bHt4WhiJu7ZTl+gzSrtU+jPEMvq+ZaVOSujNoeCbSV X-Virus-Checked: Checked by ClamAV on apache.org Hi Kyle, I this it's possible. I have already done that between 0.94.1 and 0.94.3. JM 2013/1/29, Kyle Lin : > Hello JM > > If I import 0.94.4 jar file on Client side for calling getCoprocessor= s > to get list from server of old version(0.94.0), Is it possible? > > Kyle > > 2013/1/28 Jean-Marc Spaggiari > >> Hi Kyle, >> >> If you are not running a production cluster, you might think about >> getting the last 0.94.4 source code, apply HBASE-7654 and deploy it. >> That way you can use getCoprocessors which will send you the list you >> the list you are looking for... >> >> JM >> >> 2013/1/28, Kyle Lin : >> > Hi JM >> > >> > I saw the source code of hasCoprocessor, and notice this CONTANT. >> > Thanks for your hint. >> > >> > Kyle >> > >> > 2013/1/24 Jean-Marc Spaggiari >> > >> >> Hi Kyle, >> >> >> >> This will give you all the attributs of the table, not just the >> >> coprocessors, so don't forget to parse they key using >> >> CP_HTD_ATTR_KEY_PATTERN ... >> >> >> >> I will add in my ToDo to add a List<> getCoprocessors() method in >> >> HTableInterface or HTableDescriptor... >> >> >> >> JM >> >> >> >> 2013/1/23, Kyle Lin : >> >> > Hello JM >> >> > >> >> > It really works! Thanks a lot. >> >> > >> >> > Hello Jack >> >> > >> >> > For each table, it needs to use htable.getTableDescriptor(). >> >> > >> >> > hbaseAdmin.getTableDescriptor only gets -ROOT- and .META. >> >> > >> >> > So I use the code as follows, >> >> > >> >> > HTable htable =3D new HTable(config, tableName); >> >> > HTableDescriptor htableDesc =3D *htable.getTableDescriptor()*; >> >> > Map maps =3D >> >> > htableDesc.getValues(); >> >> > Set> sets =3D >> >> > maps.entrySet(); >> >> > for (Map.Entry >> entrySet >> >> > : >> >> > sets) { >> >> > String stringKey =3D Bytes.toString(entrySet.getKey().get()); >> >> > String stringValue =3D Bytes.toString(entrySet.getValue().get()); >> >> > System.out.println("key:" + stringKey + ", value:" + stringValue); >> >> > } >> >> > htable.close(); >> >> > >> >> > Kyle >> >> > >> >> > 2013/1/24 jack >> >> > >> >> >> Hi, Kyle >> >> >> >> >> >> Configuration config =3D HBaseConfiguration.create(); >> >> >> config.set("hbase.zookeeper.quorum", "host3"); >> >> >> config.set("hbase.zookeeper.property.clientPort", "2181"); >> >> >> >> >> >> config.set("fs.default.name", "hdfs://host3:9000"); >> >> >> config.set("mapred.job.tracker", "hdfs://host3:9001"); >> >> >> >> >> >> HBaseAdmin hbaseAdmin =3D new HBaseAdmin(config); >> >> >> >> >> >> HTableDescriptor htableDescriptor =3D >> >> >> hbaseAdmin.getTableDescriptor(Bytes.toBytes("table21")); >> >> >> >> >> >> Map maps = =3D >> >> >> htableDescriptor.getValues(); >> >> >> Set> >> >> >> sets >> >> =3D >> >> >> maps.entrySet(); >> >> >> Iterator> >> >> ImmutableBytesWritable>> >> >> >> it >> >> >> =3D sets.iterator(); >> >> >> while(it.hasNext()){ >> >> >> Entry> >> >> ImmutableBytesWritable> >> >> >> keys =3D it.next(); >> >> >> ImmutableBytesWritable ibwKey =3D keys.getKey(); >> >> >> ImmutableBytesWritable ibwValue =3D keys.getValue(= ); >> >> >> String stringKey =3D Bytes.toString(ibwKey.get()); >> >> >> String stringValue =3D >> >> >> Bytes.toString(ibwValue.get()); >> >> >> System.out.println(stringKey + " " + >> >> >> stringValue); >> >> >> } >> >> >> hbaseAdmin.close(); >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> ________________________________ >> >> >> =E5=AF=84=E4=BB=B6=E8=80=85=EF=BC=9A Kyle Lin >> >> >> =E6=94=B6=E4=BB=B6=E8=80=85=EF=BC=9A user@hbase.apache.org >> >> >> =E5=AF=84=E4=BB=B6=E6=97=A5=E6=9C=9F=EF=BC=9A 2013/1/23 (=E9=80=B1= =E4=B8=89) 4:18 PM >> >> >> =E4=B8=BB=E6=97=A8=EF=BC=9A How to get coprocessor list by client = API >> >> >> >> >> >> Hi, Everyone >> >> >> >> >> >> I need to know What coprocessors registered in a HTable. But, >> >> >> in >> >> >> Class >> >> >> HTableDescriptor, I can only find >> >> >> *addCoprocessor< >> >> >> >> >> >> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor= .html#addCoprocessor(java.lang.String) >> >> >> > >> >> >> *, *hasCoprocessor< >> >> >> >> >> >> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/HTableDescriptor= .html#hasCoprocessor(java.lang.String) >> >> >> > >> >> >> * ..etc. How can I use Client API to get the coprocessor >> >> >> information >> >> just >> >> >> like Typing "describe table_name" in HBase Shell as follows? >> >> >> >> >> >> >> >> >> hbase(main):002:0> describe 'table21' >> >> >> DESCRIPTION >> >> >> ENABLED >> >> >> {NAME =3D> 'table21', *coprocessor$1 =3D> >> >> >> 'hdfs://host3:9000/sumCoprocessor.jar|idv.jack.endpoint true >> >> >> * >> >> >> * .SumDataEndpoint||'*, FAMILIES =3D> [{NAME =3D> 'cf', >> >> >> DATA_BLOCK_ENCODING >> >> >> =3D> >> >> >> 'NONE', BLOOMFILTER >> >> >> =3D> 'NONE', REPLICATION_SCOPE =3D> '0', VERSIONS =3D> '3', COMPRE= SSION >> >> >> =3D> >> >> >> 'NONE', MIN_VERSIONS =3D> >> >> >> '0', TTL =3D> '2147483647', KEEP_DELETED_CELLS =3D> 'false', >> >> >> BLOCKSIZE >> >> >> =3D> >> >> >> '65536', IN_MEMORY =3D> >> >> >> 'false', ENCODE_ON_DISK =3D> 'true', BLOCKCACHE =3D> 'true'}]} >> >> >> >> >> >> 1 row(s) in 0.0210 seconds >> >> >> >> >> >> Kyle >> >> >> >> >> > >> >> >> > >> >