ozone core API

org.ozoneDB.core.storage.magicStore
Class MagicCluster

java.lang.Object
  extended byorg.ozoneDB.core.storage.AbstractCluster
      extended byorg.ozoneDB.core.storage.wizardStore.WizardCluster
          extended byorg.ozoneDB.core.wizardStore.Cluster
              extended byorg.ozoneDB.core.storage.magicStore.MagicCluster
All Implemented Interfaces:
Cluster, java.io.Externalizable, java.io.Serializable

public final class MagicCluster
extends Cluster
implements java.io.Externalizable

Version:
$Revision: 1.2 $Date: 2004/01/10 21:40:24 $ We need to extend Cluster in wizardStore to be compatible with wizardStore note: if be abandon compatibility it should extend AbstractCluster
Author:
SMB, Medium.net, Leo Mekenkamp, Per Nyfelt
See Also:
Serialized Form

Field Summary
protected  int bytesPerContainer
           
protected  long lastTouched
           
protected  MROWLock lock
           
protected  long modTime
           
protected static long serialVersionUID
           
protected static byte subSerialVersionUID
           
 
Fields inherited from class org.ozoneDB.core.storage.wizardStore.WizardCluster
pinCount
 
Fields inherited from class org.ozoneDB.core.storage.AbstractCluster
clusterID, clusterStore, containers, env, permissions
 
Constructor Summary
MagicCluster()
          Constructor to be used for Externalizable object serialisation.
MagicCluster(ClusterID _clusterID, Permissions _permissions, MROWLock lock, int _bpc)
           
 
Method Summary
 void abort(Transaction ta)
           
 void addedTo(Cache addedTo, java.lang.Object key)
           
 DxCollection allLockers()
           
 DxLong cachePriority()
          Priority of this cluster to stay in the cluster cache.
 ClusterID clusterID()
           
 void commit(Transaction ta)
           
 void delete()
          Delete this cluster from the disk.
protected  void finalize()
           
 boolean isInvoked()
           
 Lock lock()
           
 long modTime()
           
 void prepareCommit(Transaction ta)
           
 void readExternal(java.io.ObjectInput in)
           
 void removedFrom(Cache removedFrom, java.lang.Object key)
           
 void setCurrentSize(int byteSize)
           
 void setLock(Lock to)
           
 int size()
           
 java.lang.String toString()
           
 void touch()
           
protected  void unregister()
           
 void updateLockLevel(Transaction ta)
          Note: This method must not be synchronized.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class org.ozoneDB.core.storage.wizardStore.WizardCluster
addPinCount, clearPinCount, deleteShadow, isPinned, pin, registerContainer, removeContainer, restoreShadow, saveShadow, unpin
 
Methods inherited from class org.ozoneDB.core.storage.AbstractCluster
containerForID, containers, env, permissions, setClusterStore, setEnv
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
See Also:
Constant Field Values

subSerialVersionUID

protected static final byte subSerialVersionUID
See Also:
Constant Field Values

lock

protected transient MROWLock lock

lastTouched

protected transient long lastTouched

bytesPerContainer

protected transient int bytesPerContainer

modTime

protected long modTime
Constructor Detail

MagicCluster

public MagicCluster()
Constructor to be used for Externalizable object serialisation.


MagicCluster

public MagicCluster(ClusterID _clusterID,
                    Permissions _permissions,
                    MROWLock lock,
                    int _bpc)
Method Detail

addedTo

public void addedTo(Cache addedTo,
                    java.lang.Object key)

removedFrom

public void removedFrom(Cache removedFrom,
                        java.lang.Object key)

delete

public void delete()
            throws java.lang.Exception
Description copied from class: WizardCluster
Delete this cluster from the disk.

Specified by:
delete in interface Cluster
Overrides:
delete in class WizardCluster
Throws:
java.lang.Exception

unregister

protected void unregister()

finalize

protected void finalize()

modTime

public long modTime()
Specified by:
modTime in interface Cluster
Overrides:
modTime in class WizardCluster

cachePriority

public DxLong cachePriority()
Priority of this cluster to stay in the cluster cache. Low return value means low priority.

Specified by:
cachePriority in interface Cluster
Overrides:
cachePriority in class WizardCluster
Returns:
Cache priority of the cluster.

setCurrentSize

public void setCurrentSize(int byteSize)
Specified by:
setCurrentSize in interface Cluster
Overrides:
setCurrentSize in class WizardCluster

size

public int size()
Specified by:
size in interface Cluster
Overrides:
size in class WizardCluster

clusterID

public ClusterID clusterID()
Specified by:
clusterID in interface Cluster
Overrides:
clusterID in class AbstractCluster

isInvoked

public boolean isInvoked()
Overrides:
isInvoked in class WizardCluster
Returns:
True if at least one container is currently invoked.

touch

public void touch()
Specified by:
touch in interface Cluster
Overrides:
touch in class WizardCluster

updateLockLevel

public void updateLockLevel(Transaction ta)
                     throws java.io.IOException
Note: This method must not be synchronized.

Specified by:
updateLockLevel in interface Cluster
Overrides:
updateLockLevel in class WizardCluster
Parameters:
ta -
Throws:
java.io.IOException

prepareCommit

public void prepareCommit(Transaction ta)
Specified by:
prepareCommit in interface Cluster
Overrides:
prepareCommit in class WizardCluster

commit

public void commit(Transaction ta)
            throws java.io.IOException
Specified by:
commit in interface Cluster
Overrides:
commit in class WizardCluster
Throws:
java.io.IOException

abort

public void abort(Transaction ta)
           throws java.io.IOException
Specified by:
abort in interface Cluster
Overrides:
abort in class WizardCluster
Throws:
java.io.IOException

allLockers

public DxCollection allLockers()
Specified by:
allLockers in interface Cluster
Overrides:
allLockers in class WizardCluster

toString

public java.lang.String toString()
Overrides:
toString in class WizardCluster

lock

public Lock lock()
Specified by:
lock in interface Cluster
Overrides:
lock in class WizardCluster

setLock

public void setLock(Lock to)
Specified by:
setLock in interface Cluster
Overrides:
setLock in class WizardCluster

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class WizardCluster
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.io.ObjectStreamException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class WizardCluster
Throws:
java.io.IOException
java.io.ObjectStreamException
java.lang.ClassNotFoundException

ozone core API

Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.