public class

ZkGrep

extends Object
java.lang.Object
   ↳ org.apache.helix.tools.ZkGrep

Class Overview

utility for grep zk transaction/snapshot logs - to grep a pattern by t1 use: zkgrep --zkCfg zkCfg --by t1 --pattern patterns... - to grep a pattern between t1 and t2 use: zkgrep --zkCfg zkCfg --between t1 t2 --pattern patterns... for example, to find fail-over latency between t1 and t2, use: 1) zkgrep --zkCfg zkCfg --by t1 --pattern "/{cluster}/LIVEINSTNCES/" | grep {fail-node} 2) zkgrep --zkCfg zkCfg --between t1 t2 --pattern "closeSession" | grep {fail-node session-id} 3) zkgrep --zkCfg zkCfg --between t1 t2 --pattern "/{cluster}" | grep "CURRENTSTATES" | grep "setData" | tail -1 fail-over latency = timestamp difference between 2) and 3)

Summary

Constants
String log
String snapshot
Public Constructors
ZkGrep()
Public Methods
static void grepZkLog(File zkLog, long start, long end, String... patterns)
static void grepZkLogDir(List<File> parsedZkLogs, long start, long end, String... patterns)
static void grepZkSnapshot(File zkSnapshot, String... patterns)
static void main(String[] args)
static void printUsage(Options cliOptions)
static void processCommandLineArgs(String[] cliArgs)
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String log

Constant Value: "log"

public static final String snapshot

Constant Value: "snapshot"

Public Constructors

public ZkGrep ()

Public Methods

public static void grepZkLog (File zkLog, long start, long end, String... patterns)

public static void grepZkLogDir (List<File> parsedZkLogs, long start, long end, String... patterns)

public static void grepZkSnapshot (File zkSnapshot, String... patterns)

public static void main (String[] args)

public static void printUsage (Options cliOptions)

public static void processCommandLineArgs (String[] cliArgs)