[ 
https://issues.apache.org/jira/browse/ACCUMULO-4152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15172289#comment-15172289
 ] 

ASF GitHub Bot commented on ACCUMULO-4152:
------------------------------------------

Github user keith-turner commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/77#discussion_r54452009
  
    --- 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 --
    
    I wanted more narrow supression, but was not quite sure how to achieve that


> 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)

Reply via email to