com.sleepycat.je.tree
Class NameLN

java.lang.Object
  extended by com.sleepycat.je.tree.Node
      extended by com.sleepycat.je.tree.LN
          extended by com.sleepycat.je.tree.NameLN
All Implemented Interfaces:
Loggable

public final class NameLN
extends LN

A NameLN represents a Leaf Node in the name->database id mapping tree.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sleepycat.je.tree.LN
LN.LNWriteFailureException
 
Field Summary
 
Fields inherited from class com.sleepycat.je.tree.Node
NULL_NODE_ID
 
Constructor Summary
NameLN()
          Create an empty NameLN, to be filled in from the log.
NameLN(DatabaseId id, EnvironmentImpl envImpl, boolean replicate)
          In the ideal world, we'd have a base LN class so that this NameLN doesn't have a superfluous data field, but we want to optimize the LN class for size and speed right now.
 
Method Summary
 String beginTag()
           
(package private)  LNLogEntry createLogEntry(LogEntryType entryType, DatabaseImpl dbImpl, byte[] key, byte[] delDupKey, long logAbortLsn, boolean logAbortKnownDeleted, Txn logTxn, ReplicationContext repContext)
           
protected  void dumpLogAdditional(StringBuilder sb, boolean verbose)
          Dump additional fields.
 String dumpString(int nSpaces, boolean dumpTags)
           
 String endTag()
           
 DatabaseId getId()
           
 int getLogSize()
           
 LogEntryType getLogType()
           
protected  LogEntryType getTransactionalLogType()
          Log type for transactional entries.
 boolean isDeleted()
           
 boolean logicalEquals(Loggable other)
           
(package private)  void makeDeleted()
           
 void readFromLog(ByteBuffer itemBuffer, int entryVersion)
          Initialize this object from the data in itemBuf.
 void setId(DatabaseId id)
           
 String toString()
          Default toString method at the root of the tree.
 void writeToLog(ByteBuffer logBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class com.sleepycat.je.tree.LN
accountForSubtreeRemoval, canBeAncestor, copyData, delete, dumpKey, dumpLog, getData, getLastLoggedSize, getMemorySizeIncludedByParent, incFetchStats, isDirty, isEvictable, isEvictableInexact, isSoughtNode, isValidForDelete, log, log, modify, optionalLog, optionalLogProvisional, rebuildINList, releaseMemoryBudget, setDirty, setLastLoggedSize
 
Methods inherited from class com.sleepycat.je.tree.Node
containsDuplicates, dump, getLevel, getNodeId, getTransactionId, getType, latchShared, latchShared, matchLNByNodeId, postFetchInit, releaseLatch, setNodeId, shortDescription, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sleepycat.je.log.Loggable
getTransactionId
 

Constructor Detail

NameLN

public NameLN(DatabaseId id,
              EnvironmentImpl envImpl,
              boolean replicate)
In the ideal world, we'd have a base LN class so that this NameLN doesn't have a superfluous data field, but we want to optimize the LN class for size and speed right now.


NameLN

public NameLN()
Create an empty NameLN, to be filled in from the log.

Method Detail

isDeleted

public boolean isDeleted()
Overrides:
isDeleted in class LN

makeDeleted

void makeDeleted()
Overrides:
makeDeleted in class LN

getId

public DatabaseId getId()

setId

public void setId(DatabaseId id)

toString

public String toString()
Description copied from class: Node
Default toString method at the root of the tree.

Overrides:
toString in class Node

beginTag

public String beginTag()
Overrides:
beginTag in class LN

endTag

public String endTag()
Overrides:
endTag in class LN

dumpString

public String dumpString(int nSpaces,
                         boolean dumpTags)
Overrides:
dumpString in class LN

getTransactionalLogType

protected LogEntryType getTransactionalLogType()
Log type for transactional entries.

Overrides:
getTransactionalLogType in class LN

getLogType

public LogEntryType getLogType()
Overrides:
getLogType in class LN
See Also:
Node.getLogType()

getLogSize

public int getLogSize()
Specified by:
getLogSize in interface Loggable
Overrides:
getLogSize in class LN
Returns:
number of bytes used to store this object.
See Also:
LN.getLogSize()

writeToLog

public void writeToLog(ByteBuffer logBuffer)
Description copied from interface: Loggable
Serialize this object into the buffer.

Specified by:
writeToLog in interface Loggable
Overrides:
writeToLog in class LN
Parameters:
logBuffer - is the destination buffer
See Also:
LN.writeToLog(java.nio.ByteBuffer)

readFromLog

public void readFromLog(ByteBuffer itemBuffer,
                        int entryVersion)
Description copied from interface: Loggable
Initialize this object from the data in itemBuf.

Specified by:
readFromLog in interface Loggable
Overrides:
readFromLog in class LN
See Also:
LN.readFromLog(java.nio.ByteBuffer, int)

logicalEquals

public boolean logicalEquals(Loggable other)
Specified by:
logicalEquals in interface Loggable
Overrides:
logicalEquals in class LN
Returns:
true if these two loggable items are logically the same. Used for replication testing.
See Also:
Loggable.logicalEquals(com.sleepycat.je.log.Loggable)

dumpLogAdditional

protected void dumpLogAdditional(StringBuilder sb,
                                 boolean verbose)
Dump additional fields. Done this way so the additional info can be within the XML tags defining the dumped log entry.

Overrides:
dumpLogAdditional in class LN

createLogEntry

LNLogEntry createLogEntry(LogEntryType entryType,
                          DatabaseImpl dbImpl,
                          byte[] key,
                          byte[] delDupKey,
                          long logAbortLsn,
                          boolean logAbortKnownDeleted,
                          Txn logTxn,
                          ReplicationContext repContext)
Overrides:
createLogEntry in class LN


Copyright (c) 2004-2010 Oracle. All rights reserved.