public class LogEntry extends Object implements IdentifiedDataSerializable
RaftLog
.
Each log entry stores a state machine command along with the term number
when the entry was received by the leader. The term numbers in log entries
are used to detect inconsistencies between logs. Each log entry also has
an integer index identifying its position in the log.Constructor and Description |
---|
LogEntry() |
LogEntry(int term,
long index,
Object operation) |
Modifier and Type | Method and Description |
---|---|
int |
getFactoryId()
Returns DataSerializableFactory factory ID for this class.
|
int |
getId()
Returns type identifier for this class.
|
long |
index() |
Object |
operation() |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
int |
term() |
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public LogEntry()
public LogEntry(int term, long index, Object operation)
public long index()
public int term()
public Object operation()
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
output stream has been closed.public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
- if an I/O error occurs. In particular,
an IOException
may be thrown if the
input stream has been closed.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.