public final class DirectLogFetcher extends LogFetcher
DirectLogFetcher fetcher = new DirectLogFetcher();
fetcher.open(conn, file, 0, 13);
while (fetcher.fetch()) {
LogEvent event;
do {
event = decoder.decode(fetcher, context);
// process log event.
} while (event != null);
}
// connection closed.
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
BINLOG_DUMP_NON_BLOCK
BINLOG_DUMP options
|
static int |
BINLOG_SEND_ANNOTATE_ROWS_EVENT |
static byte |
COM_BINLOG_DUMP
Command to dump binlog
|
static byte |
COM_BINLOG_DUMP_GTID
Command to dump binlog
|
protected static org.slf4j.Logger |
logger |
static int |
MAX_PACKET_LENGTH
Maximum packet length
|
static int |
NET_HEADER_SIZE
Packet header sizes
|
static int |
PACKET_LEN_OFFSET
Packet offsets
|
static int |
PACKET_SEQ_OFFSET |
static int |
SQLSTATE_LENGTH |
BIN_LOG_HEADER_SIZE, DEFAULT_GROWTH_FACTOR, DEFAULT_INITIAL_CAPACITY, factorBIGINT_MAX_VALUE, buffer, DIG_BASE, DIG_MAX, DIG_PER_DEC1, DIG_PER_INT32, dig2bytes, ISO_8859_1, limit, NULL_LENGTH, origin, position, powers10, SIZE_OF_INT32| 构造器和说明 |
|---|
DirectLogFetcher() |
DirectLogFetcher(int initialCapacity) |
DirectLogFetcher(int initialCapacity,
float growthFactor) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
boolean |
fetch()
Fetches the next frame of binary-log, and fill it in buffer.
|
void |
open(Connection conn,
String fileName,
int serverId)
Connect MySQL master to fetch binlog.
|
void |
open(Connection conn,
String fileName,
int serverId,
boolean nonBlocking)
Connect MySQL master to fetch binlog.
|
void |
open(Connection conn,
String fileName,
long filePosition,
int serverId)
Connect MySQL master to fetch binlog.
|
void |
open(Connection conn,
String fileName,
long filePosition,
int serverId,
boolean nonBlocking)
Connect MySQL master to fetch binlog.
|
void |
openGtid(Connection conn,
String gtidStr,
int serverId) |
void |
openGtid(Connection conn,
String gtidStr,
int serverId,
boolean nonBlocking) |
protected void |
putByte(byte b)
Put a byte in the buffer.
|
protected void |
putInt16(int i16)
Put 16-bit integer in the buffer.
|
protected void |
putInt32(long i32)
Put 32-bit integer in the buffer.
|
protected void |
putString(String s)
Put a string in the buffer.
|
protected void |
sendBinlogDump(String fileName,
long filePosition,
int serverId,
boolean nonBlocking) |
protected void |
sendBinlogDumpGtid(String gtidStr,
String fileName,
long filePosition,
int serverId,
boolean nonBlocking) |
ensureCapacitycapacity, consume, duplicate, duplicate, duplicate, fillBitmap, fillBitmap, fillBytes, fillBytes, fillOutput, fillOutput, forward, getBeInt16, getBeInt16, getBeInt24, getBeInt24, getBeInt32, getBeInt32, getBeLong48, getBeLong48, getBeLong64, getBeLong64, getBeUint16, getBeUint16, getBeUint24, getBeUint24, getBeUint32, getBeUint32, getBeUlong40, getBeUlong40, getBeUlong48, getBeUlong48, getBeUlong56, getBeUlong56, getBeUlong64, getBeUlong64, getBitmap, getBitmap, getData, getData, getData, getDecimal, getDecimal, getDouble64, getDouble64, getFixString, getFixString, getFixString, getFixString, getFloat32, getFloat32, getFullString, getFullString, getInt16, getInt16, getInt24, getInt24, getInt32, getInt32, getInt8, getInt8, getLong48, getLong48, getLong64, getLong64, getPackedLong, getPackedLong, getString, getString, getString, getString, getUint16, getUint16, getUint24, getUint24, getUint32, getUint32, getUint8, getUint8, getUlong40, getUlong40, getUlong48, getUlong48, getUlong56, getUlong56, getUlong64, getUlong64, hasRemaining, hexdump, hexdump, limit, limit, position, position, remaining, rewindprotected static final org.slf4j.Logger logger
public static final byte COM_BINLOG_DUMP
public static final byte COM_BINLOG_DUMP_GTID
public static final int NET_HEADER_SIZE
public static final int SQLSTATE_LENGTH
public static final int PACKET_LEN_OFFSET
public static final int PACKET_SEQ_OFFSET
public static final int MAX_PACKET_LENGTH
public static final int BINLOG_DUMP_NON_BLOCK
public static final int BINLOG_SEND_ANNOTATE_ROWS_EVENT
public DirectLogFetcher()
public DirectLogFetcher(int initialCapacity)
public DirectLogFetcher(int initialCapacity,
float growthFactor)
public void open(Connection conn, String fileName, int serverId) throws IOException
IOExceptionpublic void open(Connection conn, String fileName, int serverId, boolean nonBlocking) throws IOException
IOExceptionpublic void open(Connection conn, String fileName, long filePosition, int serverId) throws IOException
IOExceptionpublic void open(Connection conn, String fileName, long filePosition, int serverId, boolean nonBlocking) throws IOException
IOExceptionpublic void openGtid(Connection conn, String gtidStr, int serverId) throws IOException
IOExceptionpublic void openGtid(Connection conn, String gtidStr, int serverId, boolean nonBlocking) throws IOException
IOExceptionprotected final void putByte(byte b)
b - the byte to put in the bufferprotected final void putInt16(int i16)
i16 - the integer to put in the bufferprotected final void putInt32(long i32)
i32 - the integer to put in the bufferprotected final void putString(String s)
s - the value to put in the bufferprotected final void sendBinlogDump(String fileName, long filePosition, int serverId, boolean nonBlocking) throws IOException
IOExceptionprotected final void sendBinlogDumpGtid(String gtidStr, String fileName, long filePosition, int serverId, boolean nonBlocking) throws IOException
IOExceptionpublic boolean fetch()
throws IOException
fetch 在类中 LogFetcherIOExceptionLogFetcher.fetch()public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 LogFetcherIOExceptionLogFetcher.close()Copyright © 2017. All rights reserved.