com.sleepycat.je.log
Class ReplicationContext

java.lang.Object
  extended by com.sleepycat.je.log.ReplicationContext
Direct Known Subclasses:
DbOpReplicationContext

public class ReplicationContext
extends Object

ReplicationContext provides context about high-level operations so that the logging level can determine which replication related actions are required for a given Loggable item. Those lower level actions are: - does a log entry need to be logged with a VLSN generated by this (master) node? - does the log entry need to be logged with the VLSN which accompanied a replication message? - do we need to wait for PERM acks after logging an entry? - do we need to record the client VLSN that was just written to the log? ReplicationContext subclasses may hold additional information about the logical operation which instigated logging, so that this can be added to the log entry. All LogEntryType(s) have a "replicationPossible" attribute. For example, INs will never be replicated, but LN_TX's may or may not be replicated, depending on whether the owning database is replicated. If a LogEntryType will never be replicated, it should be logged with the static ReplicationContext.NO_REPLICATE instance. If replication is possible, the replication context may be: - one allocated for this operation, as the result of client apply - the static instance MASTER, if this node is the replication master - the static instance NO_REPLICATE, if this is a local operation


Field Summary
static ReplicationContext MASTER
           
static ReplicationContext NO_REPLICATE
           
 
Constructor Summary
protected ReplicationContext(boolean inReplicationStream)
           
  ReplicationContext(VLSN clientVLSN)
          Used to pass the VLSN held in an arriving message down to the logging levels.
  ReplicationContext(VLSN clientVLSN, boolean inReplicationStream)
          Used to pass the VLSN held in a migrated LN down to the logging levels.
 
Method Summary
 VLSN getClientVLSN()
           
 DbOperationType getDbOperationType()
           
 boolean inReplicationStream()
           
 boolean mustGenerateVLSN()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MASTER

public static final ReplicationContext MASTER

NO_REPLICATE

public static final ReplicationContext NO_REPLICATE
Constructor Detail

ReplicationContext

protected ReplicationContext(boolean inReplicationStream)

ReplicationContext

public ReplicationContext(VLSN clientVLSN)
Used to pass the VLSN held in an arriving message down to the logging levels.


ReplicationContext

public ReplicationContext(VLSN clientVLSN,
                          boolean inReplicationStream)
Used to pass the VLSN held in a migrated LN down to the logging levels.

Method Detail

getClientVLSN

public VLSN getClientVLSN()
Returns:
the VLSN that arrived in the replication message which instigated this Loggable item.

inReplicationStream

public boolean inReplicationStream()
Returns:
true if this loggable item is part of the replication stream

mustGenerateVLSN

public boolean mustGenerateVLSN()
Returns:
true if this node is the master, and should generate a VLSN for this log entry

getDbOperationType

public DbOperationType getDbOperationType()
Returns:
the type of database operation in progress. For the default case, we return DbOperationType.NONE.

toString

public String toString()
Overrides:
toString in class Object


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