|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.thl.THLManagerCtrl
public class THLManagerCtrl
This class defines a THLManagerCtrl that implements a utility to access THLManager methods. See the printHelp() command for a description of current commands.
| Nested Class Summary | |
|---|---|
static class |
THLManagerCtrl.InfoHolder
This class holds elements returned by the info query. |
| Field Summary | |
|---|---|
protected static ArgvIterator |
argvIterator
|
protected java.lang.String |
configFile
|
protected static java.lang.String |
defaultConfigPath
Default path to replicator.properties if user not specified other. |
| Constructor Summary | |
|---|---|
THLManagerCtrl(java.lang.String configFile,
boolean doChecksum)
Creates a new THLManagerCtrl object. |
|
| Method Summary | |
|---|---|
protected static void |
fail()
Exit with a process failure code. |
protected static void |
fatal(java.lang.String msg,
java.lang.Throwable t)
Abort following a fatal error. |
static java.lang.String |
formatColumn(OneRowChange.ColumnSpec colSpec,
OneRowChange.ColumnVal value,
java.lang.String prefix,
java.lang.String charset,
boolean hex)
Formats column and column value for printing. |
protected static boolean |
getBoolOrFalse(java.lang.Boolean bool)
Returns a value of a given Boolean object or false if the object is null. |
THLManagerCtrl.InfoHolder |
getInfo()
Queries THL for summary information. |
void |
listEvents(java.lang.Long low,
java.lang.Long high,
java.lang.Long by,
boolean pureSQL,
boolean headersOnly,
boolean json,
java.lang.String charset,
boolean hex)
List THL events within the given range. |
static void |
main(java.lang.String[] argv)
Main method to run utility. |
void |
prepare(boolean readOnly)
Connect to the underlying database containing THL. |
protected static void |
print(java.lang.String msg)
Print a message to stdout without trailing new line character. |
static void |
printHeader(java.lang.StringBuilder stringBuilder,
ReplDBMSEvent event)
Prints a formatted header into StringBuilder for the given ReplDBMSEvent. |
static void |
printHeader(java.lang.StringBuilder stringBuilder,
THLEvent thlEvent,
int format)
Prints a formatted header into StringBuilder for the given THLEvent. |
protected static void |
printHelp()
|
protected static void |
println(java.lang.String msg)
Print a message to stdout with trailing new line character. |
static void |
printReplDBMSEvent(java.lang.StringBuilder stringBuilder,
ReplDBMSEvent event,
boolean pureSQL,
java.lang.String charset,
boolean hex)
Formats and prints ReplDBMSEvent into a given stringBuilder. |
void |
purgeEvents(java.lang.Long low,
java.lang.Long high)
Purge THL events in the given seqno interval. |
protected TungstenProperties |
readConfig()
Reads the replicator.properties. |
protected static boolean |
readYes()
Reads a character from stdin, blocks until it is not received. |
void |
release()
Disconnect from the THL database. |
protected static void |
succeed()
Exit with a process success code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String defaultConfigPath
protected static ArgvIterator argvIterator
protected java.lang.String configFile
| Constructor Detail |
|---|
public THLManagerCtrl(java.lang.String configFile,
boolean doChecksum)
throws java.lang.Exception
THLManagerCtrl object.
configFile - Path to the Tungsten properties file.doChecksum - If false disable checksums on log.
java.lang.Exception| Method Detail |
|---|
protected TungstenProperties readConfig()
throws java.lang.Exception
java.lang.Exception
public void prepare(boolean readOnly)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedExceptionpublic void release()
public THLManagerCtrl.InfoHolder getInfo()
throws ReplicatorException
ReplicatorException
public static java.lang.String formatColumn(OneRowChange.ColumnSpec colSpec,
OneRowChange.ColumnVal value,
java.lang.String prefix,
java.lang.String charset,
boolean hex)
charset - character set name to be used to decode byte arrays in row
replication
public void listEvents(java.lang.Long low,
java.lang.Long high,
java.lang.Long by,
boolean pureSQL,
boolean headersOnly,
boolean json,
java.lang.String charset,
boolean hex)
throws ReplicatorException,
java.lang.InterruptedException
low - Sequence number specifying the beginning of the range. Leave
null to start from the very beginning of the table.high - Sequence number specifying the end of the range. Leave null
to end at the very end of the table.by - pureSQL - Output events in the pure SQL form if true, formatted form
otherwise.charset - character set name to be used to decode byte arrays in row
replicationhex - If true print hex representation of strings
ReplicatorException
java.lang.InterruptedException
public static void printHeader(java.lang.StringBuilder stringBuilder,
THLEvent thlEvent,
int format)
stringBuilder - StringBuilder object to append formatted contents
to.thlEvent - THLEvent to print out.format - 0 - human readable, 1 - JSON, 2 - tab-delimited.printHeader(StringBuilder, ReplDBMSEvent)
public static void printHeader(java.lang.StringBuilder stringBuilder,
ReplDBMSEvent event)
printHeader(StringBuilder, THLEvent, int)
stringBuilder - StringBuilder object to append formatted contents
to.event - ReplDBMSEvent to print out.printHeader(StringBuilder, THLEvent, int)
public static void printReplDBMSEvent(java.lang.StringBuilder stringBuilder,
ReplDBMSEvent event,
boolean pureSQL,
java.lang.String charset,
boolean hex)
stringBuilder - StringBuilder object to append formatted contents
to.event - ReplDBMSEvent to print out.pureSQL - If true, use pure SQL output. Formatted form otherwise.charset - character set name to be used to decode byte arrays in row
replicationhex - If true print hex representation of strings
public void purgeEvents(java.lang.Long low,
java.lang.Long high)
throws ReplicatorException
low - Sequence number specifying the beginning of the range. Leave
null to start from the very beginning of the table.high - Sequence number specifying the end of the range. Leave null
to end at the very end of the table.
ReplicatorExceptionpublic static void main(java.lang.String[] argv)
argv - optional command stringprotected static void printHelp()
protected static void println(java.lang.String msg)
msg - protected static void print(java.lang.String msg)
msg -
protected static void fatal(java.lang.String msg,
java.lang.Throwable t)
msg - t - protected static void fail()
protected static void succeed()
protected static boolean readYes()
throws java.io.IOException
java.io.IOExceptionprotected static boolean getBoolOrFalse(java.lang.Boolean bool)
bool - Boolean object to check and return.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||