com.sleepycat.je.dbi
Class ReplicatedDatabaseConfig

java.lang.Object
  extended by com.sleepycat.je.dbi.ReplicatedDatabaseConfig
All Implemented Interfaces:
Loggable

public class ReplicatedDatabaseConfig
extends Object
implements Loggable

This class contains all fields of the database configuration which are persistent. This class is logged as part of a nameLN so that databases can be created on replica nodes with the correct configuration.


Constructor Summary
ReplicatedDatabaseConfig()
          For reading
ReplicatedDatabaseConfig(byte flags, int maxTreeEntriesPerNode, byte[] btreeComparatorBytes, byte[] duplicateComparatorBytes, byte[][] triggerBytes)
          For writing
 
Method Summary
 void dumpLog(StringBuilder sb, boolean verbose)
          Write the object into the string buffer for log dumping.
 int getLogSize()
           
 DatabaseConfig getReplicaConfig(EnvironmentImpl envImpl)
          Create a database config for use on the replica which contains all the configuration options that were conveyed by way of this class.
 long getTransactionId()
           
 boolean logicalEquals(Loggable other)
           
 void readFromLog(ByteBuffer itemBuffer, int entryVersion)
          Initialize this object from the data in itemBuf.
 void writeToLog(ByteBuffer logBuffer)
          Serialize this object into the buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicatedDatabaseConfig

public ReplicatedDatabaseConfig()
For reading


ReplicatedDatabaseConfig

ReplicatedDatabaseConfig(byte flags,
                         int maxTreeEntriesPerNode,
                         byte[] btreeComparatorBytes,
                         byte[] duplicateComparatorBytes,
                         byte[][] triggerBytes)
For writing

Method Detail

getReplicaConfig

public DatabaseConfig getReplicaConfig(EnvironmentImpl envImpl)
Create a database config for use on the replica which contains all the configuration options that were conveyed by way of this class.


getLogSize

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

writeToLog

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

Specified by:
writeToLog in interface Loggable
Parameters:
logBuffer - is the destination buffer
See Also:
Loggable.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
See Also:
Loggable.readFromLog(java.nio.ByteBuffer, int)

dumpLog

public void dumpLog(StringBuilder sb,
                    boolean verbose)
Description copied from interface: Loggable
Write the object into the string buffer for log dumping. Each object should be dumped without indentation or new lines and should be valid XML.

Specified by:
dumpLog in interface Loggable
Parameters:
sb - destination string buffer
verbose - if true, dump the full, verbose version
See Also:
Loggable.dumpLog(java.lang.StringBuilder, boolean)

getTransactionId

public long getTransactionId()
Specified by:
getTransactionId in interface Loggable
Returns:
the transaction id embedded within this loggable object. Objects that have no transaction id should return 0.
See Also:
Loggable.getTransactionId()

logicalEquals

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


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