Arshad Mohammad created ZOOKEEPER-2277:
------------------------------------------

             Summary: Zookeeper off-line snapshot and transaction log viewer
                 Key: ZOOKEEPER-2277
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2277
             Project: ZooKeeper
          Issue Type: Improvement
            Reporter: Arshad Mohammad
            Assignee: Arshad Mohammad
             Fix For: 3.5.2


{color:blue}Currently ZooKeeper provides utility java program to view the 
snapshot and transaction off-line but these are not easy to use, also the 
content is less understandable {color}
In this improvement task I propose following functionality:
1) add zkTool.sh script to view snapshot and transaction.
Usage: zkTool.sh -COMMAND <transaction/snapshot file>
where COMMAND is one of:
otv   off-line transaction viewer, prints ZooKeeper transaction log in text 
format
osv   off-line snapshot viewer, prints ZooKeeper snapshot in text format
2) otv command will give output as:
{noformat}
9/4/15 4:37:04 PM IST session 0x1004d19fe6f0002 cxid  0x00000000000c2c 
(epoch=0,count=3116) zxid  0x00000100000c49 (epoch=1,count=3145) create 
path="/4da53875-b471-4ab1-9995-03889e73c0a3/node246",data="Quick brown fox 
jumps over the lazy dog 
",acl{e1{perms="cdrwa",id{scheme="world",id="anyone"}}},ephemeral="true",parentCVersion="8"
{noformat}
It is mostly same as {{org.apache.zookeeper.server.LogFormatter}} with some 
differences. 
* epoch and count are separated from zxid. 
* operations type will be written instead of code like createSession instead 
-10. 
* showing data. 
* permissions are written in letters perms="cdrwa" instead of perms="31" same 
as {{org.apache.zookeeper.cli.GetAclCommand}}. 
* ephemeral="true" instead of  ephemeral="1"
* etc.

3) osv command will give output as:
{code}
/67868d36-8bbf-4a8a-a076-f16810ac10de/node540000000010
  cZxid = 0x00000100000265 (epoch=1,count=613)
  ctime = Fri Sep 04 16:35:58 IST 2015
  mZxid = 0x00000100000265 (epoch=1,count=613)
  mtime = Fri Sep 04 16:35:58 IST 2015
  pZxid = 0x00000100000265 (epoch=1,count=613)
  cversion = 0
  dataVersion = 0
  aclVersion = 0
  ephemeralOwner = 0x1004d19fe6f0002
  dataLength = 40
  data = Quick brown fox jumps over the lazy dog
{code}
which is almost same as {{org.apache.zookeeper.server.SnapshotFormatter}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to