Class ChecksumOperation
java.lang.Object
org.apache.derby.impl.store.raw.log.ChecksumOperation
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat, Loggable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Checksumprivate byteprivate longstatic final byteprivate intprivate static final intFields inherited from interface Loggable
ABORT, BI_LOG, CHECKSUM, COMMIT, COMPENSATION, FILE_RESOURCE, FIRST, LAST, PREPARE, RAWSTORE, XA_NEEDLOCK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoMe(Transaction xact, LogInstant instant, LimitObjectInput in) Nothing to do for the checksum log record because it does need to be applied during redo.protected intAccess attributes of the checksum log recordthe default for prepared log is always null for all the operations that don't have optionalData.intintReturn my format identifier.intgroup()Checksum is a raw store operationvoidinit()private voidprotected booleanisChecksumValid(byte[] data, int off, int length) booleanneedsRedo(Transaction xact) Checksum does not need to be redone, it is used to just verify that log records are written completely.voidvoidreleaseResource(Transaction xact) Checksum has no resources to releaseprotected voidreset()toString()DEBUG: Print self.protected voidupdate(byte[] buf, int off, int len) void
-
Field Details
-
checksumAlgo
private byte checksumAlgo -
checksumValue
private long checksumValue -
dataLength
private int dataLength -
checksum
-
CRC32_ALGORITHM
public static final byte CRC32_ALGORITHM- See Also:
-
formatLength
private static final int formatLength
-
-
Constructor Details
-
ChecksumOperation
public ChecksumOperation()
-
-
Method Details
-
init
public void init() -
update
protected void update(byte[] buf, int off, int len) -
reset
protected void reset() -
initializeChecksumAlgo
private void initializeChecksumAlgo() -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
getStoredSize
public int getStoredSize() -
getTypeFormatId
public int getTypeFormatId()Return my format identifier.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
-
doMe
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException Nothing to do for the checksum log record because it does need to be applied during redo.- Specified by:
doMein interfaceLoggable- Parameters:
xact- the Transactioninstant- the log instant of this operationin- optional data- Throws:
StandardException- Standard Derby policy.
-
getPreparedLog
the default for prepared log is always null for all the operations that don't have optionalData. If an operation has optional data, the operation need to prepare the optional data for this method. Checksum has no optional data to write out- Specified by:
getPreparedLogin interfaceLoggable
-
needsRedo
Checksum does not need to be redone, it is used to just verify that log records are written completely. -
releaseResource
Checksum has no resources to release- Specified by:
releaseResourcein interfaceLoggable
-
group
-
getDataLength
protected int getDataLength()Access attributes of the checksum log record -
isChecksumValid
protected boolean isChecksumValid(byte[] data, int off, int length) -
toString
-