com.continuent.tungsten.replicator.extractor.mysql
Class LogEvent

java.lang.Object
  extended by com.continuent.tungsten.replicator.extractor.mysql.LogEvent
Direct Known Subclasses:
AppendBlockLogEvent, BeginLoadQueryLogEvent, DeleteFileLogEvent, IntvarLogEvent, QueryLogEvent, RandLogEvent, RotateLogEvent, RowsLogEvent, StartLogEvent, StopLogEvent, TableMapLogEvent, UserVarLogEvent, XidLogEvent

public abstract class LogEvent
extends java.lang.Object

Version:
1.0
Author:
Seppo Jaakola, Stephane Giron

Field Summary
protected  long execTime
           
protected  int flags
           
protected static org.apache.log4j.Logger logger
           
protected  int logPos
           
protected  int serverId
           
protected  java.lang.String startPosition
           
protected  boolean threadSpecificEvent
           
protected  int type
           
protected  java.sql.Timestamp when
           
 
Constructor Summary
LogEvent()
           
LogEvent(byte[] buffer, FormatDescriptionLogEvent descriptionEvent, int eventType)
           
 
Method Summary
protected  void doChecksum(byte[] buffer, int eventLength, FormatDescriptionLogEvent descriptionEvent)
           
protected  java.math.BigDecimal extractDecimal(byte[] buffer, int precision, int scale)
           
protected  int getDecimalBinarySize(int precision, int scale)
          Returns the number of bytes that is used to store a decimal whose precision and scale are given
 long getExecTime()
           
 int getNextEventPosition()
          Returns the position for the next event.
 int getType()
           
 java.sql.Timestamp getWhen()
           
static java.lang.String hexdump(byte[] buffer)
           
protected static java.lang.String hexdump(byte[] buffer, int offset)
           
protected  java.lang.String hexdump(byte[] buffer, int offset, int length)
           
static LogEvent readLogEvent(ReplicatorRuntime runtime, BinlogReader position, FormatDescriptionLogEvent descriptionEvent, boolean parseStatements, boolean useBytesForString, boolean prefetchSchemaNameLDI)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

execTime

protected long execTime

type

protected int type

when

protected java.sql.Timestamp when

serverId

protected int serverId

logPos

protected int logPos

flags

protected int flags

threadSpecificEvent

protected boolean threadSpecificEvent

startPosition

protected java.lang.String startPosition
Constructor Detail

LogEvent

public LogEvent()

LogEvent

public LogEvent(byte[] buffer,
                FormatDescriptionLogEvent descriptionEvent,
                int eventType)
         throws ReplicatorException
Throws:
ReplicatorException
Method Detail

getExecTime

public long getExecTime()

getWhen

public java.sql.Timestamp getWhen()

getNextEventPosition

public int getNextEventPosition()
Returns the position for the next event.

Returns:
Returns the logPos.

readLogEvent

public static LogEvent readLogEvent(ReplicatorRuntime runtime,
                                    BinlogReader position,
                                    FormatDescriptionLogEvent descriptionEvent,
                                    boolean parseStatements,
                                    boolean useBytesForString,
                                    boolean prefetchSchemaNameLDI)
                             throws ReplicatorException,
                                    java.lang.InterruptedException
Throws:
ReplicatorException
java.lang.InterruptedException

getType

public int getType()

hexdump

protected static java.lang.String hexdump(byte[] buffer,
                                          int offset)

hexdump

protected java.lang.String hexdump(byte[] buffer,
                                   int offset,
                                   int length)

doChecksum

protected void doChecksum(byte[] buffer,
                          int eventLength,
                          FormatDescriptionLogEvent descriptionEvent)
                   throws ExtractorException
Throws:
ExtractorException

extractDecimal

protected java.math.BigDecimal extractDecimal(byte[] buffer,
                                              int precision,
                                              int scale)

getDecimalBinarySize

protected int getDecimalBinarySize(int precision,
                                   int scale)
Returns the number of bytes that is used to store a decimal whose precision and scale are given

Parameters:
precision - of the decimal
scale - of the decimal
Returns:
number of bytes used to store the decimal(precision, scale)

hexdump

public static java.lang.String hexdump(byte[] buffer)