org.apache.derby.impl.store.raw.data
Class TempRAFContainer

java.lang.Object
  extended byorg.apache.derby.impl.store.raw.data.BaseContainer
      extended byorg.apache.derby.impl.store.raw.data.FileContainer
          extended byorg.apache.derby.impl.store.raw.data.RAFContainer
              extended byorg.apache.derby.impl.store.raw.data.TempRAFContainer
All Implemented Interfaces:
Cacheable, Lockable, java.security.PrivilegedExceptionAction, TypedFormat

class TempRAFContainer
extends RAFContainer

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
protected  int inUseCount
           
 
Fields inherited from class org.apache.derby.impl.store.raw.data.RAFContainer
fileData, needsSync
 
Fields inherited from class org.apache.derby.impl.store.raw.data.FileContainer
ALLOC_PAGE_ARG_NUM, allocCache, canUpdate, CHECKSUM_SIZE, CONTAINER_INFO_SIZE, containerCache, containerInfo, containerVersion, dataFactory, estimatedRowCount, FIRST_ALLOC_PAGE_NUMBER, FIRST_ALLOC_PAGE_OFFSET, firstAllocPageNumber, firstAllocPageOffset, formatIdInteger, initialPages, isDirty, lastLogInstant, minimumRecordSize, pageCache, pageSize, preDirty, SPACE_TRACE, spareSpace, STORED_PAGE_ARG_NUM
 
Fields inherited from class org.apache.derby.impl.store.raw.data.BaseContainer
identity, isCommittedDrop, isDropped, isReusableRecordId
 
Constructor Summary
(package private) TempRAFContainer(BaseDataFileFactory factory)
           
 
Method Summary
 Page addPage(BaseContainerHandle handle, boolean isOverflow)
          Add a page without locking the container, only one user will be accessing this table at a time.
 Cacheable createIdentity(java.lang.Object key, java.lang.Object createParameter)
          Create a new item.
protected  StorageFile getFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)
           
 boolean isSingleUser()
          Returns true if only a single handle is connected to this container.
protected  void letGo(BaseContainerHandle handle)
          Discontinue use of this container.
protected  int preAllocate(long lastPreallocPagenum, int preAllocSize)
          Preallocate page.
protected  StorageFile privGetFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)
           
 void removeContainer(LogInstant instant, boolean leaveStub)
          Remove the container
 Cacheable setIdentity(java.lang.Object key)
          Set container's identity
 void truncate(BaseContainerHandle handle)
           
protected  boolean use(BaseContainerHandle handle, boolean forUpdate, boolean droppedOK)
          Lock the container and mark the container as in-use by this container handle.
protected  void writePage(long pageNumber, byte[] pageData, boolean syncPage)
          Write the page, if it's within range of the current page range of the container.
 
Methods inherited from class org.apache.derby.impl.store.raw.data.RAFContainer
clean, closeContainer, createContainer, flushAll, isDirty, openContainer, readPage, removeFile, run, stubbify, truncatePages
 
Methods inherited from class org.apache.derby.impl.store.raw.data.FileContainer
bumpContainerVersion, canUpdate, clearIdentity, clearPreallocThreshold, compressContainer, createIdent, deallocatePage, decryptPage, doPreAllocatePages, dropContainer, encryptPage, getAllocPage, getAnyPage, getContainerProperties, getContainerVersion, getEmbryonicPage, getEstimatedPageCount, getEstimatedRowCount, getFirstHeadPage, getHeadPage, getMinimumRecordSize, getNextHeadPage, getPage, getPageForCompress, getPageForInsert, getPageSize, getSpaceInfo, getSpareSpace, getTypeFormatId, initPage, latchPage, logCreateContainerInfo, newPage, preDirty, prepareForBulkLoad, readHeader, reCreatePageForLoadTran, setDirty, setEstimatedRowCount, setIdent, trackUnfilledPage, updateEstimatedRowCount, writeHeader, writeHeader
 
Methods inherited from class org.apache.derby.impl.store.raw.data.BaseContainer
compressContainer, fillInIdentity, getAllocPage, getAnyPage, getCommittedDropState, getContainerId, getContainerStatus, getDeallocLock, getDroppedState, getFirstPage, getIdentity, getNextPage, getSegmentId, isReusableRecordId, lockAttributes, lockerAlwaysCompatible, lockEvent, removePage, requestCompatible, setCommittedDropState, setDroppedState, setReusableRecordIdState, unlockEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.services.cache.Cacheable
getIdentity
 

Field Detail

inUseCount

protected int inUseCount
Constructor Detail

TempRAFContainer

TempRAFContainer(BaseDataFileFactory factory)
Method Detail

setIdentity

public Cacheable setIdentity(java.lang.Object key)
                      throws StandardException
Description copied from class: RAFContainer
Set container's identity

Specified by:
setIdentity in interface Cacheable
Overrides:
setIdentity in class RAFContainer
Throws:
StandardException - Standard Cloudscape error policy

createIdentity

public Cacheable createIdentity(java.lang.Object key,
                                java.lang.Object createParameter)
                         throws StandardException
Description copied from interface: Cacheable
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.

Specified by:
createIdentity in interface Cacheable
Overrides:
createIdentity in class RAFContainer
Throws:
StandardException - Standard Cloudscape error policy

removeContainer

public void removeContainer(LogInstant instant,
                            boolean leaveStub)
                     throws StandardException
Description copied from class: RAFContainer
Remove the container

Overrides:
removeContainer in class RAFContainer
Throws:
StandardException - Standard Cloudscape error policy

preAllocate

protected int preAllocate(long lastPreallocPagenum,
                          int preAllocSize)
Preallocate page. Since we don't sync when we write page anyway, no need to preallocate page.

Overrides:
preAllocate in class RAFContainer

writePage

protected void writePage(long pageNumber,
                         byte[] pageData,
                         boolean syncPage)
                  throws java.io.IOException,
                         StandardException
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.

Overrides:
writePage in class RAFContainer
Throws:
StandardException - Standard Cloudscape error policy
java.io.IOException - IO error accessing page

getFileName

protected StorageFile getFileName(ContainerKey identity,
                                  boolean stub,
                                  boolean errorOK,
                                  boolean tryAlternatePath)
Overrides:
getFileName in class RAFContainer

privGetFileName

protected StorageFile privGetFileName(ContainerKey identity,
                                      boolean stub,
                                      boolean errorOK,
                                      boolean tryAlternatePath)
Overrides:
privGetFileName in class RAFContainer

addPage

public Page addPage(BaseContainerHandle handle,
                    boolean isOverflow)
             throws StandardException
Add a page without locking the container, only one user will be accessing this table at a time.

Overrides:
addPage in class BaseContainer
Throws:
StandardException - Standard Cloudscape error policy

truncate

public void truncate(BaseContainerHandle handle)
              throws StandardException
Overrides:
truncate in class BaseContainer
Throws:
StandardException - Standard Cloudscape error policy

use

protected boolean use(BaseContainerHandle handle,
                      boolean forUpdate,
                      boolean droppedOK)
               throws StandardException
Lock the container and mark the container as in-use by this container handle.

Overrides:
use in class BaseContainer
Parameters:
droppedOK - if true, use this container even if it is dropped.,
Returns:
true if the container can be used, false if it has been dropped since the lock was requested and droppedOK is not true.
Throws:
StandardException - I cannot be opened for update.

letGo

protected void letGo(BaseContainerHandle handle)
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.

Overrides:
letGo in class FileContainer

isSingleUser

public boolean isSingleUser()
Returns true if only a single handle is connected to this container.


Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.