public abstract class BasicVersionedWriteLoggable extends Object implements VersionedWriteLoggable
VersionedWriteLoggable that provides for
writing in a single format by default. Starting with log version 9, as
specified by LogEntryType.LOG_VERSION_REPLICATE_OLDER, loggable
classes whose log format has changed since the previous log version will
need to override the VersionedWriteLoggable.getLastFormatChange(),
VersionedWriteLoggable.getLogSize(int, boolean) and VersionedWriteLoggable.writeToLog(ByteBuffer,
int, boolean) methods to support writing the entry in earlier log formats.| Constructor and Description |
|---|
BasicVersionedWriteLoggable()
Creates an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLogSize() |
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)
Serialize this object into the buffer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEmbeddedLoggables, getLastFormatChange, getLogSize, writeToLogdumpLog, getTransactionId, logicalEquals, readFromLogpublic BasicVersionedWriteLoggable()
public int getLogSize()
getLogSize in interface Loggablepublic void writeToLog(ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablelogBuffer - is the destination bufferpublic boolean hasReplicationFormat()
VersionedWriteLoggablehasReplicationFormat in interface VersionedWriteLoggablepublic boolean isReplicationFormatWorthwhile(ByteBuffer logBuffer, int srcVersion, int destVersion)
VersionedWriteLoggableWARNING: 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.
isReplicationFormatWorthwhile in interface VersionedWriteLoggablelogBuffer - 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.