Class EncryptContainerOperation
java.lang.Object
org.apache.derby.impl.store.raw.data.EncryptContainerOperation
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
,Loggable
,Undoable
Log operation to encrypt a container with a new encryption key or to encrypt
an unencrypted container while configuring the database for
encryption. Container is synced to the disk when encryption is
is successful, there is nothing to do on a redo. If there is crash/error
while configuring a database for encryption; original version of the
container is put back during undo.
- See Also:
-
Field Summary
FieldsFields 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
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
doMe
(Transaction tran, LogInstant instant, LimitObjectInput in) Containers are not encryped on a redo.generateUndo
(Transaction tran, LimitObjectInput in) Generate a Compensation (EncryptContainerUndoOperation) that will rollback the changes made to the container during container encryption.the default for prepared log is always null for all the operations that don't have optionalData.int
Return my format identifier.int
group()
A space operation is a RAWSTORE log recordboolean
needsRedo
(Transaction xact) Check if this operation needs to be redone during recovery redo.void
void
releaseResource
(Transaction tran) Release any resource that was acquired for doMe for rollback or recovery redo.toString()
debugvoid
undoMe
(Transaction tran) Undo of encrytpion of the container.void
-
Field Details
-
containerId
-
-
Constructor Details
-
EncryptContainerOperation
- Throws:
StandardException
-
EncryptContainerOperation
public EncryptContainerOperation()
-
-
Method Details
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
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. Encrypt Operation has no optional data to write out- Specified by:
getPreparedLog
in interfaceLoggable
-
releaseResource
Description copied from interface:Loggable
Release any resource that was acquired for doMe for rollback or recovery redo. This resource is acquired in either generateUndo (if this is a compensation operation during run time rollback or recovery rollback) or in needsRedo (if this is during recovery redo). The run time transaction context should have all the resource already acquird for run time roll forward, so there is no need to releaseResource during run time roll forward. This method must be safe to be called multiple times.- Specified by:
releaseResource
in interfaceLoggable
-
group
public int group()A space operation is a RAWSTORE log record -
needsRedo
Check if this operation needs to be redone during recovery redo. Returns true if this op should be redone during recovery redo,- Specified by:
needsRedo
in interfaceLoggable
- Parameters:
xact
- the transaction that is doing the rollback- Returns:
- true, if this operation needs to be redone during recovery.
- Throws:
StandardException
- Standard Derby error policy- See Also:
-
getTypeFormatId
public int getTypeFormatId()Return my format identifier.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
-
doMe
public final void doMe(Transaction tran, LogInstant instant, LimitObjectInput in) throws StandardException Containers are not encryped on a redo. Nothing to do in this method.- Specified by:
doMe
in interfaceLoggable
- Parameters:
tran
- transaction doing the operation.instant
- log instant for this operation.in
- unused by this log operation.- Throws:
StandardException
- Standard Derby error policy
-
undoMe
Undo of encrytpion of the container. Original version of the container that existed before the start of the database encryption is put back.- Parameters:
tran
- the transaction that is undoing this operation- Throws:
StandardException
- Standard Derby error policy
-
generateUndo
Generate a Compensation (EncryptContainerUndoOperation) that will rollback the changes made to the container during container encryption.- Specified by:
generateUndo
in interfaceUndoable
- Parameters:
tran
- the transaction doing the compensatingin
- optional input; not used by this operation.- Returns:
- the compensation operation that will rollback this change, or null if nothing to undo.
- Throws:
StandardException
- Standard Derby error policy- See Also:
-
toString
debug
-