|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neeve.rog.log.RogLogMetadata
public final class RogLogMetadata
Holds an ROG transaction log metadata. This class is not intended for public use. Format:
-------------------------------- Metadata ----------------------------- Bytes 0 : metadata version (identifies metadata format) 1-4 : Flags 5-8 : Live log number (log # that is the live log) 9-12 : CDC log number (long # on which CDC is occurring (-1 = CDC disabled)) 13-20 : CDC checkpoint number (checkpoint # on which CDC is occurring (-1 = CDC disabled)) 21-28 : CDC cursor (pos in the checkpoint being CDC'd that has been handled by the CDC handler) 29-36 : Log UUID low 37-44 : Log UUID high 45-52 : Last Validated Sequence Number -------------------------------- END --------------------------------
Constructor Summary | |
---|---|
RogLogMetadata(File root,
String name)
|
Method Summary | |
---|---|
void |
close()
Syncs the metadata to disk and close the underlying file. |
void |
deserialize(PktBuffer from,
IStoreBinding.Role role)
Deserializes the metadata |
void |
disableCdc()
Disable CDC |
void |
enableCdc()
Enable CDC |
boolean |
exists()
Tests if the metadata file exists. |
long |
getCdcCheckpointVersion()
Set the last checkpoint version successfully CDC'd |
long |
getCdcCursor()
Gets the current CDC cursor in the log file being CDC'd. |
int |
getCdcLogNumber()
Get the number of the log being CDC'd |
boolean |
getIsBackup()
Gets whether or not the log is for a cluster backup |
boolean |
getIsPureMessageLogger()
Gets whether or not the log is is purely for message logging. |
long |
getLastValidatedPosition()
Gets the last validated log position, or -1 if none has been set. |
int |
getLiveLogNumber()
Get the number of the live log |
static int |
getLiveLogNumber(PktBuffer buffer)
Get the number of the live log from serialized metadata |
com.eaio.uuid.UUID |
getLogUUID()
Gets the log uuid. |
String |
getName()
Get the unsuffixed name of the log file this metadata represents. |
File |
getRoot()
Get the location root of the metadata file |
byte |
getVersion()
Get the metadata version |
boolean |
isCdcEnabled()
Get if CDC is enabled |
boolean |
isOpen()
Tests if the metadata is open. |
void |
open()
Opens and deserializes current metadata |
void |
open(PktBuffer from,
IStoreBinding.Role role)
Opens using specified serialized metadata |
void |
renameTo(String newName)
Renames the metadata file. |
void |
serialize(PktBuffer to)
Serializes the metadata |
void |
setCdcCheckpointVersion(long val)
Set the last checkpoint version successfully CDC'd |
void |
setCdcCursor(long val)
Sets the current CDC cursor in the log file being CDC'd. |
void |
setCdcLogNumber(int val)
Set the number of the log being CDC'd |
void |
setIsBackup(boolean isBackup)
Sets whether or not the log is for a cluster backup |
void |
setIsPureMessageLogger(boolean isMessageLogger)
Sets whether or not the log is purely for message logging. |
void |
setLastValidatedPosition(long position)
Sets the last validated write entry position. |
void |
setLiveLogNumber(int val)
Set the number of the live log |
void |
setLogUUID(com.eaio.uuid.UUID uuid)
Sets the log uuid. |
void |
sync()
Syncs the metadata changes to disk. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RogLogMetadata(File root, String name)
Method Detail |
---|
public final void sync() throws IOException
IOException
- If there is an error syncingpublic final boolean exists()
public final void open(PktBuffer from, IStoreBinding.Role role) throws Exception
from
- The buffer to initialize the metadata from. Can be
null in which case the metadata is initialized from the backing
file if one exists and, if not, then created fresh with defaultsrole
- The role to set in the metadata. Can be null in
which case the role information in the metadata is initialized
from the backin file if one exists and, if not, initialized to
the default value of primary/standalone
IOException
- If there is an error opening the metadata
Exception
public final void open() throws Exception
IOException
- If there is an error opening the metadata
Exception
public final File getRoot()
public final String getName()
public final boolean isOpen()
public final byte getVersion()
public final void setIsBackup(boolean isBackup)
isBackup
- Whether or not the log is for a cluster backuppublic final boolean getIsBackup()
public final void setIsPureMessageLogger(boolean isMessageLogger)
isMessageLogger
- Whether or not the log is purely for message logging.public final boolean getIsPureMessageLogger()
public final void setLiveLogNumber(int val)
public static final int getLiveLogNumber(PktBuffer buffer)
public final int getLiveLogNumber()
public final void setCdcLogNumber(int val)
public final int getCdcLogNumber()
public final void setCdcCheckpointVersion(long val)
public final long getCdcCheckpointVersion()
public final void setCdcCursor(long val)
public final long getCdcCursor()
public final boolean isCdcEnabled()
public final void enableCdc()
public final void disableCdc()
public final void setLogUUID(com.eaio.uuid.UUID uuid)
public final com.eaio.uuid.UUID getLogUUID()
public final void setLastValidatedPosition(long position)
public final long getLastValidatedPosition()
public final void renameTo(String newName) throws IOException
newName
- The new log file name.
IOException
- if the rename operation failspublic final void serialize(PktBuffer to)
public final void deserialize(PktBuffer from, IStoreBinding.Role role) throws Exception
Exception
public final void close() throws IOException
IOException
- If there is an error closing.public final String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |