public enum DbOperationType extends Enum<DbOperationType> implements VersionedWriteLoggable
| Enum Constant and Description |
|---|
CREATE |
NONE |
REMOVE |
RENAME |
TRUNCATE |
UPDATE_CONFIG |
| Modifier and Type | Method and Description |
|---|---|
void |
dumpLog(StringBuilder sb,
boolean verbose)
Write the object into the string buffer for log dumping.
|
Collection<VersionedWriteLoggable> |
getEmbeddedLoggables() |
int |
getLastFormatChange()
Returns the log version of the most recent format change for this
loggable item.
|
int |
getLogSize() |
int |
getLogSize(int logVersion,
boolean forReplication)
Returns the number of bytes needed to store this object in the format
for the specified log version.
|
long |
getTransactionId() |
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.
|
static boolean |
isWriteConfigType(DbOperationType opType)
Return true if this database operation type needs to write
DatabaseConfig.
|
boolean |
logicalEquals(Loggable other) |
void |
readFromLog(ByteBuffer itemBuffer,
int entryVersion)
Initialize this object from the data in itemBuf.
|
static DbOperationType |
readTypeFromLog(ByteBuffer entryBuffer,
int entryVersion) |
static DbOperationType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static DbOperationType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeToLog(ByteBuffer logBuffer)
Serialize this object into the buffer.
|
void |
writeToLog(ByteBuffer logBuffer,
int logVersion,
boolean forReplication)
Serializes this object into the specified buffer in the format for the
specified log version.
|
public static final DbOperationType NONE
public static final DbOperationType CREATE
public static final DbOperationType REMOVE
public static final DbOperationType TRUNCATE
public static final DbOperationType RENAME
public static final DbOperationType UPDATE_CONFIG
public static DbOperationType[] values()
for (DbOperationType c : DbOperationType.values()) System.out.println(c);
public static DbOperationType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static DbOperationType readTypeFromLog(ByteBuffer entryBuffer, int entryVersion)
public int getLastFormatChange()
VersionedWriteLoggablegetLastFormatChange in interface VersionedWriteLoggableReplicableLogEntry.getLastFormatChange()public Collection<VersionedWriteLoggable> getEmbeddedLoggables()
getEmbeddedLoggables in interface VersionedWriteLoggableReplicableLogEntry.getEmbeddedLoggables()public int getLogSize()
getLogSize in interface Loggablepublic void writeToLog(ByteBuffer logBuffer)
LoggablewriteToLog in interface LoggablelogBuffer - is the destination bufferpublic int getLogSize(int logVersion,
boolean forReplication)
VersionedWriteLoggableLogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.getLogSize in interface VersionedWriteLoggablelogVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.public void writeToLog(ByteBuffer logBuffer, int logVersion, boolean forReplication)
VersionedWriteLoggableLogEntryType.LOG_VERSION_REPLICATE_OLDER or greater.writeToLog in interface VersionedWriteLoggablelogBuffer - the destination bufferlogVersion - the log versionforReplication - whether the entry will be sent over the wire,
and not written to the log.public void readFromLog(ByteBuffer itemBuffer, int entryVersion)
LoggablereadFromLog in interface LoggableitemBuffer - the source bufferentryVersion - the log version of the datapublic 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.public void dumpLog(StringBuilder sb, boolean verbose)
Loggablepublic long getTransactionId()
getTransactionId in interface Loggablepublic boolean logicalEquals(Loggable other)
logicalEquals in interface Loggablepublic static boolean isWriteConfigType(DbOperationType opType)
Copyright © 2024. All rights reserved.