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 3F75E200C0C for ; Mon, 30 Jan 2017 21:25:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3E06F160B60; Mon, 30 Jan 2017 20:25:06 +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 8550B160B4D for ; Mon, 30 Jan 2017 21:25:05 +0100 (CET) Received: (qmail 16746 invoked by uid 500); 30 Jan 2017 20:25:04 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 16731 invoked by uid 99); 30 Jan 2017 20:25:04 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2017 20:25:04 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 41144DFBAD; Mon, 30 Jan 2017 20:25:04 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kturner@apache.org To: commits@accumulo.apache.org Date: Mon, 30 Jan 2017 20:25:05 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] accumulo git commit: ACCUMULO-4578 added some javadoc archived-at: Mon, 30 Jan 2017 20:25:06 -0000 ACCUMULO-4578 added some javadoc Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/6d8a5fa5 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/6d8a5fa5 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/6d8a5fa5 Branch: refs/heads/1.7 Commit: 6d8a5fa59248ad400fea01f66cd290fbe2da03e6 Parents: db84650 Author: Keith Turner Authored: Mon Jan 30 13:02:34 2017 -0500 Committer: Keith Turner Committed: Mon Jan 30 14:53:32 2017 -0500 ---------------------------------------------------------------------- .../org/apache/accumulo/fate/AdminUtil.java | 39 ++++++++++++++++++-- .../functional/ConcurrentDeleteTableIT.java | 2 +- 2 files changed, 36 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/6d8a5fa5/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java ---------------------------------------------------------------------- diff --git a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java index 6d388ed..2cc1eed 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java +++ b/fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java @@ -81,26 +81,41 @@ public class AdminUtil { this.top = top; } - public long getTxid() { - return txid; + /** + * @return This fate operations transaction id, formatted in the same way as FATE transactions are in the Accumulo logs. + */ + public String getTxid() { + return String.format("%016x", txid); } public TStatus getStatus() { return status; } + /** + * @return The debug info for the operation on the top of the stack for this Fate operation. + */ public String getDebug() { return debug; } + /** + * @return list of namespace and table ids locked + */ public List getHeldLocks() { return hlocks; } + /** + * @return list of namespace and table ids locked + */ public List getWaitingLocks() { return wlocks; } + /** + * @return The operation on the top of the stack for this Fate operation. + */ public String getTop() { return top; } @@ -113,6 +128,10 @@ public class AdminUtil { private final Map> danglingHeldLocks; private final Map> danglingWaitingLocks; + /** + * Convert FATE transactions IDs in keys of map to format that used in printing and logging FATE transactions ids. This is done so that if the map is + * printed, the output can be used to search Accumulo's logs. + */ private static Map> convert(Map> danglocks) { if (danglocks.isEmpty()) { return Collections.emptyMap(); @@ -135,10 +154,22 @@ public class AdminUtil { return transactions; } + /** + * Get locks that are held by non existent FATE transactions. These are table or namespace locks. + * + * @return map where keys are transaction ids and values are a list of table IDs and/or namespace IDs. The transaction IDs are in the same format as + * transaction IDs in the Accumulo logs. + */ public Map> getDanglingHeldLocks() { return danglingHeldLocks; } + /** + * Get locks that are waiting to be aquired by non existent FATE transactions. These are table or namespace locks. + * + * @return map where keys are transaction ids and values are a list of table IDs and/or namespace IDs. The transaction IDs are in the same format as + * transaction IDs in the Accumulo logs. + */ public Map> getDanglingWaitingLocks() { return danglingWaitingLocks; } @@ -245,8 +276,8 @@ public class AdminUtil { FateStatus fateStatus = getStatus(zs, zk, lockPath, filterTxid, filterStatus); for (TransactionStatus txStatus : fateStatus.getTransactions()) { - fmt.format("txid: %016x status: %-18s op: %-15s locked: %-15s locking: %-15s top: %s%n", txStatus.getTxid(), txStatus.getStatus(), - txStatus.getDebug(), txStatus.getHeldLocks(), txStatus.getWaitingLocks(), txStatus.getTop()); + fmt.format("txid: %s status: %-18s op: %-15s locked: %-15s locking: %-15s top: %s%n", txStatus.getTxid(), txStatus.getStatus(), txStatus.getDebug(), + txStatus.getHeldLocks(), txStatus.getWaitingLocks(), txStatus.getTop()); } fmt.format(" %s transactions", fateStatus.getTransactions().size()); http://git-wip-us.apache.org/repos/asf/accumulo/blob/6d8a5fa5/test/src/test/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java index 0116f64..9c8ebe4 100644 --- a/test/src/test/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java +++ b/test/src/test/java/org/apache/accumulo/test/functional/ConcurrentDeleteTableIT.java @@ -131,7 +131,7 @@ public class ConcurrentDeleteTableIT extends AccumuloClusterIT { cdl.await(); Thread.sleep(10); doTableOp(); - } catch (TableNotFoundException e) { + } catch (TableNotFoundException | TableOfflineException e) { // expected } catch (RuntimeException e) { throw e;