Top Description Fields Constructors Methods
org.apache.derby.impl.store.raw.log

public Class CheckpointOperation

extends Object
implements Loggable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.raw.Loggable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Imports
org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.Formatable, .FormatIdUtil, .StoredFormatIds, .CompressedNumber, .LimitObjectInput, org.apache.derby.catalog.UUID, org.apache.derby.iapi.store.raw.Transaction, .Loggable, org.apache.derby.iapi.store.raw.log.LogInstant, .LogFactory, org.apache.derby.iapi.store.raw.xact.RawTransaction, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.util.ByteArray, java.io.Externalizable, .OutputStream, .InputStream, .ObjectInput, .ObjectOutput, .IOException

A Log Operation that represents a checkpoint.
See Also
Loggable

Field Summary

Modifier and TypeField and Description
protected long
protected Formatable
protected long

Constructor Summary

AccessConstructor and Description
public
CheckpointOperation(long redoLWM, long undoLWM, Formatable ttab)

public

Method Summary

Modifier and TypeMethod and Description
public void
doMe(Transaction
the Transaction
xact
,
LogInstant
the log instant of this operation
instant
,
LimitObjectInput
optional data
in
)

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Nothing to do unless we are rollforward recovery; Redoing of checkpoints during rollforward recovery allows us to restart the roll-forward recovery from the last checkpoint redone during rollforward recovery, if we happen to crash during the roll-forward recovery process.

public ByteArray
getPreparedLog()

Implements org.apache.derby.iapi.store.raw.Loggable.getPreparedLog.

the default for prepared log is always null for all the operations that don't have optionalData.

public Formatable
public int
public int
group()

Implements org.apache.derby.iapi.store.raw.Loggable.group.

Checkpoint is a raw store operation

public boolean
needsRedo(Transaction
The transaction trying to redo this operation
xact
)

Implements org.apache.derby.iapi.store.raw.Loggable.needsRedo.

Checkpoint does not need to be redone unless we are doing rollforward recovery.

public void
readExternal(ObjectInput
the stream to read data from in order to restore the object
in
)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public long
redoLWM()

Access attributes of the checkpoint record

public void
releaseResource(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

Checkpoint has not resource to release

public String
toString()

Overrides java.lang.Object.toString.

DEBUG: Print self.

public long
public void
writeExternal(ObjectOutput
the stream to write the object to
out
)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

redoLWMback to summary
protected long redoLWM
transactionTableback to summary
protected Formatable transactionTable
undoLWMback to summary
protected long undoLWM

Constructor Detail

CheckpointOperationback to summary
public CheckpointOperation(long redoLWM, long undoLWM, Formatable ttab)
CheckpointOperationback to summary
public CheckpointOperation()

Method Detail

doMeback to summary
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException

Implements org.apache.derby.iapi.store.raw.Loggable.doMe.

Nothing to do unless we are rollforward recovery; Redoing of checkpoints during rollforward recovery allows us to restart the roll-forward recovery from the last checkpoint redone during rollforward recovery, if we happen to crash during the roll-forward recovery process. Another reason why we need to do this is dropped table stub files removed at checkpoint because the containerids may have been reused after a checkpoint if the system was rebooted.

Parameters
xact:Transaction

Doc from org.apache.derby.iapi.store.raw.Loggable.doMe.

the Transaction

instant:LogInstant

Doc from org.apache.derby.iapi.store.raw.Loggable.doMe.

the log instant of this operation

in:LimitObjectInput

Doc from org.apache.derby.iapi.store.raw.Loggable.doMe.

optional data

Exceptions
StandardException:

Doc from org.apache.derby.iapi.store.raw.Loggable.doMe.

Standard Derby policy.

getPreparedLogback to summary
public ByteArray getPreparedLog()

Implements org.apache.derby.iapi.store.raw.Loggable.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. Checkpoint has no optional data to write out

getTransactionTableback to summary
public Formatable getTransactionTable()
getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Return my format identifier.

Returns:int

Doc from org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

The identifier. (A UUID stuffed in an array of 16 bytes).

groupback to summary
public int group()

Implements org.apache.derby.iapi.store.raw.Loggable.group.

Checkpoint is a raw store operation

needsRedoback to summary
public boolean needsRedo(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.needsRedo.

Checkpoint does not need to be redone unless we are doing rollforward recovery.

Parameters
xact:Transaction

Doc from org.apache.derby.iapi.store.raw.Loggable.needsRedo.

The transaction trying to redo this operation

Returns:boolean

Doc from org.apache.derby.iapi.store.raw.Loggable.needsRedo.

true if operation needs redoing, false if not.

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Parameters
in:ObjectInput

the stream to read data from in order to restore the object

Exceptions
IOException:
if I/O errors occur
ClassNotFoundException:
If the class for an object being restored cannot be found.
redoLWMback to summary
public long redoLWM()

Access attributes of the checkpoint record

releaseResourceback to summary
public void releaseResource(Transaction xact)

Implements org.apache.derby.iapi.store.raw.Loggable.releaseResource.

Checkpoint has not resource to release

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

DEBUG: Print self.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

undoLWMback to summary
public long undoLWM()
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Parameters
out:ObjectOutput

the stream to write the object to

Exceptions
IOException:
Includes any I/O exceptions that may occur