|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.store.raw.log.ChecksumOperation
public class ChecksumOperation
A Log Operation that represents a checksum for a group of log records that are written to the tranaction log file.
Loggable
,
Serialized FormFormat ID | LOGOP_CHECKSUM the formatId is written by FormatIdOutputStream when this object is written out by writeObject |
Purpose | checksum one or more log records while writing to disk |
Upgrade | |
Disk Layout | checksumAlgo(byte) the checksum algorithm checksumValue(long) the checksum value dataLength(int) number of bytes that the checksum is calculated |
Field Summary | |
---|---|
private java.util.zip.Checksum |
checksum
|
private byte |
checksumAlgo
|
private long |
checksumValue
|
static byte |
CRC32_ALGORITHM
|
private int |
dataLength
|
private static int |
formatLength
|
Fields inherited from interface org.apache.derby.iapi.store.raw.Loggable |
---|
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK |
Constructor Summary | |
---|---|
ChecksumOperation()
|
Method Summary | |
---|---|
void |
doMe(Transaction xact,
LogInstant instant,
LimitObjectInput in)
Nothing to do for the checksum log record because it does need to be applied during redo. |
protected int |
getDataLength()
Access attributes of the checksum log record |
ByteArray |
getPreparedLog()
the default for prepared log is always null for all the operations that don't have optionalData. |
int |
getStoredSize()
|
int |
getTypeFormatId()
Return my format identifier. |
int |
group()
Checksum is a raw store operation |
void |
init()
|
private void |
initializeChecksumAlgo()
|
protected boolean |
isChecksumValid(byte[] data,
int off,
int length)
|
boolean |
needsRedo(Transaction xact)
Checksum does not need to be redone, it is used to just verify that log records are written completely. |
void |
readExternal(java.io.ObjectInput in)
|
void |
releaseResource(Transaction xact)
Checksum has no resources to release |
protected void |
reset()
|
java.lang.String |
toString()
DEBUG: Print self. |
protected void |
update(byte[] buf,
int off,
int len)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private byte checksumAlgo
private long checksumValue
private int dataLength
private java.util.zip.Checksum checksum
public static final byte CRC32_ALGORITHM
private static final int formatLength
Constructor Detail |
---|
public ChecksumOperation()
Method Detail |
---|
public void init()
protected void update(byte[] buf, int off, int len)
protected void reset()
private void initializeChecksumAlgo()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public int getStoredSize()
public int getTypeFormatId()
getTypeFormatId
in interface TypedFormat
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException
doMe
in interface Loggable
xact
- the Transactioninstant
- the log instant of this operationin
- optional data
StandardException
- Standard Derby policy.public ByteArray getPreparedLog()
getPreparedLog
in interface Loggable
public boolean needsRedo(Transaction xact)
needsRedo
in interface Loggable
xact
- The transaction trying to redo this operation
Loggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)
public void releaseResource(Transaction xact)
releaseResource
in interface Loggable
public int group()
group
in interface Loggable
protected int getDataLength()
protected boolean isChecksumValid(byte[] data, int off, int length)
public java.lang.String toString()
toString
in class java.lang.Object
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |