Java Doc for BaseContainerHandle.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
   java.util.Observable
      org.apache.derby.impl.store.raw.data.BaseContainerHandle

BaseContainerHandle
public class BaseContainerHandle extends Observable implements RawContainerHandle,Observer(Code)
A handle to an open container, implememts RawContainerHandle.

This class is an Observer to observe RawTransactions and is also a Observable to handle the list of pages accessed thorough this handle.
This class implements Lockable (defined to be ContainerHandle) and is the object used to logically lock the container.
MT - Mutable - Immutable identity - Thread Aware



Field Summary
protected  PageActionsactionsSet
    
protected  booleanactive
     Is this ContainerHandle active.
protected  AllocationActionsallocActionsSet
    
protected  BaseContainercontainer
     The actual container we are accessing.
protected  ContainerKeyidentity
    
protected  intmode
    
protected  RawTransactionxact
     our transaction.

Constructor Summary
public  BaseContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, LockingPolicy locking, int mode)
     Create an object that is only used for locking the container.
public  BaseContainerHandle(UUID rawStoreId, RawTransaction xact, PageActions actionsSet, AllocationActions allocActionsSet, LockingPolicy locking, BaseContainer container, int mode)
     Create a container handle that is used to actually access the container.

Method Summary
public  PageaddPage()
     Add a page to the container The page returned will be observing me.
public  PageaddPage(int flag)
     Add a page to the container, if flag == ContainerHandle.ADD_PAGE_BULK, tell the container about it.
public  voidbackupContainer(String backupContainerPath)
     Backup the container to the specified path.
protected  voidcheckOpen()
    
public  voidclose()
    
public  voidcompactRecord(RecordHandle record)
    
public  voidcompressContainer()
     Release free space to the OS.

As is possible release any free space to the operating system.

public  voiddropContainer(LogInstant instant, boolean drop)
    
public  voidencryptContainer(String newFilePath)
     Create encrypted version of the container with the user specified encryption properties.
public  voidflushContainer()
    
public  PageActionsgetActionSet()
    
public  PagegetAllocPage(long pageNumber)
    
public  AllocationActionsgetAllocationActionSet()
    
public  PagegetAnyPage(long pageNumber)
     Get this page with no check - any page type or status is fine.
public  voidgetContainerProperties(Properties prop)
     Request the system properties associated with a container.
public  intgetContainerStatus()
     Get the container status.
public  longgetContainerVersion()
    
public  longgetEstimatedPageCount(int flag)
    
public  longgetEstimatedRowCount(int flag)
    
public  PagegetFirstPage()
    
public  ContainerKeygetId()
    
final public  LockingPolicygetLockingPolicy()
     Return my locking policy, may be different from the Transaction's default locking policy.
public  intgetMode()
     Get the mode I was opened with.
public  PagegetNextPage(long pageNumber)
    
public  PagegetPage(long pageNumber)
    
public  PagegetPageForCompress(int flag, long pageno)
    
public  PagegetPageForInsert(int flag)
    
public  PagegetPageNoWait(long pageNumber)
    
public  longgetReusableRecordIdSequenceNumber()
     Get the reusable recordId sequence number.
public  SpaceInfogetSpaceInfo()
     Get information about space used by the container.
final public  RawTransactiongetTransaction()
     Return the RawTransaction I was opened in.
public  ObjectgetUniqueId()
    
public  PagegetUserPageNoWait(long pageNumber)
    
public  PagegetUserPageWait(long pageNumber)
    
protected  voidinformObservers()
    
final public  booleanisReadOnly()
    
public  booleanisTemporaryContainer()
    
public  ByteArraylogCreateContainerInfo()
     Log all information necessary to recreate the container during a load tran.
public  RecordHandlemakeRecordHandle(long pageNumber, int recordId)
     Return a record handle that is initialized to the given page number and record id.
public  voidpreAllocate(int numPage)
     Preallocate numPage if possible.
public  voidpreDirty(boolean preDirtyOn)
     The container is about to be modified.
public  PagereCreatePageForRedoRecovery(int pageFormat, long pageNumber, long pageOffset)
     ReCreate a page for rollforward recovery.
public  voidremoveContainer(LogInstant instant)
    
public  voidremovePage(Page page)
     Remove a page from the container.
public  voidsetEstimatedRowCount(long count, int flag)
    
final public  voidsetLockingPolicy(LockingPolicy newLockingPolicy)
    
public  StringtoString()
    
public  voidupdate(Observable obj, Object arg)
     Called when the transaction is about to complete.
final public  booleanupdateOK()
    
public  booleanuseContainer(boolean droppedOK, boolean waitForLock)
     Attach me to a container.

Field Detail
actionsSet
protected PageActions actionsSet(Code)



active
protected boolean active(Code)
Is this ContainerHandle active.
MT - Mutable : scoped



allocActionsSet
protected AllocationActions allocActionsSet(Code)



container
protected BaseContainer container(Code)
The actual container we are accessing. Only valid when active is true.
MT - Mutable : scoped



identity
protected ContainerKey identity(Code)
Container identifier
MT - Immutable



mode
protected int mode(Code)



xact
protected RawTransaction xact(Code)
our transaction. Only valid when active is true.
MT - Mutable : scoped




Constructor Detail
BaseContainerHandle
public BaseContainerHandle(UUID rawStoreId, RawTransaction xact, ContainerKey identity, LockingPolicy locking, int mode)(Code)
Create an object that is only used for locking the container.



BaseContainerHandle
public BaseContainerHandle(UUID rawStoreId, RawTransaction xact, PageActions actionsSet, AllocationActions allocActionsSet, LockingPolicy locking, BaseContainer container, int mode)(Code)
Create a container handle that is used to actually access the container.




Method Detail
addPage
public Page addPage() throws StandardException(Code)
Add a page to the container The page returned will be observing me.
See Also:   BaseContainer.addPage
See Also:   ContainerHandle.addPage
exception:
  StandardException - Standard Cloudscape error policy



addPage
public Page addPage(int flag) throws StandardException(Code)
Add a page to the container, if flag == ContainerHandle.ADD_PAGE_BULK, tell the container about it. The page returned will be observing me.
See Also:   BaseContainer.addPage
See Also:   ContainerHandle.addPage
exception:
  StandardException - Standard Cloudscape error policy



backupContainer
public void backupContainer(String backupContainerPath) throws StandardException(Code)
Backup the container to the specified path.
Parameters:
  backupContainerPath - location of the backup container.
exception:
  StandardException - Standard Derby error policy



checkOpen
protected void checkOpen() throws StandardException(Code)



close
public void close()(Code)

See Also:   ContainerHandle.close



compactRecord
public void compactRecord(RecordHandle record) throws StandardException(Code)

See Also:   ContainerHandle.compactRecord
exception:
  StandardException - Standard Cloudscape error policy



compressContainer
public void compressContainer() throws StandardException(Code)
Release free space to the OS.

As is possible release any free space to the operating system. This will usually mean releasing any free pages located at the end of the file using the java truncate() interface.
exception:
  StandardException - Standard Cloudscape error policy




dropContainer
public void dropContainer(LogInstant instant, boolean drop) throws StandardException(Code)

exception:
  StandardException - Standard cloudscape exception policy
See Also:   RawContainerHandle.dropContainer



encryptContainer
public void encryptContainer(String newFilePath) throws StandardException(Code)
Create encrypted version of the container with the user specified encryption properties.
Parameters:
  newFilePath - file to store the new encrypted version of the container
exception:
  StandardException - Standard Derby error policy



flushContainer
public void flushContainer() throws StandardException(Code)

See Also:   ContainerHandle.flushContainer
exception:
  StandardException - Standard Cloudscape error policy



getActionSet
public PageActions getActionSet()(Code)



getAllocPage
public Page getAllocPage(long pageNumber) throws StandardException(Code)



getAllocationActionSet
public AllocationActions getAllocationActionSet()(Code)



getAnyPage
public Page getAnyPage(long pageNumber) throws StandardException(Code)
Get this page with no check - any page type or status is fine. Caller must be prepared to handle freed, deallocated,or alloc page Called by recovery ONLY.
exception:
  StandardException - Cloudscape Standard error policy



getContainerProperties
public void getContainerProperties(Properties prop) throws StandardException(Code)
Request the system properties associated with a container.

Request the value of properties that are associated with a container. The following properties can be requested: derby.storage.pageSize derby.storage.pageReservedSpace derby.storage.minimumRecordSize

To get the value of a particular property add it to the property list, and on return the value of the property will be set to it's current value. For example: get_prop(BaseContainerHandle ch) { Properties prop = new Properties(); prop.put("derby.storage.pageSize", ""); ch.getContainerProperties(prop); System.out.println( "conatainer's page size = " + prop.getProperty("derby.storage.pageSize"); }
Parameters:
  prop - Property list to fill in.
exception:
  StandardException - Standard exception policy.




getContainerStatus
public int getContainerStatus() throws StandardException(Code)
Get the container status.
exception:
  StandardException - Standard Cloudscape error policy
See Also:   RawContainerHandle.getContainerStatus



getContainerVersion
public long getContainerVersion() throws StandardException(Code)

exception:
  StandardException - Standard cloudscape exception policy
See Also:   RawContainerHandle.getContainerVersion



getEstimatedPageCount
public long getEstimatedPageCount(int flag) throws StandardException(Code)

See Also:   ContainerHandle.getEstimatedPageCount
exception:
  StandardException - Standard Cloudscape error policy



getEstimatedRowCount
public long getEstimatedRowCount(int flag) throws StandardException(Code)

See Also:   ContainerHandle.getEstimatedRowCount
exception:
  StandardException - Standard Cloudscape error policy



getFirstPage
public Page getFirstPage() throws StandardException(Code)



getId
public ContainerKey getId()(Code)

See Also:   ContainerHandle.getId



getLockingPolicy
final public LockingPolicy getLockingPolicy()(Code)
Return my locking policy, may be different from the Transaction's default locking policy.



getMode
public int getMode()(Code)
Get the mode I was opened with.



getNextPage
public Page getNextPage(long pageNumber) throws StandardException(Code)



getPage
public Page getPage(long pageNumber) throws StandardException(Code)



getPageForCompress
public Page getPageForCompress(int flag, long pageno) throws StandardException(Code)



getPageForInsert
public Page getPageForInsert(int flag) throws StandardException(Code)



getPageNoWait
public Page getPageNoWait(long pageNumber) throws StandardException(Code)



getReusableRecordIdSequenceNumber
public long getReusableRecordIdSequenceNumber() throws StandardException(Code)
Get the reusable recordId sequence number. version sequence number
exception:
  StandardException - Standard Derby error policy
See Also:   ContainerHandle.getReusableRecordIdSequenceNumber



getSpaceInfo
public SpaceInfo getSpaceInfo() throws StandardException(Code)
Get information about space used by the container.



getTransaction
final public RawTransaction getTransaction()(Code)
Return the RawTransaction I was opened in.



getUniqueId
public Object getUniqueId()(Code)

See Also:   ContainerHandle.getUniqueId



getUserPageNoWait
public Page getUserPageNoWait(long pageNumber) throws StandardException(Code)



getUserPageWait
public Page getUserPageWait(long pageNumber) throws StandardException(Code)



informObservers
protected void informObservers()(Code)



isReadOnly
final public boolean isReadOnly()(Code)

See Also:   ContainerHandle.isReadOnly



isTemporaryContainer
public boolean isTemporaryContainer() throws StandardException(Code)

See Also:   ContainerHandle.isTemporaryContainer
exception:
  StandardException - Standard Cloudscape error policy



logCreateContainerInfo
public ByteArray logCreateContainerInfo() throws StandardException(Code)
Log all information necessary to recreate the container during a load tran.
exception:
  StandardException - Standard Cloudscape error policy



makeRecordHandle
public RecordHandle makeRecordHandle(long pageNumber, int recordId) throws StandardException(Code)
Return a record handle that is initialized to the given page number and record id.
exception:
  StandardException - Standard cloudscape exception policy.
Parameters:
  pageNumber - the page number of the RecordHandle.
Parameters:
  recordId - the record id of the RecordHandle.
See Also:   RecordHandle



preAllocate
public void preAllocate(int numPage)(Code)
Preallocate numPage if possible.



preDirty
public void preDirty(boolean preDirtyOn) throws StandardException(Code)
The container is about to be modified. Loggable actions use this to make sure the container gets cleaned if a checkpoint is taken after any log record is sent to the log stream but before the container is actually dirtied.
exception:
  StandardException - Standard Cloudscape error policy



reCreatePageForRedoRecovery
public Page reCreatePageForRedoRecovery(int pageFormat, long pageNumber, long pageOffset) throws StandardException(Code)
ReCreate a page for rollforward recovery.

During redo recovery it is possible for the system to try to redo the creation of a page (ie. going from non-existence to version 0). It first trys to read the page from disk, but a few different types of errors can occur: o the page does not exist at all on disk, this can happen during rollforward recovery applied to a backup where the file was copied and the page was added to the file during the time frame of the backup but after the physical file was copied. o space in the file exists, but it was never initalized. This can happen if you happen to crash at just the right moment during the allocation process. Also on some OS's it is possible to read from a part of the file that was not ever written - resulting in garbage from the store's point of view (often the result is all 0's). All these errors are easy to recover from as the system can easily create a version 0 from scratch and write it to disk. Because the system does not sync allocation of data pages, it is also possible at this point that whlie writing the version 0 to disk to create it we may encounter an out of disk space error (caught in this routine as a StandardException from the create() call. We can't recovery from this without help from outside, so the caught exception is nested and a new exception thrown which the recovery system will output to the user asking them to check their disk for space/errors.
exception:
  StandardException - Standard exception policy.




removeContainer
public void removeContainer(LogInstant instant) throws StandardException(Code)
remove the container
exception:
  StandardException - Standard Cloudscape error policy
See Also:   RawContainerHandle.removeContainer



removePage
public void removePage(Page page) throws StandardException(Code)
Remove a page from the container.
See Also:   ContainerHandle.removePage
exception:
  StandardException - Standard Cloudscape error policy



setEstimatedRowCount
public void setEstimatedRowCount(long count, int flag) throws StandardException(Code)

See Also:   ContainerHandle.setEstimatedRowCount
exception:
  StandardException - Standard Cloudscape error policy



setLockingPolicy
final public void setLockingPolicy(LockingPolicy newLockingPolicy)(Code)



toString
public String toString()(Code)



update
public void update(Observable obj, Object arg)(Code)
Called when the transaction is about to complete.
See Also:   Observer.update



updateOK
final public boolean updateOK()(Code)
Was I opened for updates?


MT - thread safe




useContainer
public boolean useContainer(boolean droppedOK, boolean waitForLock) throws StandardException(Code)
Attach me to a container. If this method returns false then I cannot be used anymore, and any reference to me must be discarded.
Parameters:
  droppedOK - if true, use this container even if it is dropped,otherwise, return false if container is dropped.
Parameters:
  waitForLock - if true, wait on lock, otherwise, get lock no wait.
exception:
  StandardException - Standard Cloudscape error policy



Methods inherited from java.util.Observable
public synchronized void addObserver(Observer o)(Code)(Java Doc)
protected synchronized void clearChanged()(Code)(Java Doc)
public synchronized int countObservers()(Code)(Java Doc)
public synchronized void deleteObserver(Observer o)(Code)(Java Doc)
public synchronized void deleteObservers()(Code)(Java Doc)
public synchronized boolean hasChanged()(Code)(Java Doc)
public void notifyObservers()(Code)(Java Doc)
public void notifyObservers(Object arg)(Code)(Java Doc)
protected synchronized void setChanged()(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)

www___.j__av___a_2_s___._c__om | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.