zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Norbert Kalmar <nkal...@cloudera.com.INVALID>
Subject Re: Get transaction count from ZooKeeper transaction logs
Date Wed, 11 Jul 2018 08:57:05 GMT

Good question, I took a look and only other options I can see is
that TxnLogToolkit also outputs the number of txns in the file (see

Looking at org.apache.zookeeper.server.persistence.TxnLogToolkit.java it
counts it in the dump() function, which is not the most efficient way
either. But what you could do is add a method that only counts the txns.
Or, well, create a Jira for this so someone will implement it :)

But let's wait if anyone knows a better way?

By the way, 4 letter commands will be deprecated soon, so keep that in mind.


On Wed, Jul 11, 2018 at 3:21 AM Jostein Elvaker Haande <jehaande@gmail.com>

>  Hello,
> I'm trying to find an effective way to find the number of transactions
> stored in the ZooKeeper transaction logs. The only method I've found so far
> is by using the Java class 'org.apache.zookeeper.server.LogFormatter' which
> outputs the following after it has formatted a log file:
>   EOF reached after 203 txns.
> Now I could of course make a script to process each log file through this
> log formatter, and extract the count from the last line of stdout, but I'm
> wondering if there's an easier method.
> I've read through the ZK documentation, and tried the ZK commands (aka The
> Four Letter Words) to see if any of these offer this metric, but I could
> not see it.
> So my question is - is there a simpler approach to find this count?
> --
> Yours sincerely Jostein Elvaker Haande
> "A free society is a society where it is safe to be unpopular"
> - Adlai Stevenson
> http://tolecnal.net -- tolecnal at tolecnal dot net

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message