public final class LogHeader
extends java.lang.Object
| Name | Format | Description |
|---|---|---|
| timestamp | 4 byte unsigned integer | The time when the query started, in seconds since 1970. |
| type | 1 byte enumeration | See enum #Log_event_type. |
| server_id | 4 byte unsigned integer | Server ID of the server that created the event. |
| total_size | 4 byte unsigned integer | The total size of this event, in bytes. In other words, this is the sum of the sizes of Common-Header, Post-Header, and Body. |
| master_position | 4 byte unsigned integer | The position of the next event in the master binary log, in bytes from the beginning of the file. In a binlog that is not a relay log, this is just the position of the next event, in bytes from the beginning of the file. In a relay log, this is the position of the next event in the master's binlog. |
| flags | 2 byte bitfield | See Log_event::flags. |
mysql-5.1.60/sql/log_event.cc| 限定符和类型 | 字段和说明 |
|---|---|
protected int |
checksumAlg
The value is set by caller of FD constructor and
Log_event::write_header() for the rest.
|
protected long |
crc
Placeholder for event checksum while writing to binlog.
|
protected int |
eventLen
Number of bytes written by write() function
|
protected int |
flags
Some 16 flags.
|
protected java.util.Map<java.lang.String,java.lang.String> |
gtidMap |
protected java.lang.String |
logFileName
binlog fileName
|
protected long |
logPos
The offset in the log where this event originally appeared (it is
preserved in relay logs, making SHOW SLAVE STATUS able to print
coordinates of the event in the master's binlog).
|
protected long |
serverId
The master's server id (is preserved in the relay log; used to prevent
from infinite loops in circular replication).
|
protected int |
type |
protected long |
when
Timestamp on the master(for debugging and replication of
NOW()/TIMESTAMP).
|
| 构造器和说明 |
|---|
LogHeader(int type) |
LogHeader(LogBuffer buffer,
FormatDescriptionLogEvent descriptionEvent) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getChecksumAlg() |
long |
getCrc() |
java.lang.String |
getCurrentGtid() |
java.lang.String |
getCurrentGtidLastCommit() |
java.lang.String |
getCurrentGtidSn() |
int |
getEventLen()
The total size of this event, in bytes.
|
int |
getFlags()
Some 16 flags.
|
java.lang.String |
getGtidSetStr() |
java.lang.String |
getLogFileName() |
long |
getLogPos()
The position of the next event in the master binary log, in bytes from
the beginning of the file.
|
long |
getServerId()
Server ID of the server that created the event.
|
int |
getType()
The different types of log events.
|
long |
getWhen()
The time when the query started, in seconds since 1970.
|
void |
putGtid(GTIDSet gtidSet,
GtidLogEvent event) |
void |
setLogFileName(java.lang.String logFileName) |
protected final int type
protected long logPos
protected long when
protected int eventLen
protected long serverId
protected int flags
protected int checksumAlg
protected long crc
protected java.lang.String logFileName
protected java.util.Map<java.lang.String,java.lang.String> gtidMap
public LogHeader(int type)
public LogHeader(LogBuffer buffer, FormatDescriptionLogEvent descriptionEvent)
public final int getType()
public final long getLogPos()
public final int getEventLen()
public final long getWhen()
public final long getServerId()
public final int getFlags()
public long getCrc()
public int getChecksumAlg()
public java.lang.String getLogFileName()
public void setLogFileName(java.lang.String logFileName)
public java.lang.String getGtidSetStr()
public java.lang.String getCurrentGtid()
public java.lang.String getCurrentGtidSn()
public java.lang.String getCurrentGtidLastCommit()
public void putGtid(GTIDSet gtidSet, GtidLogEvent event)
Copyright © 2019. All rights reserved.