|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.log.entry.BaseEntry
com.sleepycat.je.log.entry.LNLogEntry
com.sleepycat.je.log.entry.NameLNLogEntry
public class NameLNLogEntry
NameLNLogEntry contains all the regular LNLogEntry fields and additional information about the database operation which instigated the logging of this NameLN. This additional information is used to support replication of database operations in a replication group. Database operations pose a special problem for replication because unlike data record put and get calls, they can result in multiple log entries that are not all members of a single transaction. Create and truncate are the problem operations because they end up logging new MapLNs, and our implementation does not treat MapLNs as transactional. Database operations challenge two replication assumptions: (a) that all logical operations can be repeated on the client node based on the contents of a single log entry, and (b) that non-txnal log entries like MapLNs need not be replicated. Specifically, here's what is logged for database operations. create: 1. new NameLN_TX 2. new MapLN, which has the database config info. 3. txn commit of autocommit or user txn. rename: 1. deleted NameLN_TX 2. new NameLN_TX 3. txn commit from autocommit or user txn truncate: 1. new MapLN w/new id 2. modify the existing NameLN with new id (old database is deleted by usual commit-time processing) 3. txn commit from autocommit or user txn delete 1. deleted NameLN_TX (old database gets deleted by usual commit-time processing) 2. txn commit from autocommit or user txn Extra information is needed for create and truncate, which both log information within the MapLN. Rename and delete only log NameLNs, so they can be replicated on the client using the normal replication messages. The extra fields which follow the usual LNLogEntry fields are: operationType - the type of database operation. In a single node system, this is local information implicit in the code path. databaseConfig (optional) - For creates, database configuration info databaseId (optional)- For truncates, the old db id, so we know which MapLN to delete.
Field Summary |
---|
Fields inherited from class com.sleepycat.je.log.entry.BaseEntry |
---|
entryType |
Constructor Summary | |
---|---|
NameLNLogEntry()
Constructor to read an entry. |
|
NameLNLogEntry(LogEntryType entryType,
NameLN nameLN,
DatabaseId dbId,
byte[] key,
long abortLsn,
boolean abortKnownDeleted,
Txn txn,
ReplicationContext repContext)
Constructor to write this entry. |
Method Summary | |
---|---|
StringBuilder |
dumpEntry(StringBuilder sb,
boolean verbose)
Extends its super class to dump database operation information. |
void |
dumpRep(StringBuilder sb)
Dump the contents of the log entry that are interesting for replication. |
DbOperationType |
getOperationType()
|
ReplicatedDatabaseConfig |
getReplicatedCreateConfig()
|
int |
getSize()
Extends its super class to add in database operation information. |
DatabaseId |
getTruncateOldDbId()
|
boolean |
logicalEquals(LogEntry other)
|
void |
readEntry(LogEntryHeader header,
ByteBuffer entryBuffer,
boolean readFullItem)
Extends its super class to read in database operation information. |
void |
writeEntry(LogEntryHeader header,
ByteBuffer destBuffer)
Extends its super class to add in database operation information. |
Methods inherited from class com.sleepycat.je.log.entry.LNLogEntry |
---|
clone, getAbortKnownDeleted, getAbortLsn, getDbId, getDupKey, getKey, getLastLoggedSize, getLN, getMainItem, getNodeId, getTransactionId, getTxnId, getUserTxn, isDeleted, postLogWork |
Methods inherited from class com.sleepycat.je.log.entry.BaseEntry |
---|
getLogType, newInstanceOfType, setLogType, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.sleepycat.je.log.entry.LogEntry |
---|
getLogType, setLogType |
Constructor Detail |
---|
public NameLNLogEntry()
public NameLNLogEntry(LogEntryType entryType, NameLN nameLN, DatabaseId dbId, byte[] key, long abortLsn, boolean abortKnownDeleted, Txn txn, ReplicationContext repContext)
Method Detail |
---|
public void readEntry(LogEntryHeader header, ByteBuffer entryBuffer, boolean readFullItem) throws DatabaseException
readEntry
in interface LogEntry
readEntry
in class LNLogEntry
DatabaseException
LNLogEntry.readEntry(com.sleepycat.je.log.LogEntryHeader, java.nio.ByteBuffer, boolean)
public StringBuilder dumpEntry(StringBuilder sb, boolean verbose)
dumpEntry
in interface LogEntry
dumpEntry
in class LNLogEntry
LNLogEntry.dumpEntry(java.lang.StringBuilder, boolean)
public int getSize()
getSize
in interface LogEntry
getSize
in class LNLogEntry
LNLogEntry.getSize()
public void writeEntry(LogEntryHeader header, ByteBuffer destBuffer)
writeEntry
in interface LogEntry
writeEntry
in class LNLogEntry
destBuffer
- is the destination bufferLogEntry#writeToLog
public boolean logicalEquals(LogEntry other)
logicalEquals
in interface LogEntry
logicalEquals
in class LNLogEntry
LogEntry.logicalEquals(com.sleepycat.je.log.entry.LogEntry)
public DbOperationType getOperationType()
public ReplicatedDatabaseConfig getReplicatedCreateConfig()
public DatabaseId getTruncateOldDbId()
public void dumpRep(StringBuilder sb)
LogEntry
dumpRep
in interface LogEntry
dumpRep
in class LNLogEntry
LogEntry.dumpRep(java.lang.StringBuilder)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |