com.continuent.tungsten.replicator.extractor.mysql
Class MysqlBinlog
java.lang.Object
com.continuent.tungsten.replicator.extractor.mysql.MysqlBinlog
public class MysqlBinlog
- extends java.lang.Object
Implements methods required to load binlogs. This class among other important
tasks handles MySQL to Java character set name mapping. In addition to
baked-in character set defaults we look for a mapping file named
mysql-java-charsets.properties in the configuration directory of the
replicator.
|
Method Summary |
static double |
arr2double(byte[] arr,
int start)
|
static long[] |
decodePackedInteger(byte[] buffer,
int position)
|
static double |
double8ToDouble(byte[] buf,
int off)
|
static float |
float4ToFloat(byte[] buf,
int off)
|
static long |
getChecksum(int chkAlgo,
byte[] buffer,
int offset,
int length)
|
static long |
getCrc32(byte[] buffer,
int offset,
int length)
|
static java.lang.String |
getJavaCharset(int id)
|
static java.lang.String |
getMySQLCharset(int id)
|
static java.lang.String |
getMySQLCollation(int id)
|
static void |
setBitField(java.util.BitSet bitset,
byte[] buffer,
int pos,
int length)
|
static long |
ulNoSwapToInt(byte[] buf,
int off,
int len)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EVENT_TYPE_OFFSET
public static final int EVENT_TYPE_OFFSET
- See Also:
- Constant Field Values
SERVER_ID_OFFSET
public static final int SERVER_ID_OFFSET
- See Also:
- Constant Field Values
EVENT_LEN_OFFSET
public static final int EVENT_LEN_OFFSET
- See Also:
- Constant Field Values
LOG_POS_OFFSET
public static final int LOG_POS_OFFSET
- See Also:
- Constant Field Values
FLAGS_OFFSET
public static final int FLAGS_OFFSET
- See Also:
- Constant Field Values
LOG_EVENT_BINLOG_IN_USE_F
public static final byte LOG_EVENT_BINLOG_IN_USE_F
- See Also:
- Constant Field Values
LOG_EVENT_THREAD_SPECIFIC_F
public static final int LOG_EVENT_THREAD_SPECIFIC_F
- See Also:
- Constant Field Values
BIN_LOG_HEADER_SIZE
public static final int BIN_LOG_HEADER_SIZE
- See Also:
- Constant Field Values
PROBE_HEADER_LEN
public static final int PROBE_HEADER_LEN
- See Also:
- Constant Field Values
BINLOG_MAGIC
public static final byte[] BINLOG_MAGIC
VERSION_NONE
public static final int VERSION_NONE
- See Also:
- Constant Field Values
BINLOG_V1
public static final int BINLOG_V1
- See Also:
- Constant Field Values
BINLOG_V3
public static final int BINLOG_V3
- See Also:
- Constant Field Values
BINLOG_V4
public static final int BINLOG_V4
- See Also:
- Constant Field Values
UNKNOWN_EVENT
public static final int UNKNOWN_EVENT
- See Also:
- Constant Field Values
START_EVENT_V3
public static final int START_EVENT_V3
- See Also:
- Constant Field Values
QUERY_EVENT
public static final int QUERY_EVENT
- See Also:
- Constant Field Values
STOP_EVENT
public static final int STOP_EVENT
- See Also:
- Constant Field Values
ROTATE_EVENT
public static final int ROTATE_EVENT
- See Also:
- Constant Field Values
INTVAR_EVENT
public static final int INTVAR_EVENT
- See Also:
- Constant Field Values
LOAD_EVENT
public static final int LOAD_EVENT
- See Also:
- Constant Field Values
SLAVE_EVENT
public static final int SLAVE_EVENT
- See Also:
- Constant Field Values
CREATE_FILE_EVENT
public static final int CREATE_FILE_EVENT
- See Also:
- Constant Field Values
APPEND_BLOCK_EVENT
public static final int APPEND_BLOCK_EVENT
- See Also:
- Constant Field Values
EXEC_LOAD_EVENT
public static final int EXEC_LOAD_EVENT
- See Also:
- Constant Field Values
DELETE_FILE_EVENT
public static final int DELETE_FILE_EVENT
- See Also:
- Constant Field Values
NEW_LOAD_EVENT
public static final int NEW_LOAD_EVENT
- See Also:
- Constant Field Values
RAND_EVENT
public static final int RAND_EVENT
- See Also:
- Constant Field Values
USER_VAR_EVENT
public static final int USER_VAR_EVENT
- See Also:
- Constant Field Values
FORMAT_DESCRIPTION_EVENT
public static final int FORMAT_DESCRIPTION_EVENT
- See Also:
- Constant Field Values
XID_EVENT
public static final int XID_EVENT
- See Also:
- Constant Field Values
BEGIN_LOAD_QUERY_EVENT
public static final int BEGIN_LOAD_QUERY_EVENT
- See Also:
- Constant Field Values
EXECUTE_LOAD_QUERY_EVENT
public static final int EXECUTE_LOAD_QUERY_EVENT
- See Also:
- Constant Field Values
TABLE_MAP_EVENT
public static final int TABLE_MAP_EVENT
- See Also:
- Constant Field Values
PRE_GA_WRITE_ROWS_EVENT
public static final int PRE_GA_WRITE_ROWS_EVENT
- See Also:
- Constant Field Values
PRE_GA_UPDATE_ROWS_EVENT
public static final int PRE_GA_UPDATE_ROWS_EVENT
- See Also:
- Constant Field Values
PRE_GA_DELETE_ROWS_EVENT
public static final int PRE_GA_DELETE_ROWS_EVENT
- See Also:
- Constant Field Values
WRITE_ROWS_EVENT
public static final int WRITE_ROWS_EVENT
- See Also:
- Constant Field Values
UPDATE_ROWS_EVENT
public static final int UPDATE_ROWS_EVENT
- See Also:
- Constant Field Values
DELETE_ROWS_EVENT
public static final int DELETE_ROWS_EVENT
- See Also:
- Constant Field Values
INCIDENT_EVENT
public static final int INCIDENT_EVENT
- See Also:
- Constant Field Values
ENUM_END_EVENT
public static final int ENUM_END_EVENT
- See Also:
- Constant Field Values
HEARTBEAT_LOG_EVENT
public static final int HEARTBEAT_LOG_EVENT
- See Also:
- Constant Field Values
IGNORABLE_LOG_EVENT
public static final int IGNORABLE_LOG_EVENT
- See Also:
- Constant Field Values
ROWS_QUERY_LOG_EVENT
public static final int ROWS_QUERY_LOG_EVENT
- See Also:
- Constant Field Values
NEW_WRITE_ROWS_EVENT
public static final int NEW_WRITE_ROWS_EVENT
- See Also:
- Constant Field Values
NEW_UPDATE_ROWS_EVENT
public static final int NEW_UPDATE_ROWS_EVENT
- See Also:
- Constant Field Values
NEW_DELETE_ROWS_EVENT
public static final int NEW_DELETE_ROWS_EVENT
- See Also:
- Constant Field Values
GTID_LOG_EVENT
public static final int GTID_LOG_EVENT
- See Also:
- Constant Field Values
ANONYMOUS_GTID_LOG_EVENT
public static final int ANONYMOUS_GTID_LOG_EVENT
- See Also:
- Constant Field Values
PREVIOUS_GTIDS_LOG_EVENT
public static final int PREVIOUS_GTIDS_LOG_EVENT
- See Also:
- Constant Field Values
ENUM_END_EVENT_FROM_56
public static final int ENUM_END_EVENT_FROM_56
- See Also:
- Constant Field Values
ST_SERVER_VER_LEN
public static final int ST_SERVER_VER_LEN
- See Also:
- Constant Field Values
LOG_EVENT_TYPES
public static final int LOG_EVENT_TYPES
- See Also:
- Constant Field Values
LOG_NEW_5_6_EVENT_TYPES
public static final int LOG_NEW_5_6_EVENT_TYPES
- See Also:
- Constant Field Values
OLD_HEADER_LEN
public static final int OLD_HEADER_LEN
- See Also:
- Constant Field Values
LOG_EVENT_HEADER_LEN
public static final int LOG_EVENT_HEADER_LEN
- See Also:
- Constant Field Values
LOG_EVENT_MINIMAL_HEADER_LEN
public static final int LOG_EVENT_MINIMAL_HEADER_LEN
- See Also:
- Constant Field Values
QUERY_HEADER_MINIMAL_LEN
public static final int QUERY_HEADER_MINIMAL_LEN
- See Also:
- Constant Field Values
QUERY_HEADER_LEN
public static final int QUERY_HEADER_LEN
- See Also:
- Constant Field Values
LOAD_HEADER_LEN
public static final int LOAD_HEADER_LEN
- See Also:
- Constant Field Values
START_V3_HEADER_LEN
public static final int START_V3_HEADER_LEN
- See Also:
- Constant Field Values
ROTATE_HEADER_LEN
public static final int ROTATE_HEADER_LEN
- See Also:
- Constant Field Values
CREATE_FILE_HEADER_LEN
public static final int CREATE_FILE_HEADER_LEN
- See Also:
- Constant Field Values
APPEND_BLOCK_HEADER_LEN
public static final int APPEND_BLOCK_HEADER_LEN
- See Also:
- Constant Field Values
EXEC_LOAD_HEADER_LEN
public static final int EXEC_LOAD_HEADER_LEN
- See Also:
- Constant Field Values
DELETE_FILE_HEADER_LEN
public static final int DELETE_FILE_HEADER_LEN
- See Also:
- Constant Field Values
FORMAT_DESCRIPTION_HEADER_LEN
public static final int FORMAT_DESCRIPTION_HEADER_LEN
- See Also:
- Constant Field Values
FORMAT_DESCRIPTION_HEADER_LEN_5_6
public static final int FORMAT_DESCRIPTION_HEADER_LEN_5_6
- See Also:
- Constant Field Values
ROWS_HEADER_LEN
public static final int ROWS_HEADER_LEN
- See Also:
- Constant Field Values
TABLE_MAP_HEADER_LEN
public static final int TABLE_MAP_HEADER_LEN
- See Also:
- Constant Field Values
EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN
public static final int EXECUTE_LOAD_QUERY_EXTRA_HEADER_LEN
- See Also:
- Constant Field Values
EXECUTE_LOAD_QUERY_HEADER_LEN
public static final int EXECUTE_LOAD_QUERY_HEADER_LEN
- See Also:
- Constant Field Values
INCIDENT_HEADER_LEN
public static final int INCIDENT_HEADER_LEN
- See Also:
- Constant Field Values
ST_BINLOG_VER_OFFSET
public static final int ST_BINLOG_VER_OFFSET
- See Also:
- Constant Field Values
ST_SERVER_VER_OFFSET
public static final int ST_SERVER_VER_OFFSET
- See Also:
- Constant Field Values
ST_CREATED_OFFSET
public static final int ST_CREATED_OFFSET
- See Also:
- Constant Field Values
ST_COMMON_HEADER_LEN_OFFSET
public static final int ST_COMMON_HEADER_LEN_OFFSET
- See Also:
- Constant Field Values
SL_MASTER_PORT_OFFSET
public static final int SL_MASTER_PORT_OFFSET
- See Also:
- Constant Field Values
SL_MASTER_POS_OFFSET
public static final int SL_MASTER_POS_OFFSET
- See Also:
- Constant Field Values
SL_MASTER_HOST_OFFSET
public static final int SL_MASTER_HOST_OFFSET
- See Also:
- Constant Field Values
Q_THREAD_ID_OFFSET
public static final int Q_THREAD_ID_OFFSET
- See Also:
- Constant Field Values
Q_EXEC_TIME_OFFSET
public static final int Q_EXEC_TIME_OFFSET
- See Also:
- Constant Field Values
Q_DB_LEN_OFFSET
public static final int Q_DB_LEN_OFFSET
- See Also:
- Constant Field Values
Q_ERR_CODE_OFFSET
public static final int Q_ERR_CODE_OFFSET
- See Also:
- Constant Field Values
Q_STATUS_VARS_LEN_OFFSET
public static final int Q_STATUS_VARS_LEN_OFFSET
- See Also:
- Constant Field Values
Q_DATA_OFFSET
public static final int Q_DATA_OFFSET
- See Also:
- Constant Field Values
Q_FLAGS2_CODE
public static final int Q_FLAGS2_CODE
- See Also:
- Constant Field Values
Q_SQL_MODE_CODE
public static final int Q_SQL_MODE_CODE
- See Also:
- Constant Field Values
OPTION_AUTO_IS_NULL
public static final int OPTION_AUTO_IS_NULL
- See Also:
- Constant Field Values
OPTION_NOT_AUTOCOMMIT
public static final int OPTION_NOT_AUTOCOMMIT
- See Also:
- Constant Field Values
OPTION_NO_FOREIGN_KEY_CHECKS
public static final int OPTION_NO_FOREIGN_KEY_CHECKS
- See Also:
- Constant Field Values
OPTION_RELAXED_UNIQUE_CHECKS
public static final int OPTION_RELAXED_UNIQUE_CHECKS
- See Also:
- Constant Field Values
sql_modes
public static final java.util.Hashtable<java.lang.Long,java.lang.String> sql_modes
Q_CATALOG_CODE
public static final int Q_CATALOG_CODE
- See Also:
- Constant Field Values
Q_AUTO_INCREMENT
public static final int Q_AUTO_INCREMENT
- See Also:
- Constant Field Values
Q_CHARSET_CODE
public static final int Q_CHARSET_CODE
- See Also:
- Constant Field Values
Q_TIME_ZONE_CODE
public static final int Q_TIME_ZONE_CODE
- See Also:
- Constant Field Values
Q_CATALOG_NZ_CODE
public static final int Q_CATALOG_NZ_CODE
- See Also:
- Constant Field Values
Q_LC_TIME_NAMES_CODE
public static final int Q_LC_TIME_NAMES_CODE
- See Also:
- Constant Field Values
Q_CHARSET_DATABASE_CODE
public static final int Q_CHARSET_DATABASE_CODE
- See Also:
- Constant Field Values
I_TYPE_OFFSET
public static final int I_TYPE_OFFSET
- See Also:
- Constant Field Values
I_VAL_OFFSET
public static final int I_VAL_OFFSET
- See Also:
- Constant Field Values
RAND_SEED1_OFFSET
public static final int RAND_SEED1_OFFSET
- See Also:
- Constant Field Values
RAND_SEED2_OFFSET
public static final int RAND_SEED2_OFFSET
- See Also:
- Constant Field Values
UV_VAL_LEN_SIZE
public static final int UV_VAL_LEN_SIZE
- See Also:
- Constant Field Values
UV_VAL_IS_NULL
public static final int UV_VAL_IS_NULL
- See Also:
- Constant Field Values
UV_VAL_TYPE_SIZE
public static final int UV_VAL_TYPE_SIZE
- See Also:
- Constant Field Values
UV_NAME_LEN_SIZE
public static final int UV_NAME_LEN_SIZE
- See Also:
- Constant Field Values
UV_CHARSET_NUMBER_SIZE
public static final int UV_CHARSET_NUMBER_SIZE
- See Also:
- Constant Field Values
R_POS_OFFSET
public static final int R_POS_OFFSET
- See Also:
- Constant Field Values
R_IDENT_OFFSET
public static final int R_IDENT_OFFSET
- See Also:
- Constant Field Values
TM_MAPID_OFFSET
public static final int TM_MAPID_OFFSET
- See Also:
- Constant Field Values
TM_FLAGS_OFFSET
public static final int TM_FLAGS_OFFSET
- See Also:
- Constant Field Values
RW_MAPID_OFFSET
public static final int RW_MAPID_OFFSET
- See Also:
- Constant Field Values
RW_FLAGS_OFFSET
public static final int RW_FLAGS_OFFSET
- See Also:
- Constant Field Values
FN_REFLEN
public static final int FN_REFLEN
- See Also:
- Constant Field Values
LONG_MAX
public static final long LONG_MAX
- See Also:
- Constant Field Values
NULL_LENGTH
public static final long NULL_LENGTH
- See Also:
- Constant Field Values
MYSQL_TYPE_DECIMAL
public static final int MYSQL_TYPE_DECIMAL
- See Also:
- Constant Field Values
MYSQL_TYPE_TINY
public static final int MYSQL_TYPE_TINY
- See Also:
- Constant Field Values
MYSQL_TYPE_SHORT
public static final int MYSQL_TYPE_SHORT
- See Also:
- Constant Field Values
MYSQL_TYPE_LONG
public static final int MYSQL_TYPE_LONG
- See Also:
- Constant Field Values
MYSQL_TYPE_FLOAT
public static final int MYSQL_TYPE_FLOAT
- See Also:
- Constant Field Values
MYSQL_TYPE_DOUBLE
public static final int MYSQL_TYPE_DOUBLE
- See Also:
- Constant Field Values
MYSQL_TYPE_NULL
public static final int MYSQL_TYPE_NULL
- See Also:
- Constant Field Values
MYSQL_TYPE_TIMESTAMP
public static final int MYSQL_TYPE_TIMESTAMP
- See Also:
- Constant Field Values
MYSQL_TYPE_LONGLONG
public static final int MYSQL_TYPE_LONGLONG
- See Also:
- Constant Field Values
MYSQL_TYPE_INT24
public static final int MYSQL_TYPE_INT24
- See Also:
- Constant Field Values
MYSQL_TYPE_DATE
public static final int MYSQL_TYPE_DATE
- See Also:
- Constant Field Values
MYSQL_TYPE_TIME
public static final int MYSQL_TYPE_TIME
- See Also:
- Constant Field Values
MYSQL_TYPE_DATETIME
public static final int MYSQL_TYPE_DATETIME
- See Also:
- Constant Field Values
MYSQL_TYPE_YEAR
public static final int MYSQL_TYPE_YEAR
- See Also:
- Constant Field Values
MYSQL_TYPE_NEWDATE
public static final int MYSQL_TYPE_NEWDATE
- See Also:
- Constant Field Values
MYSQL_TYPE_VARCHAR
public static final int MYSQL_TYPE_VARCHAR
- See Also:
- Constant Field Values
MYSQL_TYPE_BIT
public static final int MYSQL_TYPE_BIT
- See Also:
- Constant Field Values
MYSQL_TYPE_TIMESTAMP2
public static final int MYSQL_TYPE_TIMESTAMP2
- See Also:
- Constant Field Values
MYSQL_TYPE_DATETIME2
public static final int MYSQL_TYPE_DATETIME2
- See Also:
- Constant Field Values
MYSQL_TYPE_TIME2
public static final int MYSQL_TYPE_TIME2
- See Also:
- Constant Field Values
MYSQL_TYPE_NEWDECIMAL
public static final int MYSQL_TYPE_NEWDECIMAL
- See Also:
- Constant Field Values
MYSQL_TYPE_ENUM
public static final int MYSQL_TYPE_ENUM
- See Also:
- Constant Field Values
MYSQL_TYPE_SET
public static final int MYSQL_TYPE_SET
- See Also:
- Constant Field Values
MYSQL_TYPE_TINY_BLOB
public static final int MYSQL_TYPE_TINY_BLOB
- See Also:
- Constant Field Values
MYSQL_TYPE_MEDIUM_BLOB
public static final int MYSQL_TYPE_MEDIUM_BLOB
- See Also:
- Constant Field Values
MYSQL_TYPE_LONG_BLOB
public static final int MYSQL_TYPE_LONG_BLOB
- See Also:
- Constant Field Values
MYSQL_TYPE_BLOB
public static final int MYSQL_TYPE_BLOB
- See Also:
- Constant Field Values
MYSQL_TYPE_VAR_STRING
public static final int MYSQL_TYPE_VAR_STRING
- See Also:
- Constant Field Values
MYSQL_TYPE_STRING
public static final int MYSQL_TYPE_STRING
- See Also:
- Constant Field Values
MYSQL_TYPE_GEOMETRY
public static final int MYSQL_TYPE_GEOMETRY
- See Also:
- Constant Field Values
TINYINT_MIN
public static final int TINYINT_MIN
- See Also:
- Constant Field Values
TINYINT_MAX
public static final int TINYINT_MAX
- See Also:
- Constant Field Values
SMALLINT_MIN
public static final int SMALLINT_MIN
- See Also:
- Constant Field Values
SMALLINT_MAX
public static final int SMALLINT_MAX
- See Also:
- Constant Field Values
MEDIUMINT_MIN
public static final int MEDIUMINT_MIN
- See Also:
- Constant Field Values
MEDIUMINT_MAX
public static final int MEDIUMINT_MAX
- See Also:
- Constant Field Values
INT_MIN
public static final int INT_MIN
- See Also:
- Constant Field Values
INT_MAX
public static final int INT_MAX
- See Also:
- Constant Field Values
DIG_PER_DEC1
public static int DIG_PER_DEC1
DIG_BASE
public static int DIG_BASE
DIG_MAX
public static int DIG_MAX
dig2bytes
public static final int[] dig2bytes
E_DEC_OVERFLOW
public static final int E_DEC_OVERFLOW
- See Also:
- Constant Field Values
E_DEC_TRUNCATED
public static final int E_DEC_TRUNCATED
- See Also:
- Constant Field Values
DIG_PER_INT32
public static final int DIG_PER_INT32
- See Also:
- Constant Field Values
SIZE_OF_INT32
public static final int SIZE_OF_INT32
- See Also:
- Constant Field Values
charsets
public static com.continuent.tungsten.replicator.extractor.mysql.MysqlBinlog.CharsetInfo[] charsets
MysqlBinlog
public MysqlBinlog()
arr2double
public static double arr2double(byte[] arr,
int start)
float4ToFloat
public static float float4ToFloat(byte[] buf,
int off)
throws java.io.IOException
- Throws:
java.io.IOException
double8ToDouble
public static double double8ToDouble(byte[] buf,
int off)
throws java.io.IOException
- Throws:
java.io.IOException
ulNoSwapToInt
public static long ulNoSwapToInt(byte[] buf,
int off,
int len)
decodePackedInteger
public static long[] decodePackedInteger(byte[] buffer,
int position)
throws java.io.IOException
- Throws:
java.io.IOException
setBitField
public static void setBitField(java.util.BitSet bitset,
byte[] buffer,
int pos,
int length)
getMySQLCharset
public static java.lang.String getMySQLCharset(int id)
getMySQLCollation
public static java.lang.String getMySQLCollation(int id)
getJavaCharset
public static java.lang.String getJavaCharset(int id)
getChecksum
public static long getChecksum(int chkAlgo,
byte[] buffer,
int offset,
int length)
getCrc32
public static long getCrc32(byte[] buffer,
int offset,
int length)