Cacheable
, TypedFormat
, Lockable
final class InputStreamContainer extends FileContainer
Modifier and Type | Field | Description |
---|---|---|
private StorageFile |
containerPath |
identity, isCommittedDrop, isDropped, isReusableRecordId
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
Constructor | Description |
---|---|
InputStreamContainer(BaseDataFileFactory factory) |
Modifier and Type | Method | Description |
---|---|---|
protected void |
backupContainer(BaseContainerHandle handle,
java.lang.String backupLocation) |
Backup the container.
|
void |
clean(boolean forRemove) |
Write out the header information for this container.
|
(package private) void |
closeContainer() |
|
(package private) void |
createContainer(ContainerKey newIdentity) |
Create a new container, all references to identity must be through the
passed in identity, this object will no identity until after this method returns.
|
protected void |
encryptOrDecryptContainer(BaseContainerHandle handle,
java.lang.String newFilePath,
boolean doEncrypt) |
Encrypts or decrypts the container.
|
protected void |
flushAll() |
Flush all outstanding changes in this container to persistent storage.
|
protected java.io.InputStream |
getInputStream() |
Get an input stream positioned at the beginning of the file
|
(package private) boolean |
openContainer(ContainerKey newIdentity) |
Open a container.
|
protected int |
preAllocate(long lastPreallocPagenum,
int preAllocSize) |
Preallocate page.
|
protected void |
readPage(long pageNumber,
byte[] pageData) |
Read a page into the supplied array.
|
protected void |
readPositionedPage(long pageOffset,
byte[] pageData) |
Read the page at the positioned offset.
|
protected void |
removeContainer(LogInstant instant,
boolean leaveStub) |
Remove the container.
|
protected void |
truncatePages(long lastValidPagenum) |
|
protected void |
writePage(long pageNumber,
byte[] pageData,
boolean syncPage) |
Write a page from the supplied array.
|
addPage, compressContainer, fillInIdentity, getAllocPage, getAnyPage, getCommittedDropState, getContainerId, getContainerStatus, getDeallocLock, getDroppedState, getFirstPage, getIdentity, getNextPage, getSegmentId, isReusableRecordId, lockAttributes, lockerAlwaysCompatible, lockEvent, removePage, requestCompatible, setCommittedDropState, setDroppedState, setReusableRecordIdState, truncate, unlockEvent, use
getIdentity
bumpContainerVersion, canUpdate, clearIdentity, clearPreallocThreshold, compressContainer, createIdent, createIdentity, deallocatePage, decryptPage, doPreAllocatePages, dropContainer, encryptPage, getAllocPage, getAnyPage, getContainerProperties, getContainerVersion, getContextService, getEmbryonicPage, getEmbryonicPage, getEncryptionBuffer, getEstimatedPageCount, getEstimatedRowCount, getFirstHeadPage, getHeadPage, getLastPageNumber, getLatchedPage, getMinimumRecordSize, getNextHeadPage, getPage, getPageForCompress, getPageForInsert, getPageSize, getReusableRecordIdSequenceNumber, getSpaceInfo, getSpareSpace, getTypeFormatId, incrementReusableRecordIdSequenceNumber, initPage, isDirty, latchPage, letGo, logCreateContainerInfo, newPage, preDirty, prepareForBulkLoad, readHeader, reCreatePageForRedoRecovery, setDirty, setEstimatedRowCount, setIdent, setIdentity, trackUnfilledPage, updateEstimatedRowCount, writeAtOffset, writeHeader, writeHeader
private StorageFile containerPath
InputStreamContainer(BaseDataFileFactory factory)
final boolean openContainer(ContainerKey newIdentity) throws StandardException
FileContainer
Longer descrption of routine.
Open a container. Open the file that maps to this container, if the
file does not exist then we assume the container was never created.
If the file exists but we have trouble opening it then we throw some
exception.
MT - single thread required - Enforced by cache manager.
openContainer
in class FileContainer
StandardException
- Standard exception policy.void closeContainer()
closeContainer
in class FileContainer
public final void clean(boolean forRemove) throws StandardException
StandardException
- Standard Derby error policyCacheable.clean(boolean)
protected final int preAllocate(long lastPreallocPagenum, int preAllocSize)
preAllocate
in class FileContainer
lastPreallocPagenum
- the last preallocated page number as known
by the allocation pagepreAllocSize
- 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.protected void truncatePages(long lastValidPagenum)
truncatePages
in class BaseContainer
void createContainer(ContainerKey newIdentity) throws StandardException
createContainer
in class FileContainer
StandardException
- Derby Standard error policyprotected final void removeContainer(LogInstant instant, boolean leaveStub) throws StandardException
removeContainer
in class BaseContainer
leaveStub
- if true, leave a stub. If false, remove everythingStandardException
- Standard Derby error policyRawContainerHandle.removeContainer(org.apache.derby.iapi.store.raw.log.LogInstant)
protected final void readPage(long pageNumber, byte[] pageData) throws java.io.IOException, StandardException
readPage
in class FileContainer
java.io.IOException
- error reading pageStandardException
- standard Derby error messageprotected void readPositionedPage(long pageOffset, byte[] pageData) throws java.io.IOException
java.io.IOException
protected final void writePage(long pageNumber, byte[] pageData, boolean syncPage) throws java.io.IOException, StandardException
writePage
in class FileContainer
java.io.IOException
- error writing pageStandardException
- Standard Derby error policyprotected final void flushAll()
BaseContainer
flushAll
in class BaseContainer
protected java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
protected void backupContainer(BaseContainerHandle handle, java.lang.String backupLocation) throws StandardException
backupContainer
in class FileContainer
handle
- the container handle.backupLocation
- location of the backup container.StandardException
- Standard Derby error policyprotected void encryptOrDecryptContainer(BaseContainerHandle handle, java.lang.String newFilePath, boolean doEncrypt) throws StandardException
These operations are unsupported for this type of container.
encryptOrDecryptContainer
in class BaseContainer
handle
- the container handlenewFilePath
- file to store the new version of the containerdoEncrypt
- tells whether to encrypt or decryptStandardException
- STORE_FEATURE_NOT_IMPLEMENTEDApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.