org.apache.derby.impl.store.raw.log
Class LogRecord

java.lang.Object
  extended by org.apache.derby.impl.store.raw.log.LogRecord
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat

public class LogRecord
extends java.lang.Object
implements Formatable

The log record written out to disk. This log record includes:

The is a holder object that may be setup using the setValue() and re-used rather than creating a new object for each actual log record.

        The format of a log record is

See Also:
Serialized Form
Format IDLOG_RECORD the formatId is written by FormatIdOutputStream when this object is written out by writeObject
PurposeThe log record described every change to the persistent store
Upgrade
Disk Layoutloggable group(CompressedInt) the loggable's group value xactId(TransactionId) The Transaction this log belongs to op(Loggable) the log operation

Field Summary
private static int formatLength
           
private  int group
           
(package private)  java.io.ObjectInput input
           
private  Loggable op
           
private  TransactionId xactId
           
 
Constructor Summary
LogRecord()
           
 
Method Summary
static int formatOverhead()
           
 Loggable getLoggable()
           
 RePreparable getRePreparable()
           
static int getStoredSize(int group, TransactionId xactId)
           
 TransactionId getTransactionId()
           
 int getTypeFormatId()
          Return my format identifier.
 Undoable getUndoable()
           
 int group()
           
 boolean isAbort()
           
 boolean isChecksum()
           
 boolean isCLR()
           
 boolean isCommit()
           
 boolean isComplete()
           
 boolean isFirst()
           
 boolean isPrepare()
           
static int maxGroupStoredSize()
           
static int maxTransactionIdStoredSize(TransactionId tranId)
           
 void readExternal(java.io.ObjectInput in)
          Read this in
 boolean requiresPrepareLocks()
           
 void setValue(TransactionId xactId, Loggable op)
           
 void skipLoggable()
          Skip over the loggable.
 void writeExternal(java.io.ObjectOutput out)
          Write this out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xactId

private TransactionId xactId

op

private Loggable op

group

private int group

input

transient java.io.ObjectInput input

formatLength

private static final int formatLength
Constructor Detail

LogRecord

public LogRecord()
Method Detail

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this out.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException - error writing to log stream

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this in

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException - error reading from log stream
java.lang.ClassNotFoundException - corrupted log stream

getTypeFormatId

public int getTypeFormatId()
Return my format identifier.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
The identifier. (A UUID stuffed in an array of 16 bytes).

setValue

public void setValue(TransactionId xactId,
                     Loggable op)

formatOverhead

public static int formatOverhead()

maxGroupStoredSize

public static int maxGroupStoredSize()

maxTransactionIdStoredSize

public static int maxTransactionIdStoredSize(TransactionId tranId)

getStoredSize

public static int getStoredSize(int group,
                                TransactionId xactId)

getTransactionId

public TransactionId getTransactionId()
                               throws java.io.IOException,
                                      java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getLoggable

public Loggable getLoggable()
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getRePreparable

public RePreparable getRePreparable()
                             throws java.io.IOException,
                                    java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

skipLoggable

public void skipLoggable()
                  throws StandardException
Skip over the loggable. Set the input stream to point ot after the loggable as if the entire log record has been sucked in by the log record

Throws:
StandardException - if the loggable is not found, log is corrupt

getUndoable

public Undoable getUndoable()
                     throws java.io.IOException,
                            java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

isCLR

public boolean isCLR()

isFirst

public boolean isFirst()

isComplete

public boolean isComplete()

isPrepare

public boolean isPrepare()

requiresPrepareLocks

public boolean requiresPrepareLocks()

isCommit

public boolean isCommit()

isAbort

public boolean isAbort()

group

public int group()

isChecksum

public boolean isChecksum()

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.