public final class FileLogFetcher extends LogFetcher
FileLogFetcher fetcher = new FileLogFetcher();
fetcher.open(file, 0);
while (fetcher.fetch()) {
LogEvent event;
do {
event = decoder.decode(fetcher, context);
// process log event.
} while (event != null);
}
// file ending reached.
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
BINLOG_MAGIC |
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| 构造器和说明 |
|---|
FileLogFetcher() |
FileLogFetcher(int initialCapacity) |
FileLogFetcher(int initialCapacity,
float growthFactor) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
boolean |
fetch()
Fetches the next frame of binary-log, and fill it in buffer.
|
void |
open(File file)
Open binlog file in local disk to fetch.
|
void |
open(File file,
long filePosition)
Open binlog file in local disk to fetch.
|
void |
open(String filePath)
Open binlog file in local disk to fetch.
|
void |
open(String filePath,
long filePosition)
Open binlog file in local disk to fetch.
|
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, rewindpublic FileLogFetcher()
public FileLogFetcher(int initialCapacity)
public FileLogFetcher(int initialCapacity,
float growthFactor)
public void open(File file) throws FileNotFoundException, IOException
public void open(String filePath) throws FileNotFoundException, IOException
public void open(String filePath, long filePosition) throws FileNotFoundException, IOException
public void open(File file, long filePosition) throws FileNotFoundException, IOException
public boolean fetch()
throws IOException
fetch 在类中 LogFetcherIOExceptionLogFetcher.fetch()public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 LogFetcherIOExceptionLogFetcher.close()Copyright © 2017. All rights reserved.