Java Doc for RAFContainer.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » raw » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.store.raw.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.store.raw.data.BaseContainer
      org.apache.derby.impl.store.raw.data.FileContainer
         org.apache.derby.impl.store.raw.data.RAFContainer

All known Subclasses:   org.apache.derby.impl.store.raw.data.TempRAFContainer,
RAFContainer
class RAFContainer extends FileContainer implements PrivilegedExceptionAction(Code)
RAFContainer (short for RandomAccessFileContainer) is a concrete subclass of FileContainer for FileContainers which are implemented on java.io.RandomAccessFile.


Field Summary
protected  StorageRandomAccessFilefileData
    
protected  booleanneedsSync
    

Constructor Summary
 RAFContainer(BaseDataFileFactory factory)
    

Method Summary
protected  voidbackupContainer(BaseContainerHandle handle, String backupLocation)
     Backup the container.
Parameters:
  handle - the container handle.
Parameters:
  backupLocation - location of the backup container.
public  voidclean(boolean forRemove)
     Clean the container.

Write out the container header and sync all dirty pages of this container to disk before returning.

checkpoint calls this interface through callbacks by telling the cache manager to clean all containers in the open container cache.

final  voidcloseContainer()
    
synchronized  voidcreateContainer(ContainerKey newIdentity)
    
public  CacheablecreateIdentity(Object key, Object createParameter)
    
protected  voidencryptContainer(BaseContainerHandle handle, String newFilePath)
     Create encrypted version of the container with the user specified encryption properties.
protected  voidflushAll()
    
synchronized  StorageFilegetFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)
    
public synchronized  booleanisDirty()
    
synchronized  booleanopenContainer(ContainerKey newIdentity)
    
protected  intpreAllocate(long lastPreallocPagenum, int preAllocSize)
    
protected  StorageFileprivGetFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath)
    
synchronized  StorageRandomAccessFileprivGetRandomAccessFile(StorageFile file)
    
protected  voidreadPage(long pageNumber, byte[] pageData)
     Read a page into the supplied array.
protected  voidremoveContainer(LogInstant instant, boolean leaveStub)
    
synchronized  booleanremoveFile(StorageFile file)
    
public  Objectrun()
    
public  CacheablesetIdentity(Object key)
    
protected  voidtruncatePages(long lastValidPagenum)
     Truncate pages of a container.

Truncate all pages from lastValidPagenum+1 through the end of the file.


Parameters:
  lastValidPagenum - The page number of the last valid page of thefile.

protected  voidwritePage(long pageNumber, byte[] pageData, boolean syncPage)
     Write a page from the supplied array.

Field Detail
fileData
protected StorageRandomAccessFile fileData(Code)



needsSync
protected boolean needsSync(Code)




Constructor Detail
RAFContainer
RAFContainer(BaseDataFileFactory factory)(Code)




Method Detail
backupContainer
protected void backupContainer(BaseContainerHandle handle, String backupLocation) throws StandardException(Code)
Backup the container.
Parameters:
  handle - the container handle.
Parameters:
  backupLocation - location of the backup container.
exception:
  StandardException - Standard Derby error policy



clean
public void clean(boolean forRemove) throws StandardException(Code)
Clean the container.

Write out the container header and sync all dirty pages of this container to disk before returning.

checkpoint calls this interface through callbacks by telling the cache manager to clean all containers in the open container cache. This sync of the file happens as part of writing and then syncing the container header in writeRAFHeader().


Parameters:
  forRemove - Is clean called because container is being removed?
exception:
  StandardException - Standard exception policy.




closeContainer
final void closeContainer()(Code)



createContainer
synchronized void createContainer(ContainerKey newIdentity) throws StandardException(Code)



createIdentity
public Cacheable createIdentity(Object key, Object createParameter) throws StandardException(Code)

exception:
  StandardException - Standard Cloudscape error policy



encryptContainer
protected void encryptContainer(BaseContainerHandle handle, String newFilePath) throws StandardException(Code)
Create encrypted version of the container with the user specified encryption properties. Read all the pages of the container from the original container through the page cache, encrypt each page data with new encryption mechanism and write to the specified container file.
Parameters:
  handle - the container handle.
Parameters:
  newFilePath - file to store the new encrypted version of the container
exception:
  StandardException - Derby Standard error policy



flushAll
protected void flushAll() throws StandardException(Code)
flush the cache to ensure all of my pages are written to disk
exception:
  StandardException - Standard Cloudscape error policy



getFileName
synchronized StorageFile getFileName(ContainerKey identity, boolean stub, boolean errorOK, boolean tryAlternatePath) throws StandardException(Code)



isDirty
public synchronized boolean isDirty()(Code)



openContainer
synchronized boolean openContainer(ContainerKey newIdentity) throws StandardException(Code)



preAllocate
protected int preAllocate(long lastPreallocPagenum, int preAllocSize)(Code)
Preallocate some pages if need be



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



privGetRandomAccessFile
synchronized StorageRandomAccessFile privGetRandomAccessFile(StorageFile file) throws SecurityException, StandardException(Code)



readPage
protected void readPage(long pageNumber, byte[] pageData) throws IOException, StandardException(Code)
Read a page into the supplied array.
MT - thread safe
exception:
  IOException - exception reading page
exception:
  StandardException - Standard Cloudscape error policy



removeContainer
protected void removeContainer(LogInstant instant, boolean leaveStub) throws StandardException(Code)
Remove the container
exception:
  StandardException - Standard Cloudscape error policy



removeFile
synchronized boolean removeFile(StorageFile file) throws SecurityException, StandardException(Code)



run
public Object run() throws StandardException, IOException(Code)



setIdentity
public Cacheable setIdentity(Object key) throws StandardException(Code)
Set container's identity
exception:
  StandardException - Standard Cloudscape error policy



truncatePages
protected void truncatePages(long lastValidPagenum) throws StandardException(Code)
Truncate pages of a container.

Truncate all pages from lastValidPagenum+1 through the end of the file.


Parameters:
  lastValidPagenum - The page number of the last valid page of thefile. All pages after this one are truncated.
exception:
  StandardException - Standard exception policy.




writePage
protected void writePage(long pageNumber, byte[] pageData, boolean syncPage) throws IOException, StandardException(Code)
Write a page from the supplied array.
MT - thread safe
exception:
  StandardException - Standard Cloudscape error policy
exception:
  IOException - IO error accessing page



Fields inherited from org.apache.derby.impl.store.raw.data.FileContainer
final protected static int ALLOC_PAGE_ARG_NUM(Code)(Java Doc)
final protected static int CHECKSUM_SIZE(Code)(Java Doc)
final protected static int CONTAINER_INFO_SIZE(Code)(Java Doc)
final public static long FIRST_ALLOC_PAGE_NUMBER(Code)(Java Doc)
final public static long FIRST_ALLOC_PAGE_OFFSET(Code)(Java Doc)
final protected static String SPACE_TRACE(Code)(Java Doc)
final protected static int STORED_PAGE_ARG_NUM(Code)(Java Doc)
protected AllocationCache allocCache(Code)(Java Doc)
protected boolean canUpdate(Code)(Java Doc)
final protected CacheManager containerCache(Code)(Java Doc)
byte[] containerInfo(Code)(Java Doc)
protected long containerVersion(Code)(Java Doc)
final protected BaseDataFileFactory dataFactory(Code)(Java Doc)
protected long estimatedRowCount(Code)(Java Doc)
protected long firstAllocPageNumber(Code)(Java Doc)
protected long firstAllocPageOffset(Code)(Java Doc)
final protected static int formatIdInteger(Code)(Java Doc)
protected short initialPages(Code)(Java Doc)
protected boolean isDirty(Code)(Java Doc)
protected LogInstant lastLogInstant(Code)(Java Doc)
protected int minimumRecordSize(Code)(Java Doc)
final protected CacheManager pageCache(Code)(Java Doc)
protected int pageSize(Code)(Java Doc)
protected boolean preDirty(Code)(Java Doc)
protected int spareSpace(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.store.raw.data.FileContainer
abstract protected void backupContainer(BaseContainerHandle handle, String backupLocation) throws StandardException(Code)(Java Doc)
final protected void bumpContainerVersion(LogInstant instant)(Code)(Java Doc)
protected boolean canUpdate()(Code)(Java Doc)
public void clearIdentity()(Code)(Java Doc)
protected void clearPreallocThreshold()(Code)(Java Doc)
abstract void closeContainer()(Code)(Java Doc)
protected void compressContainer(RawTransaction ntt, BaseContainerHandle allocHandle) throws StandardException(Code)(Java Doc)
abstract void createContainer(ContainerKey newIdentity) throws StandardException(Code)(Java Doc)
protected Cacheable createIdent(ContainerKey newIdentity, Object createParameter) throws StandardException(Code)(Java Doc)
public Cacheable createIdentity(Object key, Object createParameter) throws StandardException(Code)(Java Doc)
protected void deallocatePage(BaseContainerHandle handle, BasePage page) throws StandardException(Code)(Java Doc)
protected void decryptPage(byte[] pageData, int pageSize) throws StandardException(Code)(Java Doc)
protected int doPreAllocatePages(long lastPreallocPagenum, int preAllocSize)(Code)(Java Doc)
protected void dropContainer(LogInstant instant, boolean isDropped)(Code)(Java Doc)
protected byte[] encryptPage(byte[] pageData, int pageSize, byte[] encryptionBuffer, boolean newEngine) throws StandardException(Code)(Java Doc)
protected BasePage getAllocPage(long pageNumber) throws StandardException(Code)(Java Doc)
protected BasePage getAnyPage(BaseContainerHandle handle, long pageNumber) throws StandardException(Code)(Java Doc)
public void getContainerProperties(Properties prop) throws StandardException(Code)(Java Doc)
protected long getContainerVersion()(Code)(Java Doc)
protected byte[] getEmbryonicPage(DataInput fileData) throws IOException(Code)(Java Doc)
protected byte[] getEncryptionBuffer()(Code)(Java Doc)
public long getEstimatedPageCount(BaseContainerHandle handle, int flag) throws StandardException(Code)(Java Doc)
public long getEstimatedRowCount(int flag)(Code)(Java Doc)
protected BasePage getFirstHeadPage(BaseContainerHandle handle, boolean wait) throws StandardException(Code)(Java Doc)
protected BasePage getHeadPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
protected long getLastPageNumber(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
protected BasePage getLatchedPage(BaseContainerHandle handle, long pageNumber) throws StandardException(Code)(Java Doc)
protected int getMinimumRecordSize()(Code)(Java Doc)
protected BasePage getNextHeadPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
protected BasePage getPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
protected BasePage getPageForCompress(BaseContainerHandle handle, int flag, long pageno) throws StandardException(Code)(Java Doc)
protected BasePage getPageForInsert(BaseContainerHandle handle, int flag) throws StandardException(Code)(Java Doc)
protected int getPageSize()(Code)(Java Doc)
final public long getReusableRecordIdSequenceNumber()(Code)(Java Doc)
public SpaceInfo getSpaceInfo(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
protected int getSpareSpace()(Code)(Java Doc)
public int getTypeFormatId()(Code)(Java Doc)
final protected void incrementReusableRecordIdSequenceNumber()(Code)(Java Doc)
protected BasePage initPage(BaseContainerHandle allochandle, PageKey pkey, int[] createArgs, long pageOffset, boolean reuse, boolean overflow) throws StandardException(Code)(Java Doc)
public boolean isDirty()(Code)(Java Doc)
protected BasePage latchPage(BaseContainerHandle handle, BasePage foundPage, boolean wait) throws StandardException(Code)(Java Doc)
protected void letGo(BaseContainerHandle handle)(Code)(Java Doc)
protected ByteArray logCreateContainerInfo() throws StandardException(Code)(Java Doc)
protected BasePage newPage(BaseContainerHandle userHandle, RawTransaction ntt, BaseContainerHandle allocHandle, boolean isOverflow) throws StandardException(Code)(Java Doc)
abstract boolean openContainer(ContainerKey newIdentity) throws StandardException(Code)(Java Doc)
abstract protected int preAllocate(long lastPreallocPagenum, int preAllocSize)(Code)(Java Doc)
public void preDirty(boolean preDirtyOn)(Code)(Java Doc)
protected void prepareForBulkLoad(BaseContainerHandle handle, int numPage)(Code)(Java Doc)
protected BasePage reCreatePageForRedoRecovery(BaseContainerHandle handle, int pageFormat, long pageNumber, long pageOffset) throws StandardException(Code)(Java Doc)
protected void readHeader(DataInput fileData) throws IOException, StandardException(Code)(Java Doc)
abstract protected void readPage(long pageNumber, byte[] pageData) throws IOException, StandardException(Code)(Java Doc)
protected void setDirty(boolean dirty)(Code)(Java Doc)
public void setEstimatedRowCount(long count, int flag)(Code)(Java Doc)
protected Cacheable setIdent(ContainerKey newIdentity) throws StandardException(Code)(Java Doc)
public Cacheable setIdentity(Object key) throws StandardException(Code)(Java Doc)
protected void trackUnfilledPage(long pagenumber, boolean unfilled)(Code)(Java Doc)
protected void updateEstimatedRowCount(int delta)(Code)(Java Doc)
protected void writeHeader(byte[] pageData) throws StandardException, IOException(Code)(Java Doc)
protected void writeHeader(DataOutput fileData, boolean create, byte[] epage) throws IOException, StandardException(Code)(Java Doc)
abstract protected void writePage(long pageNumber, byte[] pageData, boolean syncPage) throws IOException, StandardException(Code)(Java Doc)

Fields inherited from org.apache.derby.impl.store.raw.data.BaseContainer
protected ContainerKey identity(Code)(Java Doc)
protected boolean isCommittedDrop(Code)(Java Doc)
protected boolean isDropped(Code)(Java Doc)
protected boolean isReusableRecordId(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.store.raw.data.BaseContainer
public Page addPage(BaseContainerHandle handle, boolean isOverflow) throws StandardException(Code)(Java Doc)
abstract protected void backupContainer(BaseContainerHandle handle, String backupContainerPath) throws StandardException(Code)(Java Doc)
abstract protected boolean canUpdate()(Code)(Java Doc)
public void clearIdentity()(Code)(Java Doc)
abstract protected void clearPreallocThreshold()(Code)(Java Doc)
public void compressContainer(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
abstract protected void compressContainer(RawTransaction t, BaseContainerHandle allocHandle) throws StandardException(Code)(Java Doc)
abstract protected void deallocatePage(BaseContainerHandle userhandle, BasePage page) throws StandardException(Code)(Java Doc)
abstract protected void dropContainer(LogInstant instant, boolean drop)(Code)(Java Doc)
abstract protected void encryptContainer(BaseContainerHandle handle, String newFilePath) throws StandardException(Code)(Java Doc)
protected void fillInIdentity(ContainerKey key)(Code)(Java Doc)
abstract protected void flushAll() throws StandardException(Code)(Java Doc)
protected Page getAllocPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
abstract protected BasePage getAllocPage(long pageNumber) throws StandardException(Code)(Java Doc)
protected Page getAnyPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
abstract protected BasePage getAnyPage(BaseContainerHandle handle, long pageNumber) throws StandardException(Code)(Java Doc)
protected boolean getCommittedDropState()(Code)(Java Doc)
public long getContainerId()(Code)(Java Doc)
abstract public void getContainerProperties(Properties prop) throws StandardException(Code)(Java Doc)
public int getContainerStatus()(Code)(Java Doc)
abstract protected long getContainerVersion() throws StandardException(Code)(Java Doc)
protected boolean getDeallocLock(BaseContainerHandle handle, RecordHandle deallocLock, boolean wait, boolean zeroDuration) throws StandardException(Code)(Java Doc)
protected boolean getDroppedState()(Code)(Java Doc)
abstract public long getEstimatedPageCount(BaseContainerHandle handle, int flag) throws StandardException(Code)(Java Doc)
abstract public long getEstimatedRowCount(int flag) throws StandardException(Code)(Java Doc)
abstract protected BasePage getFirstHeadPage(BaseContainerHandle handle, boolean wait) throws StandardException(Code)(Java Doc)
protected Page getFirstPage(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
abstract protected BasePage getHeadPage(BaseContainerHandle handle, long pagenumber, boolean wait) throws StandardException(Code)(Java Doc)
public Object getIdentity()(Code)(Java Doc)
abstract protected BasePage getNextHeadPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
protected Page getNextPage(BaseContainerHandle handle, long pageNumber) throws StandardException(Code)(Java Doc)
abstract protected BasePage getPage(BaseContainerHandle handle, long pageNumber, boolean wait) throws StandardException(Code)(Java Doc)
abstract protected BasePage getPageForCompress(BaseContainerHandle handle, int flag, long pageno) throws StandardException(Code)(Java Doc)
abstract protected BasePage getPageForInsert(BaseContainerHandle handle, int flag) throws StandardException(Code)(Java Doc)
abstract public long getReusableRecordIdSequenceNumber()(Code)(Java Doc)
public long getSegmentId()(Code)(Java Doc)
abstract protected SpaceInfo getSpaceInfo(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
abstract protected void incrementReusableRecordIdSequenceNumber()(Code)(Java Doc)
protected boolean isReusableRecordId()(Code)(Java Doc)
protected BasePage latchPage(BaseContainerHandle handle, BasePage foundPage, boolean wait) throws StandardException(Code)(Java Doc)
protected void letGo(BaseContainerHandle handle)(Code)(Java Doc)
public boolean lockAttributes(int flag, Hashtable attributes)(Code)(Java Doc)
public void lockEvent(Latch lockInfo)(Code)(Java Doc)
public boolean lockerAlwaysCompatible()(Code)(Java Doc)
abstract protected ByteArray logCreateContainerInfo() throws StandardException(Code)(Java Doc)
abstract protected BasePage newPage(BaseContainerHandle userhandle, RawTransaction t, BaseContainerHandle allocHandle, boolean isOverflow) throws StandardException(Code)(Java Doc)
abstract protected void preDirty(boolean preDirtyOn)(Code)(Java Doc)
abstract protected void prepareForBulkLoad(BaseContainerHandle handle, int numPage)(Code)(Java Doc)
abstract protected BasePage reCreatePageForRedoRecovery(BaseContainerHandle handle, int pageFormat, long pageNumber, long pageOffset) throws StandardException(Code)(Java Doc)
abstract protected void removeContainer(LogInstant instant, boolean leaveStub) throws StandardException(Code)(Java Doc)
protected void removePage(BaseContainerHandle handle, BasePage page) throws StandardException(Code)(Java Doc)
public boolean requestCompatible(Object requestedQualifier, Object grantedQualifier)(Code)(Java Doc)
protected void setCommittedDropState(boolean isCommittedDrop)(Code)(Java Doc)
protected void setDroppedState(boolean isDropped)(Code)(Java Doc)
abstract public void setEstimatedRowCount(long count, int flag) throws StandardException(Code)(Java Doc)
protected void setReusableRecordIdState(boolean isReusableRecordId)(Code)(Java Doc)
protected void truncate(BaseContainerHandle handle) throws StandardException(Code)(Java Doc)
abstract protected void truncatePages(long lastValidPagenum) throws StandardException(Code)(Java Doc)
public void unlockEvent(Latch lockInfo)(Code)(Java Doc)
protected boolean use(BaseContainerHandle handle, boolean forUpdate, boolean droppedOK) throws StandardException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

w___w__w___.__j___av_a_2__s___._com_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.