| Modifier and Type | Field and Description |
|---|---|
static ByteBuffer |
EMPTY_DATA |
| Constructor and Description |
|---|
LogEntry() |
LogEntry(EnumOutter.EntryType type) |
| Modifier and Type | Method and Description |
|---|---|
long |
checksum()
Calculate a checksum value for this entity.
|
boolean |
decode(byte[] content)
Deprecated.
|
byte[] |
encode()
Deprecated.
|
boolean |
equals(Object obj) |
long |
getChecksum()
Returns the checksum of the log entry.
|
ByteBuffer |
getData()
Returns the log data, it's not read-only, you SHOULD take care it's modification and
thread-safety by yourself.
|
LogId |
getId() |
List<PeerId> |
getLearners() |
List<PeerId> |
getOldLearners() |
List<PeerId> |
getOldPeers() |
List<PeerId> |
getPeers() |
ByteBuffer |
getReadOnlyData()
Creates a new, read-only byte buffer that shares this log entry's data buffer's content.
|
EnumOutter.EntryType |
getType() |
boolean |
hasChecksum()
Returns whether the log entry has a checksum.
|
int |
hashCode() |
boolean |
hasLearners() |
boolean |
isCorrupted()
Returns true when the log entry is corrupted, it means that the checksum is mismatch.
|
void |
setChecksum(long checksum) |
void |
setData(ByteBuffer data) |
void |
setId(LogId id) |
void |
setLearners(List<PeerId> learners) |
void |
setOldLearners(List<PeerId> oldLearners) |
void |
setOldPeers(List<PeerId> oldPeers) |
void |
setPeers(List<PeerId> peers) |
void |
setType(EnumOutter.EntryType type) |
ByteBuffer |
sliceData()
Creates a new byte buffer whose content is a shared subsequence of this log entry's data
buffer's content.
|
String |
toString() |
public static final ByteBuffer EMPTY_DATA
public LogEntry()
public LogEntry(EnumOutter.EntryType type)
public boolean hasLearners()
public long checksum()
Checksum@Deprecated public byte[] encode()
LogEntryEncoder instead.@Deprecated public boolean decode(byte[] content)
LogEntryDecoder instead.public boolean hasChecksum()
public boolean isCorrupted()
public long getChecksum()
hasChecksum to check if
it has checksum.public void setChecksum(long checksum)
public EnumOutter.EntryType getType()
public void setType(EnumOutter.EntryType type)
public LogId getId()
public void setId(LogId id)
public ByteBuffer getData()
public ByteBuffer sliceData()
public ByteBuffer getReadOnlyData()
public void setData(ByteBuffer data)
Copyright © 2024. All rights reserved.