Java Doc for ClusterStore.java in  » Database-DBMS » Ozone-1.1 » org » ozoneDB » core » wizardStore » 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 » Ozone 1.1 » org.ozoneDB.core.wizardStore 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ozoneDB.core.wizardStore.ClusterStore

ClusterStore
final public class ClusterStore (Code)
The ClusterStore is the back-end store of the wizardStore. It maintains the cluster cache, activation/passivation and the actual persistent commits.
author:
   SMB
author:
   Medium.net
version:
   $Revision: 1.2 $Date: 2002/06/08 00:49:39 $


Field Summary
final public static  StringPOSTFIX_CLUSTER
    
final public static  StringPOSTFIX_LOCK
    
final public static  StringPOSTFIX_SHADOW
    
final public static  StringPOSTFIX_TEMP
    
protected  DxMapcachedClusters
    
final protected static  intcompressionFactor
    
protected transient  Envenv
    
protected  DxMapgrowingClusterIDs
     Table that maps Permissions to ClusterIDs.
protected  intmaxClusterSize
    
protected transient  longtouchCount
    

Constructor Summary
 ClusterStore(Env _env)
    

Method Summary
public synchronized  voidabortCluster(Transaction ta, ClusterID cid)
     Actually abort the specified cluster.
protected  voidactivateCluster(Cluster cluster, int size)
     This method us called right after the specified Cluster was loaded from disk.
protected  Stringbasename(ClusterID cid)
    
public synchronized  voidcommitCluster(Transaction ta, ClusterID cid)
     Actually commit the specified cluster.
protected synchronized  ClustercreateANewEmptyAndUsableCluster(Permissions perms)
    
protected  intcurrentBytesPerContainer()
    
public  longcurrentCacheSize()
    
protected  voiddeactivateCluster(Cluster cluster)
     Deactivate the specified cluster before it is written to disk.
protected  ClustergiveMeAnUnlockedCluster(Permissions perms)
     Returns or creates a cluster which is not locked so that locking it will succeed.
protected synchronized  ClustergrowingCluster(Permissions perms)
    
Parameters:
  perms - Permissions of the cluster to search.
public  voidinvalidateContainer(WizardObjectContainer container)
    
public  booleanisCleanShutdown()
     Check if the ClusterStore was cleanly shutted down.
public  ClusterloadCluster(ClusterID cid, boolean pin)
     Make sure the corresponding cluster is in the cache.
protected  ObjectloadData(String key)
     Load the data that previously has been stored for the given key.
public synchronized  voidprepareCommitCluster(Transaction ta, ClusterID cid)
     Store the specified cluster on disk.
public  DxSetrecoverClusterIDs()
     Search the DATA dir and recover all ClusterIDs.
public  voidregisterContainerAndPinAndLock(WizardObjectContainer container, Permissions perms, Transaction locker, int lockLevel)
     Associates the specified container with a cluster.
protected  ClusterrestoreCluster(ClusterID cid)
    
public  voidshutdown()
    
public  voidsplitCluster(Cluster cluster)
    
public  voidstartup()
    
protected  voidstoreData(Object obj, String key)
     Serialize and store the specified object for the specified key.
protected  voidtrimCache()
     Ensure that there is at least the specified size of free space in the cluster cache.
public  voidunloadCluster(ClusterID cid, boolean deactivate)
     Remove cluster from the cluster cache.
protected  voidupdateLockOnDisk(Cluster cluster, Transaction ta)
    

Field Detail
POSTFIX_CLUSTER
final public static String POSTFIX_CLUSTER(Code)



POSTFIX_LOCK
final public static String POSTFIX_LOCK(Code)



POSTFIX_SHADOW
final public static String POSTFIX_SHADOW(Code)



POSTFIX_TEMP
final public static String POSTFIX_TEMP(Code)



cachedClusters
protected DxMap cachedClusters(Code)



compressionFactor
final protected static int compressionFactor(Code)



env
protected transient Env env(Code)



growingClusterIDs
protected DxMap growingClusterIDs(Code)
Table that maps Permissions to ClusterIDs.



maxClusterSize
protected int maxClusterSize(Code)



touchCount
protected transient long touchCount(Code)




Constructor Detail
ClusterStore
ClusterStore(Env _env)(Code)




Method Detail
abortCluster
public synchronized void abortCluster(Transaction ta, ClusterID cid) throws IOException, ClassNotFoundException(Code)
Actually abort the specified cluster. This deletes t
Parameters:
  cid - Cluster to be aborted.



activateCluster
protected void activateCluster(Cluster cluster, int size)(Code)
This method us called right after the specified Cluster was loaded from disk.



basename
protected String basename(ClusterID cid)(Code)



commitCluster
public synchronized void commitCluster(Transaction ta, ClusterID cid) throws IOException, ClassNotFoundException(Code)
Actually commit the specified cluster. This simply renames the temp file to be the new "original" ones. The rename operation MUST NOT fail.
Parameters:
  cid - Cluster to be commited.



createANewEmptyAndUsableCluster
protected synchronized Cluster createANewEmptyAndUsableCluster(Permissions perms) throws IOException, ClassNotFoundException(Code)
Creates a cluster which is
  • new
  • empty
  • usable and
  • not locked



currentBytesPerContainer
protected int currentBytesPerContainer()(Code)



currentCacheSize
public long currentCacheSize()(Code)



deactivateCluster
protected void deactivateCluster(Cluster cluster) throws IOException(Code)
Deactivate the specified cluster before it is written to disk. The specified cluster will be removed from the cluster cache. If it currently has shadows, they are written to disk. If any of the containers are currently invoked (should normally never happen), the shadows must stay in memory.



giveMeAnUnlockedCluster
protected Cluster giveMeAnUnlockedCluster(Permissions perms) throws IOException, ClassNotFoundException(Code)
Returns or creates a cluster which is not locked so that locking it will succeed. The returned cluster is only guaranteed to be not locked by any other thread as long as this method is called during synchronization to this ClusterStore.



growingCluster
protected synchronized Cluster growingCluster(Permissions perms) throws Exception(Code)

Parameters:
  perms - Permissions of the cluster to search. Cluster with the specified permissions that is good to store anew container in it.



invalidateContainer
public void invalidateContainer(WizardObjectContainer container)(Code)



isCleanShutdown
public boolean isCleanShutdown()(Code)
Check if the ClusterStore was cleanly shutted down.



loadCluster
public Cluster loadCluster(ClusterID cid, boolean pin) throws IOException, ClassNotFoundException(Code)
Make sure the corresponding cluster is in the cache. While loading clusters, we may have to throw away (and maybe store) some currently cached clusters.
Parameters:
  cid - ClusterID of the cluster to load.
Parameters:
  pin - wether the loaded cluster should be pinned as soon as it is loadedso that there may be no chance to unload unless it is unpinned.If this parameter is set to true, the user has to unpin the cluster.If this parameter is set to false, the cluster may already be unloaded when this method returns.after using it.



loadData
protected Object loadData(String key) throws IOException, ClassNotFoundException(Code)
Load the data that previously has been stored for the given key.



prepareCommitCluster
public synchronized void prepareCommitCluster(Transaction ta, ClusterID cid) throws IOException, ClassNotFoundException(Code)
Store the specified cluster on disk. Write temp files first. If this write fails, the original are still valid. The cluster may has been written to the disk already, if is was deactivated while transaction. But in case the cluster (and its changes) are only in memory, we have to write now to check if this is possible without errors. Note: This only writes all currently commited transaction results to the disk. This is different from the deactivation behaviour.
Parameters:
  cid - Cluster to be prepare-commited.
exception:
  Exception - None of the clusters are written to disk.



recoverClusterIDs
public DxSet recoverClusterIDs()(Code)
Search the DATA dir and recover all ClusterIDs.



registerContainerAndPinAndLock
public void registerContainerAndPinAndLock(WizardObjectContainer container, Permissions perms, Transaction locker, int lockLevel) throws Exception(Code)
Associates the specified container with a cluster. Iff this method returns normally (without exception), the container is pinned and thus has to be unpinned. Iff this method returns normally (without exception), the container (and thus the cluster of the container) is write locked
Parameters:
  container - Container to be registered with one cluster.



restoreCluster
protected Cluster restoreCluster(ClusterID cid) throws Exception(Code)



shutdown
public void shutdown()(Code)



splitCluster
public void splitCluster(Cluster cluster)(Code)



startup
public void startup() throws Exception(Code)



storeData
protected void storeData(Object obj, String key) throws IOException(Code)
Serialize and store the specified object for the specified key. This current implementation uses the file system as back end store.



trimCache
protected void trimCache() throws IOException(Code)
Ensure that there is at least the specified size of free space in the cluster cache. Under some circumstances clusters (currently invoked) cannot be deactivated. Therefore this method cannot guarantee that the needed space is free afterwards.

This is the central method of the deactivation of containers that are currently in use. This is different from the commit behaviour.




unloadCluster
public void unloadCluster(ClusterID cid, boolean deactivate) throws IOException(Code)
Remove cluster from the cluster cache.
Parameters:
  cid -



updateLockOnDisk
protected void updateLockOnDisk(Cluster cluster, Transaction ta) throws IOException(Code)



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.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.