public class ChecksumOperation extends java.lang.Object implements Loggable
Loggable,
Serialized Form| Format 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 |
| Modifier and Type | Field and Description |
|---|---|
private java.util.zip.Checksum |
checksum |
private byte |
checksumAlgo |
private long |
checksumValue |
static byte |
CRC32_ALGORITHM |
private int |
dataLength |
private static int |
formatLength |
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK| Constructor and Description |
|---|
ChecksumOperation() |
| Modifier and Type | Method and Description |
|---|---|
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) |
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
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.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic int getStoredSize()
public int getTypeFormatId()
getTypeFormatId in interface TypedFormatpublic void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException
doMe in interface Loggablexact - the Transactioninstant - the log instant of this operationin - optional dataStandardException - Standard Derby policy.public ByteArray getPreparedLog()
getPreparedLog in interface Loggablepublic boolean needsRedo(Transaction xact)
needsRedo in interface Loggablexact - The transaction trying to redo this operationLoggable.releaseResource(org.apache.derby.iapi.store.raw.Transaction)public void releaseResource(Transaction xact)
releaseResource in interface Loggablepublic int group()
protected int getDataLength()
protected boolean isChecksumValid(byte[] data,
int off,
int length)
public java.lang.String toString()
toString in class java.lang.ObjectApache Derby V10.10 Internals - Copyright © 2004,2014 The Apache Software Foundation. All Rights Reserved.