Top Fields Constructors Methods
org.apache.derby.impl.store.raw.data

public Class DirectActions

extends Object
implements PageActions
Class Inheritance
All Implemented Interfaces
org.apache.derby.impl.store.raw.data.PageActions
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.io.ArrayInputStream, .FormatableBitSet, .DynamicByteArrayOutputStream, .DynamicByteArrayOutputStream, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.conglomerate.LogicalUndo, org.apache.derby.iapi.store.raw.Page, .RecordHandle, org.apache.derby.iapi.store.raw.xact.RawTransaction, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.iapi.types.DataValueDescriptor, java.io.ByteArrayOutputStream, .IOException

Field Summary

Modifier and TypeField and Description
protected ArrayInputStream
protected DynamicByteArrayOutputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
actionCopyRows(RawTransaction
The transaction
t
,
BasePage
the destination page
destPage
,
BasePage
the source page
srcPage
,
int
starting slot # of destination page to copy to
destSlot
,
int
the number of rows to be copied
numRows
,
int
starting slot number of source page to copy from
srcSlot
,
int[]
an array of record ids to use in the destination page
recordIds
)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionCopyRows.

Copy num_rows from srcPage into deestpage.

public void
actionDelete(RawTransaction
The transaction
t
,
BasePage
the target page
page
,
int
the slot number of the record
slot
,
int
the recordID of the record
recordId
,
boolean
set the delete status to this value
delete
,
LogicalUndo
logical undo logic if necessary
undo
)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionDelete.

Set the Delete status of the record at the given slot.

public void
actionInitPage(RawTransaction
The transaction
t
,
BasePage
that page to be initialized
page
,
int
flags set to values in BasePage.INIT_PAGE_* which indicates how the new page is to be initialized.
initFlag
,
int
The format Id of the page being initialized.
pageFormatId
,
long pageOffset)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInitPage.

Initialize the page due to allocation.

public int
actionInsert(RawTransaction
The transaction
t
,
BasePage page, int
the slot number of the record
slot
,
int
the recordID of the record
recordId
,
Object[]
The storable row
row
,
FormatableBitSet validColumns, LogicalUndo
if logical undo may be necessary, a function pointer to the access code where the logical undo logic resides. Null if logical undo is not necessary.
undo
,
byte
see Page value for insertFlag
insertFlag
,
int startColumn, boolean isLongColumn, int realStartColumn, DynamicByteArrayOutputStream logBuffer, int realSpaceOnPage, int overflowThreshold)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInsert.

Insert record at the given slot with this recordId.

public void
actionInvalidatePage(RawTransaction
The transaction
t
,
BasePage
that page to be invalidated
page
)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInvalidatePage.

Invalidate the page due to deallocation.

public void
actionPurge(RawTransaction
The transaction
t
,
BasePage page, int
the starting slot number of the record
slot
,
int
how many rows to purge
num_rows
,
int[]
the recordIDs of the record (an array of num_rows)
recordIds
,
boolean needDataLogged)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionPurge.

Purge the record at the given slot.

public void
actionShrinkReservedSpace(RawTransaction
The transaction
t
,
BasePage
that page to be initialized
page
,
int
the slot number of the record
slot
,
int
the recordID of the record
recordId
,
int
the new reserved space value
newValue
,
int oldValue)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionShrinkReservedSpace.

Shrink the reserved space to the new value.

public int
actionUpdate(RawTransaction
The transaction
t
,
BasePage
the updated page
page
,
int
the slot number of the record
slot
,
int
the recordID of the record
recordId
,
Object[]
The new storable row
row
,
FormatableBitSet
the columns that needs to be updated
validColumns
,
int
the first column that is updated
realStartColumn
,
DynamicByteArrayOutputStream
where to prepare the log record
logBuffer
,
int
??
realSpaceOnPage
,
RecordHandle
the record handle of the head row
headRowHandle
)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionUpdate.

Update record at the given slot with this row.

public void
actionUpdateField(RawTransaction
The transaction
t
,
BasePage page, int
the slot number of the record
slot
,
int
the recordID of the record
recordId
,
int
the fieldId of the value
fieldId
,
Object
the new value for the field
newValue
,
LogicalUndo
if logical undo may be necessary, a function pointer to the access code where the logical undo logic resides. Null if logical undo is not necessary.
undo
)

Implements org.apache.derby.impl.store.raw.data.PageActions.actionUpdateField.

Update a field of the record at the given slot with this value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

limitInback to summary
protected ArrayInputStream limitIn
outBytesback to summary
protected DynamicByteArrayOutputStream outBytes

Constructor Detail

DirectActionsback to summary
public DirectActions()

Method Detail

actionCopyRowsback to summary
public void actionCopyRows(RawTransaction t, BasePage destPage, BasePage srcPage, int destSlot, int numRows, int srcSlot, int[] recordIds) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionCopyRows.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionCopyRows.

Copy num_rows from srcPage into deestpage.

Longer descrption of routine.

Parameters
t:RawTransaction

The transaction

destPage:BasePage

the destination page

srcPage:BasePage

the source page

destSlot:int

starting slot # of destination page to copy to

numRows:int

the number of rows to be copied

srcSlot:int

starting slot number of source page to copy from

recordIds:int[]

an array of record ids to use in the destination page

Exceptions
StandardException:
Standard Derby policy.
actionDeleteback to summary
public void actionDelete(RawTransaction t, BasePage page, int slot, int recordId, boolean delete, LogicalUndo undo) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionDelete.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionDelete.

Set the Delete status of the record at the given slot.

Subclass that implements this method has to call BasePage.setDeleteStatus to update the delete status on the in-memory slot table.


MT - latched, page is latched when this methods is called.

Parameters
t:RawTransaction

The transaction

page:BasePage

the target page

slot:int

the slot number of the record

recordId:int

the recordID of the record

delete:boolean

set the delete status to this value

undo:LogicalUndo

logical undo logic if necessary

Exceptions
StandardException:
Standard Derby error policy
actionInitPageback to summary
public void actionInitPage(RawTransaction t, BasePage page, int initFlag, int pageFormatId, long pageOffset) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInitPage.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionInitPage.

Initialize the page due to allocation.

Initialize the page due to allocation - this page could be brand new or it could be being re-allocated.

Parameters
t:RawTransaction

The transaction

page:BasePage

that page to be initialized

initFlag:int

flags set to values in BasePage.INIT_PAGE_* which indicates how the new page is to be initialized.

pageFormatId:int

The format Id of the page being initialized.

Exceptions
StandardException:
Standard Derby policy.
actionInsertback to summary
public int actionInsert(RawTransaction t, BasePage page, int slot, int recordId, Object[] row, FormatableBitSet validColumns, LogicalUndo undo, byte insertFlag, int startColumn, boolean isLongColumn, int realStartColumn, DynamicByteArrayOutputStream logBuffer, int realSpaceOnPage, int overflowThreshold) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInsert.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionInsert.

Insert record at the given slot with this recordId.


MT - latched, page is latched when this methods is called.

Parameters
t:RawTransaction

The transaction

slot:int

the slot number of the record

recordId:int

the recordID of the record

row:Object[]

The storable row

undo:LogicalUndo

if logical undo may be necessary, a function pointer to the access code where the logical undo logic resides. Null if logical undo is not necessary.

insertFlag:byte

see Page value for insertFlag

Exceptions
StandardException:
Standard Derby error policy
actionInvalidatePageback to summary
public void actionInvalidatePage(RawTransaction t, BasePage page) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionInvalidatePage.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionInvalidatePage.

Invalidate the page due to deallocation. Short one line description of routine.

Invalidate the page due to deallocation - this is the action on the page that is being deallocated as opposed to the action on the allocation page.

Parameters
t:RawTransaction

The transaction

page:BasePage

that page to be invalidated

Exceptions
StandardException:
Standard Derby policy.
actionPurgeback to summary
public void actionPurge(RawTransaction t, BasePage page, int slot, int num_rows, int[] recordIds, boolean needDataLogged) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionPurge.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionPurge.

Purge the record at the given slot.

Subclass that implements this method has to remove the slot from the base page in-memory slot table (removeAndShiftDown).


MT - latched, page is latched when this methods is called.

Parameters
t:RawTransaction

The transaction

slot:int

the starting slot number of the record

num_rows:int

how many rows to purge

recordIds:int[]

the recordIDs of the record (an array of num_rows)

Exceptions
StandardException:
Standard Derby error policy
actionShrinkReservedSpaceback to summary
public void actionShrinkReservedSpace(RawTransaction t, BasePage page, int slot, int recordId, int newValue, int oldValue) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionShrinkReservedSpace.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionShrinkReservedSpace.

Shrink the reserved space to the new value.

Shrink the reserved space to the new value. This action is not undoable.

Parameters
t:RawTransaction

The transaction

page:BasePage

that page to be initialized

slot:int

the slot number of the record

recordId:int

the recordID of the record

newValue:int

the new reserved space value

Exceptions
StandardException:
Unexpected exception from the implementation
actionUpdateback to summary
public int actionUpdate(RawTransaction t, BasePage page, int slot, int recordId, Object[] row, FormatableBitSet validColumns, int realStartColumn, DynamicByteArrayOutputStream logBuffer, int realSpaceOnPage, RecordHandle headRowHandle) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionUpdate.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionUpdate.

Update record at the given slot with this row.


MT - latched, page is latched when this methods is called.

Parameters
t:RawTransaction

The transaction

page:BasePage

the updated page

slot:int

the slot number of the record

recordId:int

the recordID of the record

row:Object[]

The new storable row

validColumns:FormatableBitSet

the columns that needs to be updated

realStartColumn:int

the first column that is updated

logBuffer:DynamicByteArrayOutputStream

where to prepare the log record

realSpaceOnPage:int

??

headRowHandle:RecordHandle

the record handle of the head row

Returns:int

the next column to update in the row or, -1 if the update has been completed.

Exceptions
StandardException:
Standard Derby error policy
actionUpdateFieldback to summary
public void actionUpdateField(RawTransaction t, BasePage page, int slot, int recordId, int fieldId, Object newValue, LogicalUndo undo) throws StandardException

Implements org.apache.derby.impl.store.raw.data.PageActions.actionUpdateField.

Doc from org.apache.derby.impl.store.raw.data.PageActions.actionUpdateField.

Update a field of the record at the given slot with this value.


MT - latched, page is latched when this methods is called.

Parameters
t:RawTransaction

The transaction

slot:int

the slot number of the record

recordId:int

the recordID of the record

fieldId:int

the fieldId of the value

newValue:Object

the new value for the field

undo:LogicalUndo

if logical undo may be necessary, a function pointer to the access code where the logical undo logic resides. Null if logical undo is not necessary.

Exceptions
StandardException:
Standard Derby error policy