You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2017/01/30 20:25:34 UTC
[2/4] accumulo git commit: ACCUMULO-4578 added some javadoc
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/master
Commit: 6d8a5fa59248ad400fea01f66cd290fbe2da03e6
Parents: db84650
Author: Keith Turner <kt...@apache.org>
Authored: Mon Jan 30 13:02:34 2017 -0500
Committer: Keith Turner <kt...@apache.org>
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<T> {
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<String> getHeldLocks() {
return hlocks;
}
+ /**
+ * @return list of namespace and table ids locked
+ */
public List<String> 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<T> {
private final Map<String,List<String>> danglingHeldLocks;
private final Map<String,List<String>> 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<String,List<String>> convert(Map<Long,List<String>> danglocks) {
if (danglocks.isEmpty()) {
return Collections.emptyMap();
@@ -135,10 +154,22 @@ public class AdminUtil<T> {
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<String,List<String>> 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<String,List<String>> getDanglingWaitingLocks() {
return danglingWaitingLocks;
}
@@ -245,8 +276,8 @@ public class AdminUtil<T> {
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;