org.apache.derby.impl.store.logical.log
Class LogicalLogger

java.lang.Object
  extended byorg.apache.derby.impl.store.logical.log.LogicalLogger

public class LogicalLogger
extends java.lang.Object

The logical logger is created as a singleton with three differene log services: log, logAndCommit and logAndAbort

Author:
Egil S¿rensen

Method Summary
static LogicalLogger getInstance()
          Gets an instance of the LogicalLogger.
 void log(org.apache.derby.iapi.types.DataValueDescriptor[] oldValue, org.apache.derby.iapi.types.DataValueDescriptor[] newValue, org.apache.derby.iapi.types.DataValueDescriptor oldKey, org.apache.derby.iapi.types.DataValueDescriptor newKey, java.lang.String tableName, org.apache.derby.iapi.sql.dictionary.ColumnDescriptor[] columns, int keyColumnName, int transactionId, int operationType)
          Main log method, creates a logical log record and adds it to the logical log
 boolean logAndAbort(int transactionId)
          Writes an abort log record.
 boolean logAndCommit(int transactionId)
          Writes a commit log record.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LogicalLogger getInstance()
Gets an instance of the LogicalLogger. If one exists, return it. If not create an instance. Ensures that there are no more than one LogicalLogger at any given time.

Returns:
The LogicalLogger instance

log

public void log(org.apache.derby.iapi.types.DataValueDescriptor[] oldValue,
                org.apache.derby.iapi.types.DataValueDescriptor[] newValue,
                org.apache.derby.iapi.types.DataValueDescriptor oldKey,
                org.apache.derby.iapi.types.DataValueDescriptor newKey,
                java.lang.String tableName,
                org.apache.derby.iapi.sql.dictionary.ColumnDescriptor[] columns,
                int keyColumnName,
                int transactionId,
                int operationType)
Main log method, creates a logical log record and adds it to the logical log

Parameters:
oldValue - the oldValue of the affected row
newValue - the newValue of the affected row
oldKey - the old Key
newKey - the new Key
tableName - the name of the affected table
columns - a list of columns for this table
transactionId - the id of the active transaction
operationType - the operation type

logAndCommit

public boolean logAndCommit(int transactionId)
Writes a commit log record. If the mode is set to TWO_SAFE the log is attempted flushed to the log receiver. Returns a boolean result depending on the success of the log flush. If the mode is set to ONE_SAFE this always returns true, if it is set to TWO_SAFE however if it returns true the log was shipped succesfully, if an error occurs however the log might have been sent, but we cannot guarantee this and the response is false.

Parameters:
transactionId - The id of the transaction to be committed
Returns:
The result of the log shipment

logAndAbort

public boolean logAndAbort(int transactionId)
Writes an abort log record. If the mode is set to TWO_SAFE the log is attempted flushed to the log receiver. Returns a boolean result depending on the success of the log flush. If the mode is set to ONE_SAFE this always returns true, if it is set to TWO_SAFE however if it returns true the log was shipped succesfully, if an error occurs however the log might have been sent, but we cannot guarantee this and the response is false.

Parameters:
transactionId - The id of the transaction to be committed
Returns:
The result of the log shipment