|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.core.storage.AbstractClusterStore
org.ozoneDB.core.storage.magicStore.ClusterStore
The ClusterStore is the back-end store of the magicStore. It maintains the cluster cache, activation/passivation and the actual persistent commits.
Nested Class Summary | |
private class |
ClusterStore.StoreThread
|
Field Summary | |
private Cache |
clusterCache
|
private boolean |
compressClusters
|
protected static int |
compressionFactor
|
protected DxMap |
growingClusterIDs
Table that maps Permissions to ClusterIDs. |
private MagicStore |
magicStore
|
protected int |
maxClusterSize
|
(package private) static java.lang.String |
POSTFIX_NEW
|
private static java.lang.String |
POSTFIX_OLD
|
private ClusterStore.StoreThread |
storeThread
|
Fields inherited from class org.ozoneDB.core.storage.AbstractClusterStore |
env, POSTFIX_CLUSTER, POSTFIX_LOCK, POSTFIX_SEPARATOR, POSTFIX_TEMP, touchCount |
Constructor Summary | |
(package private) |
ClusterStore(Env _env)
|
Method Summary | |
void |
abortCluster(Transaction ta,
ClusterID cid)
Actually abort the specified cluster. |
(package private) void |
abortTransaction(MagicTransaction ta)
|
protected void |
activateCluster(Cluster cluster,
int size)
This method is called right after the specified MagicCluster was loaded from disk. |
void |
commitCluster(Transaction ta,
ClusterID cid)
|
protected Cluster |
createANewEmptyAndUsableCluster(Permissions perms)
Creates a cluster which is new empty usable and not locked |
int |
currentBytesPerContainer()
|
long |
currentCacheSize()
|
protected void |
deactivateCluster(Cluster cluster)
Deactivate the specified cluster before it is written to disk. |
(package private) MagicStore |
getMagicStore()
|
protected Cluster |
giveMeAnUnlockedCluster(Permissions perms)
Returns or creates a cluster which is not locked so that locking it will succeed. |
protected Cluster |
growingCluster(Permissions perms,
MagicTransaction ta)
|
void |
invalidateContainer(StorageObjectContainer container)
|
boolean |
isCleanShutdown()
Check if the ClusterStore was cleanly shutted down. |
Cluster |
loadCluster(ClusterID cid,
MagicTransaction ta)
Make sure the corresponding cluster is in the cache. |
protected java.lang.Object |
loadData(java.lang.String key)
Load the data that previously has been stored for the given key. |
void |
prepareCommitCluster(Transaction ta,
ClusterID cid)
Store the specified cluster on disk. |
java.util.Set |
recoverClusterIDs()
Search the DATA dir and recover all ClusterIDs. |
void |
registerContainerAndLock(StorageObjectContainer container,
Permissions perms,
Transaction locker,
int lockLevel)
Associates the specified container with a cluster. |
protected Cluster |
restoreCluster(ClusterID cid,
java.util.Set uncommittedTaIDs)
|
(package private) void |
setMagicStore(MagicStore _magicStore)
|
void |
shutdown()
|
void |
splitCluster(Cluster cluster)
|
private static java.lang.String[] |
splitClusterName(java.lang.String clusterName)
|
void |
startup()
|
protected void |
storeData(java.lang.Object obj,
java.lang.String key)
Serialize and store the specified object for the specified key. |
protected void |
storeDataImmediately(java.lang.Object obj,
java.lang.String key)
|
(package private) java.util.Set |
uncommittedTaIDs()
Returns a set containing the IDs of all tx-es that for one reason or another have not committed. |
void |
unloadCluster(ClusterID cid,
boolean deactivate)
Remove cluster from the cluster cache. |
protected void |
updateLockOnDisk(Cluster cluster,
Transaction ta)
|
Methods inherited from class org.ozoneDB.core.storage.AbstractClusterStore |
basename |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final java.lang.String POSTFIX_NEW
private static final java.lang.String POSTFIX_OLD
protected static final int compressionFactor
private transient Cache clusterCache
protected int maxClusterSize
protected DxMap growingClusterIDs
private boolean compressClusters
private MagicStore magicStore
private ClusterStore.StoreThread storeThread
Constructor Detail |
ClusterStore(Env _env)
Method Detail |
MagicStore getMagicStore()
void setMagicStore(MagicStore _magicStore)
public void startup() throws java.lang.Exception
java.lang.Exception
public void shutdown()
public boolean isCleanShutdown()
public java.util.Set recoverClusterIDs()
java.util.Set uncommittedTaIDs()
private static java.lang.String[] splitClusterName(java.lang.String clusterName)
public long currentCacheSize()
public int currentBytesPerContainer()
currentBytesPerContainer
in class AbstractClusterStore
protected Cluster growingCluster(Permissions perms, MagicTransaction ta) throws java.lang.Exception
perms
- Permissions of the cluster to search.
java.lang.Exception
protected Cluster createANewEmptyAndUsableCluster(Permissions perms) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
protected Cluster giveMeAnUnlockedCluster(Permissions perms) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void registerContainerAndLock(StorageObjectContainer container, Permissions perms, Transaction locker, int lockLevel) throws java.lang.Exception
registerContainerAndLock
in class AbstractClusterStore
container
- Container to be registered with one cluster.
java.lang.Exception
public void invalidateContainer(StorageObjectContainer container)
protected Cluster restoreCluster(ClusterID cid, java.util.Set uncommittedTaIDs) throws java.lang.Exception
java.lang.Exception
public Cluster loadCluster(ClusterID cid, MagicTransaction ta) throws java.io.IOException, java.lang.ClassNotFoundException
cid
- ClusterID of the cluster to load.
java.io.IOException
java.lang.ClassNotFoundException
public void splitCluster(Cluster cluster)
public void unloadCluster(ClusterID cid, boolean deactivate) throws java.io.IOException
cid
-
java.io.IOException
protected void activateCluster(Cluster cluster, int size)
activateCluster
in class AbstractClusterStore
protected void deactivateCluster(Cluster cluster) throws java.io.IOException
deactivateCluster
in class AbstractClusterStore
java.io.IOException
public void prepareCommitCluster(Transaction ta, ClusterID cid) throws java.io.IOException, java.lang.ClassNotFoundException
prepareCommitCluster
in class AbstractClusterStore
cid
- MagicCluster to be prepare-commited.
java.io.IOException
- None of the clusters are written to disk.
java.lang.ClassNotFoundException
public void commitCluster(Transaction ta, ClusterID cid) throws java.io.IOException, java.lang.ClassNotFoundException
commitCluster
in class AbstractClusterStore
cid
- MagicCluster to be commited.
java.io.IOException
java.lang.ClassNotFoundException
public void abortCluster(Transaction ta, ClusterID cid) throws java.io.IOException, java.lang.ClassNotFoundException
abortCluster
in class AbstractClusterStore
cid
- MagicCluster to be aborted.
java.io.IOException
java.lang.ClassNotFoundException
protected void updateLockOnDisk(Cluster cluster, Transaction ta) throws java.io.IOException
java.io.IOException
protected void storeData(java.lang.Object obj, java.lang.String key) throws java.io.IOException
java.io.IOException
protected void storeDataImmediately(java.lang.Object obj, java.lang.String key) throws java.io.IOException
java.io.IOException
protected java.lang.Object loadData(java.lang.String key) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
void abortTransaction(MagicTransaction ta) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |