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

pack-priv Class TempRAFContainer

extends RAFContainer
Class Inheritance
Imports
org.apache.derby.impl.store.raw.data.BaseContainerHandle, .BasePage, org.apache.derby.iapi.services.cache.Cacheable, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.raw.xact.RawTransaction, org.apache.derby.iapi.store.raw.ContainerHandle, .ContainerKey, .Page, org.apache.derby.iapi.store.raw.log.LogInstant, org.apache.derby.iapi.store.raw.data.RawContainerHandle, org.apache.derby.io.StorageFactory, .StorageFile, java.io.IOException

needsSync is never true - DONE An exception never marks the store as corrupt clean() does not stubbify preAllocate() does nothing - DONE getFileName() returns a file in the tmp directory - DONE flushAll does nothing - DONE file descriptor is never synced

Field Summary

Modifier and TypeField and Description
protected int
Inherited from org.apache.derby.impl.store.raw.data.RAFContainer:
fileDataneedsSync

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Page
addPage(BaseContainerHandle handle, boolean isOverflow)

Overrides org.apache.derby.impl.store.raw.data.BaseContainer.addPage.

Add a page without locking the container, only one user will be accessing this table at a time.

public Cacheable
createIdentity(Object
The handle on the cacheable
key
,
Object
Creation details
createParameter
)

Overrides org.apache.derby.impl.store.raw.data.FileContainer.createIdentity.

Implements org.apache.derby.iapi.services.cache.Cacheable.createIdentity.

Create a new item.

pack-priv StorageFile
getFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.getFileName.

public boolean
isSingleUser()

Returns true if only a single handle is connected to this container.

protected void
letGo(BaseContainerHandle handle)

Overrides org.apache.derby.impl.store.raw.data.FileContainer.letGo.

Discontinue use of this container.

protected int
preAllocate(long
the last preallocated page number as known by the allocation page
lastPreallocPagenum
,
int
try to preallocate this page number of pages. Since only the container knows how many pages are actually on disk, it may determine that certain number of pages that the allocation page thinks need to be preallocated is already allocated, in those case, act as if the preallocation is successful.
preAllocSize
)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.preAllocate.

Preallocate page.

protected StorageFile
privGetFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.privGetFileName.

public void
removeContainer(LogInstant instant, boolean
if true, leave a stub. If false, remove everything
leaveStub
)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.removeContainer.

Remove the container

public Cacheable
public void
protected boolean

Returns:

true if the container can be used, false if it has been dropped since the lock was requested and droppedOK is not true.
use
(BaseContainerHandle handle, boolean forUpdate, boolean
if true, use this container even if it is dropped.,
droppedOK
)

Overrides org.apache.derby.impl.store.raw.data.BaseContainer.use.

Lock the container and mark the container as in-use by this container handle.

protected void
writePage(long pageNumber, byte[] pageData, boolean syncPage)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.writePage.

Write the page, if it's within range of the current page range of the container.

Inherited from org.apache.derby.impl.store.raw.data.RAFContainer:
backupContainercleancloseContainercreateContainerencryptOrDecryptContainerflushAllgetRandomAccessFileisDirtyopenContainerreadPageremoveFilereopenContainerruntruncatePagesupdatePageArray

Field Detail

inUseCountback to summary
protected int inUseCount

Constructor Detail

TempRAFContainerback to summary
pack-priv TempRAFContainer(BaseDataFileFactory factory)

Method Detail

addPageback to summary
public Page addPage(BaseContainerHandle handle, boolean isOverflow) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.BaseContainer.addPage.

Add a page without locking the container, only one user will be accessing this table at a time.

Exceptions
StandardException:
Standard Derby error policy
createIdentityback to summary
public Cacheable createIdentity(Object key, Object createParameter) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.FileContainer.createIdentity.

Implements org.apache.derby.iapi.services.cache.Cacheable.createIdentity.

Doc from org.apache.derby.iapi.services.cache.Cacheable.createIdentity.

Create a new item.

Create a new item and set the identity of the object to represent it. The object will be in the No Identity state, ie. it will have just been created or clearIdentity() was just called.
The object must copy the information out of key, not just store a reference to key if the key is not immutable. After this call the expression getIdentity().equals(key) must return true.

If the class of the object needs to change (e.g. to support a different format) then the object should create a new object, call its initParameter() with the parameters the original object was called with, set its identity and return a reference to it. The cache manager will discard the reference to the old object.
If an exception is thrown the object must be left in the no-identity state.
MT - single thread required - Method must only be called be cache manager and the cache manager will guarantee only one thread can be calling it.

Parameters
key:Object

The handle on the cacheable

createParameter:Object

Creation details

Returns:Cacheable

an object reference if the object can take on the identity, null otherwise.

Exceptions
StandardException:
Standard Derby error policy
getFileNameback to summary
pack-priv StorageFile getFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.getFileName.

isSingleUserback to summary
public boolean isSingleUser()

Returns true if only a single handle is connected to this container.

letGoback to summary
protected void letGo(BaseContainerHandle handle)

Overrides org.apache.derby.impl.store.raw.data.FileContainer.letGo.

Discontinue use of this container. Note that the unlockContainer call made from this method may not release any locks. The container lock may be held until the end of the transaction.

preAllocateback to summary
protected int preAllocate(long lastPreallocPagenum, int preAllocSize)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.preAllocate.

Preallocate page. Since we don't sync when we write page anyway, no need to preallocate page.

Parameters
lastPreallocPagenum:long

Doc from org.apache.derby.impl.store.raw.data.FileContainer.preAllocate.

the last preallocated page number as known by the allocation page

preAllocSize:int

Doc from org.apache.derby.impl.store.raw.data.FileContainer.preAllocate.

try to preallocate this page number of pages. Since only the container knows how many pages are actually on disk, it may determine that certain number of pages that the allocation page thinks need to be preallocated is already allocated, in those case, act as if the preallocation is successful.

Returns:int

Doc from org.apache.derby.impl.store.raw.data.FileContainer.preAllocate.

number of successfully preallocated page, or 0 if no page has been preallocated

privGetFileNameback to summary
protected StorageFile privGetFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.privGetFileName.

removeContainerback to summary
public void removeContainer(LogInstant instant, boolean leaveStub) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.removeContainer.

Doc from org.apache.derby.impl.store.raw.data.RAFContainer.removeContainer.

Remove the container

Parameters
leaveStub:boolean

Doc from org.apache.derby.impl.store.raw.data.BaseContainer.removeContainer.

if true, leave a stub. If false, remove everything

Exceptions
StandardException:
Standard Derby error policy
setIdentityback to summary
public Cacheable setIdentity(Object key) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.FileContainer.setIdentity.

Implements org.apache.derby.iapi.services.cache.Cacheable.setIdentity.

Doc from org.apache.derby.impl.store.raw.data.FileContainer.setIdentity.

Open the container.

Parameters
key:Object

Doc from org.apache.derby.iapi.services.cache.Cacheable.setIdentity.

The handle on the cacheable

Returns:Cacheable

a valid object if the container was successfully opened, null if it does not exist.

Exceptions
StandardException:
Standard Derby error policy
truncateback to summary
public void truncate(BaseContainerHandle handle) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.BaseContainer.truncate.

Exceptions
StandardException:
Standard Derby error policy
useback to summary
protected boolean use(BaseContainerHandle handle, boolean forUpdate, boolean droppedOK) throws StandardException

Overrides org.apache.derby.impl.store.raw.data.BaseContainer.use.

Lock the container and mark the container as in-use by this container handle.

Parameters
droppedOK:boolean

if true, use this container even if it is dropped.,

Returns:boolean

true if the container can be used, false if it has been dropped since the lock was requested and droppedOK is not true.

Exceptions
StandardException:
I cannot be opened for update.
writePageback to summary
protected void writePage(long pageNumber, byte[] pageData, boolean syncPage) throws IOException, StandardException

Overrides org.apache.derby.impl.store.raw.data.RAFContainer.writePage.

Write the page, if it's within range of the current page range of the container. If we do write it then don't request that it be synced.

Exceptions
IOException:

Doc from org.apache.derby.impl.store.raw.data.RAFContainer.writePage.

IO error accessing page

StandardException:
Standard Derby error policy