public interface VersionedWriteLoggable extends Loggable
Loggable implemented by classes that can write
themselves to a byte buffer in an earlier log format, for use by instances
of ReplicableLogEntry that need to support an earlier log format
during replication. See [#22336].
Classes that implement Loggable should implement this interface
if they are included in replication data.
Implementing classes should document the version of the class's most
recent format change. Log entry classes that contain VersionedWriteLoggable items can use that information to determine if they
can copy the log contents for an entry directly or if they need to convert
them in order to be compatible with a particular log version.
| Modifier and Type | Method and Description |
|---|---|
Collection<VersionedWriteLoggable> |
getEmbeddedLoggables() |
int |
getLastFormatChange()
Returns the log version of the most recent format change for this
loggable item.
|
int |
getLogSize(int logVersion,
boolean forReplication)
Returns the number of bytes needed to store this object in the format
for the specified log version.
|
boolean |
hasReplicationFormat()
Returns whether this format has a variant that is optimized for
replication.
|
boolean |
isReplicationFormatWorthwhile(ByteBuffer logBuffer,
int srcVersion,
int destVersion)
Returns whether it is worthwhile to materialize and then re-serialize a
log entry in a format optimized for replication.
|
void |
writeToLog(ByteBuffer logBuffer,
int logVersion,
boolean forReplication)
Serializes this object into the specified buffer in the format for the
specified log version.
|
dumpLog, getLogSize, getTransactionId, logicalEquals, readFromLog, writeToLogint getLastFormatChange()
ReplicableLogEntry.getLastFormatChange()Collection<VersionedWriteLoggable> getEmbeddedLoggables()
int getLogSize(int logVersion,
boolean forReplication)
LogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.logVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.void writeToLog(ByteBuffer logBuffer, int logVersion, boolean forReplication)
LogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.logBuffer - the destination bufferlogVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.boolean hasReplicationFormat()
boolean isReplicationFormatWorthwhile(ByteBuffer logBuffer, int srcVersion, int destVersion)
WARNING: The logBuffer position must not be changed by this method.
WARNING: The shared LogEntry object is used for calling this method, and this method must not change any of the fields in the object.
logBuffer - contains the entry that would be re-serialized.srcVersion - the log version of entry in logBuffer.destVersion - the version that would be used for re-serialization.Copyright © 2024. All rights reserved.