Class LogRecord
- java.lang.Object
-
- 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
-
-
Field Summary
Fields Modifier and Type Field Description private static intformatLengthprivate intgroup(package private) java.io.ObjectInputinputprivate Loggableopprivate TransactionIdxactId
-
Constructor Summary
Constructors Constructor Description LogRecord()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intformatOverhead()LoggablegetLoggable()RePreparablegetRePreparable()static intgetStoredSize(int group, TransactionId xactId)TransactionIdgetTransactionId()intgetTypeFormatId()Return my format identifier.UndoablegetUndoable()intgroup()booleanisAbort()booleanisChecksum()booleanisCLR()booleanisCommit()booleanisComplete()booleanisFirst()booleanisPrepare()static intmaxGroupStoredSize()static intmaxTransactionIdStoredSize(TransactionId tranId)voidreadExternal(java.io.ObjectInput in)Read this inbooleanrequiresPrepareLocks()voidsetValue(TransactionId xactId, Loggable op)voidskipLoggable()Skip over the loggable.voidwriteExternal(java.io.ObjectOutput out)Write this out.
-
-
-
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
-
-
Method Detail
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOExceptionWrite this out.- Specified by:
writeExternalin interfacejava.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.ClassNotFoundExceptionRead this in- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException- error reading from log streamjava.lang.ClassNotFoundException- corrupted log stream
-
getTypeFormatId
public int getTypeFormatId()
Return my format identifier.- Specified by:
getTypeFormatIdin interfaceTypedFormat- 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.IOExceptionjava.lang.ClassNotFoundException
-
getLoggable
public Loggable getLoggable() throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
getRePreparable
public RePreparable getRePreparable() throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
skipLoggable
public void skipLoggable() throws StandardExceptionSkip 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.IOExceptionjava.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()
-
-