public class LogRecord extends java.lang.Object implements Formatable
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
Format ID | LOG_RECORD the formatId is written by FormatIdOutputStream when this object is written out by writeObject |
Purpose | The log record described every change to the persistent store |
Upgrade | |
Disk Layout | loggable group(CompressedInt) the loggable's group value xactId(TransactionId) The Transaction this log belongs to op(Loggable) the log operation |
Modifier and Type | Field and Description |
---|---|
private static int |
formatLength |
private int |
group |
(package private) java.io.ObjectInput |
input |
private Loggable |
op |
private TransactionId |
xactId |
Constructor and Description |
---|
LogRecord() |
Modifier and Type | Method and Description |
---|---|
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.
|
private TransactionId xactId
private Loggable op
private int group
transient java.io.ObjectInput input
private static final int formatLength
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
- error writing to log streampublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
- error reading from log streamjava.lang.ClassNotFoundException
- corrupted log streampublic int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
public void setValue(TransactionId xactId, Loggable op)
public static int formatOverhead()
public static int maxGroupStoredSize()
public static int maxTransactionIdStoredSize(TransactionId tranId)
public static int getStoredSize(int group, TransactionId xactId)
public TransactionId getTransactionId() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public Loggable getLoggable() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public RePreparable getRePreparable() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void skipLoggable() throws StandardException
StandardException
- if the loggable is not found, log is corruptpublic Undoable getUndoable() throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public boolean isCLR()
public boolean isFirst()
public boolean isComplete()
public boolean isPrepare()
public boolean requiresPrepareLocks()
public boolean isCommit()
public boolean isAbort()
public int group()
public boolean isChecksum()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.