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 988F0E421 for ; Sun, 9 Dec 2012 21:03:20 +0000 (UTC) Received: (qmail 11253 invoked by uid 500); 9 Dec 2012 21:03:18 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 11201 invoked by uid 500); 9 Dec 2012 21:03:18 -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 11193 invoked by uid 99); 9 Dec 2012 21:03:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 21:03:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of asaf.mesika@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-we0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Dec 2012 21:03:10 +0000 Received: by mail-we0-f169.google.com with SMTP id t49so1158750wey.14 for ; Sun, 09 Dec 2012 13:02:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=K3P4FbNHVeDweNIOzKliDjHy4LFTid5fOjXCHmmaFBU=; b=Mz6ubxfok3Lqy/dlMyMPBaTwrJ1wnealMndkgupMDlz1e1NAx+kkaicH53kp91r7iD KBQMStmbqjlcwufqMpehGckpDAdW5N5o6hjKrkWl7autEPSYGS0+UIC5PqaWH3bdbb/q M1YMRkETZY52HySyTLtnldjQLuK7qTKkq/5ebxzkUE68/tGCsotSALQ91b/ZqF6/Icbf gi6CteppMssM56LTwtSrHw7v5iAce7tf/TbYc/wgXmKwJA6quxXShTyE0XW9MA5FFxPt KQkoF7zgcyHSksH5yqs6/h0fFSIEu1tfqVdbI1FGhxNASQAyv+5FGefkURUcBAlwDv6n kJYg== Received: by 10.216.145.153 with SMTP id p25mr4536526wej.198.1355086968922; Sun, 09 Dec 2012 13:02:48 -0800 (PST) Received: from [192.168.1.102] ([109.186.49.249]) by mx.google.com with ESMTPS id p3sm7503634wic.8.2012.12.09.13.02.46 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Dec 2012 13:02:47 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1283) Subject: Re: Using HBaseAdmin.getAlterStatus From: "Mesika, Asaf" In-Reply-To: Date: Sun, 9 Dec 2012 23:02:45 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <9960F737-ADD5-451E-96D4-F42E7EC81556@gmail.com> References: <19CED861-FE07-4231-AEB2-36A7C0D823D3@gmail.com> To: user@hbase.apache.org X-Mailer: Apple Mail (2.1283) X-Virus-Checked: Checked by ClamAV on apache.org Yeah, I forgot to mention that important bit: the pair returned is always 0 on the firstKey and never changes. So if I understand you correctly, I need to use get AlterStatus between = the modifyTable and enableTable ? On Dec 9, 2012, at 10:53 PM, Harsh J wrote: > Can you clarify on what "doesn't work" a bit more? >=20 > Do you get an exception or are you not receiving some data that you > are expecting? >=20 > AFAICT, this API is helpful for a parallel monitoring of an issued > schema update. In your code bits, which I will assume is serial, you > already disable-update-enable table and complete the alter transaction > before querying it (such that there isn't any pending operation to > report). If the querying is done in a parallel process/monitor thread, > then you may see in-flight results. >=20 > On Mon, Dec 10, 2012 at 2:04 AM, Mesika, Asaf = wrote: >> Hi, >>=20 >> I've tried using HBaseAdmin.getAlterStatus to check on a = HBaseAdmin.modifyTable command I've issued, but it doesn't work. >>=20 >> Sample Code: >>=20 >> Modifying Table >> tableDescriptor =3D = admin.getTableDescriptor(tableNameBytes); >> if (tableDescriptor.hasCoprocessor(observerClassname)) = { >> logger.info("Coprocessor installed already. = Removing to update jar location in any case"); >> = tableDescriptor.removeCoprocessor(observerClassname); >> } >> tableDescriptor.addCoprocessor(observerClassname, = hdfsJarPath, RegionObserver.PRIORITY_USER, null); >>=20 >> logger.info("Disabling table "+tableName); >> admin.disableTable(tableNameBytes); >> logger.info("Modifying table "+tableName); >> admin.modifyTable(Bytes.toBytes(tableName), = tableDescriptor); >> logger.info("Enabling table "+tableName); >> admin.enableTable(tableNameBytes); >>=20 >> Using alterStatus >> byte[] tableName =3D it.next(); >> try { >> Pair alterStatus =3D = admin.getAlterStatus(tableName); >> if (alterStatus.getFirst() =3D=3D = alterStatus.getSecond()) { >> it.remove(); >> logger.info("Table = "+Bytes.toString(tableName)+" was altered successfully. = "+notLoadedTables.size()+" tables remaining..."); >> } else { >> if (logger.isDebugEnabled()) { >> logger.debug("Table = "+Bytes.toString(tableName)+" was not yet altered. Alter Status: "+ >> alterStatus.getFirst()+" regions = altered, "+alterStatus.getSecond()+" total regions on table"); >> } >> } >> } catch (IOException e) { >> throw new RuntimeException("Failed getting alter = status for table name: "+Bytes.toString(tableName)); >> } >>=20 >> Does anyone know how to use it? >>=20 >> Asaf >>=20 >=20 >=20 >=20 > --=20 > Harsh J