[ https://issues.apache.org/jira/browse/ACCUMULO-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172151#comment-15172151 ]
ASF GitHub Bot commented on ACCUMULO-4152: ------------------------------------------ Github user ctubbsii commented on a diff in the pull request: https://github.com/apache/accumulo/pull/77#discussion_r54441134 --- Diff: fate/src/main/java/org/apache/accumulo/fate/ZooStore.java --- @@ -458,4 +458,43 @@ public Serializable getProperty(long tid, String prop) { throw new RuntimeException(e); } } + + @SuppressWarnings("unchecked") + @Override + public List<ReadOnlyRepo<T>> getStack(long tid) { + String txpath = getTXPath(tid); + + outer: while (true) { + List<String> ops; + try { + ops = zk.getChildren(txpath); + } catch (KeeperException.NoNodeException e) { + return null; + } catch (KeeperException | InterruptedException e1) { + throw new RuntimeException(e1); + } + + ops = new ArrayList<String>(ops); + Collections.sort(ops, Collections.reverseOrder()); + + ArrayList<ReadOnlyRepo<T>> dops = new ArrayList<>(); + + for (String child : ops) { + if (child.startsWith("repo_")) { + byte[] ser; + try { + ser = zk.getData(txpath + "/" + child, null); + dops.add((ReadOnlyRepo<T>) deserialize(ser)); --- End diff -- You can limit the unchecked cast warning suppression to just this parameter, if you assign it to a variable and put the warnings suppression on that variable, instead of the whole method. > Create command to dump stack for FATE operation > ----------------------------------------------- > > Key: ACCUMULO-4152 > URL: https://issues.apache.org/jira/browse/ACCUMULO-4152 > Project: Accumulo > Issue Type: Improvement > Reporter: Keith Turner > Fix For: 1.8.0 > > > Each FATE operation has an associated stack of serialized java objects in > zookeeper. It would be nice to be able to see the contents of these objects. > One possible way to do this is to serialize each object on the stack as json > and print out the json. Using json avoids implementing a useful toString > method for each type of fate object. -- This message was sent by Atlassian JIRA (v6.3.4#6332)