|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.core.ServerComponent
org.ozoneDB.core.storage.magicStore.MagicStore
Field Summary | |
protected ClusterStore |
clusterStore
|
protected static java.lang.String |
COMMIT_FLAG_NAME
|
protected GarbageCollector |
garbageCollector
The garbage collector. |
protected static java.lang.String |
ID_TABLE_NAME
|
protected DxMap |
idTable
Maps ObjectIDs to ClusterIDs |
protected static java.lang.String |
NAME_TABLE_NAME
|
protected DxMap |
nameTable
Maps names to ObjectIDs |
Fields inherited from class org.ozoneDB.core.ServerComponent |
env |
Constructor Summary | |
MagicStore(Env env)
|
Method Summary | |
void |
abortTransaction(Transaction ta)
|
protected void |
beginCommit(Transaction ta)
|
DxBag |
clusterOfID(ObjectID id)
Force the Store to make a guess which objects are used together with the container with the specified id. |
protected void |
commitIDTable()
|
protected void |
commitNameTable()
|
void |
commitTransaction(Transaction ta)
|
ObjectContainer |
containerForID(Transaction ta,
ObjectID id)
Returns the ObjectContainer for the given ObjectID or null if there is no such container. |
ObjectContainer |
containerForName(Transaction ta,
java.lang.String name)
|
Transaction |
createTransaction(Env env,
User user)
Factory method for creating a new Transaction . |
protected void |
endCommit(Transaction ta)
|
void |
init(Env _env)
Aid constructor, because a store is instantiated with 'newInstance', where we've got no arguments. |
protected boolean |
isCleanShutdown()
|
void |
nameContainer(Transaction ta,
ObjectContainer container,
java.lang.String name)
|
ObjectContainer |
newContainerAndLock(Transaction ta,
org.ozoneDB.OzoneCompatible target,
ObjectID objID,
Permissions permissions,
int lockLevel)
Creates a new object container and initializes it with the specified target object. |
DxIterator |
objectIDIterator()
|
DxSet |
objectNames(Transaction ta)
|
void |
prepareCommitTransaction(Transaction ta)
Prepare the specified transaction for commit. |
protected void |
recover()
Fill idTable and nameTable from the information that are stored in the clusters directly. |
void |
reportNamedObjectsToGarbageCollector()
Tells this StoreManager to report every named object to the garbage collector. |
void |
save()
Save the internal state in the state to the server state properties. |
void |
shutdown()
|
void |
startup()
Start up and load the internal state from the server state properties. |
void |
updateLockLevel(Transaction _ta,
ObjectContainer _container)
Update lock level of the given container according to the leve of the containers lock object. |
Methods inherited from class org.ozoneDB.core.ServerComponent |
clearChanged, hasChanged, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final java.lang.String ID_TABLE_NAME
protected static final java.lang.String NAME_TABLE_NAME
protected static final java.lang.String COMMIT_FLAG_NAME
protected DxMap idTable
protected DxMap nameTable
protected ClusterStore clusterStore
protected GarbageCollector garbageCollector
Constructor Detail |
public MagicStore(Env env)
Method Detail |
public void init(Env _env)
StoreManager
init
in interface StoreManager
public void startup() throws java.lang.Exception
ServerComponent
startup
in interface StoreManager
startup
in class ServerComponent
java.lang.Exception
public void shutdown() throws java.lang.Exception
shutdown
in interface StoreManager
shutdown
in class ServerComponent
java.lang.Exception
public void save() throws java.lang.Exception
ServerComponent
save
in class ServerComponent
java.lang.Exception
public DxIterator objectIDIterator()
objectIDIterator
in interface StoreManager
protected void commitNameTable() throws java.io.IOException
java.io.IOException
protected void commitIDTable() throws java.io.IOException
java.io.IOException
protected void recover() throws java.lang.Exception
java.lang.Exception
- If a cluster cannot be read.public ObjectContainer newContainerAndLock(Transaction ta, org.ozoneDB.OzoneCompatible target, ObjectID objID, Permissions permissions, int lockLevel) throws java.lang.Exception
StoreManager
newContainerAndLock
in interface StoreManager
ta
- target
- objID
- permissions
- lockLevel
-
java.lang.Exception
public void updateLockLevel(Transaction _ta, ObjectContainer _container) throws java.io.IOException
StoreManager
updateLockLevel
in interface StoreManager
java.io.IOException
public ObjectContainer containerForID(Transaction ta, ObjectID id) throws org.ozoneDB.ObjectNotFoundException, java.io.IOException, java.lang.ClassNotFoundException
containerForID
in interface StoreManager
ta
- the Transaction for within the container is requested or null.
Impl. Note: For performance reasons this is the only method of this Store
that is not synchronized. This will not cause problems because the only
field that is updated inside the method (currentContainer) does not need
to be stable while this method is running.
org.ozoneDB.ObjectNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public DxSet objectNames(Transaction ta)
objectNames
in interface StoreManager
ta
- the running transaction
public ObjectContainer containerForName(Transaction ta, java.lang.String name) throws java.lang.Exception
containerForName
in interface StoreManager
name
- The object name to search for.ta
-
java.lang.Exception
public void nameContainer(Transaction ta, ObjectContainer container, java.lang.String name) throws org.ozoneDB.PermissionDeniedException
nameContainer
in interface StoreManager
ta
- container
- name
-
org.ozoneDB.PermissionDeniedException
public DxBag clusterOfID(ObjectID id) throws java.lang.Exception
StoreManager
clusterOfID
in interface StoreManager
id
- The ObjectID if the container.
java.lang.Exception
public void prepareCommitTransaction(Transaction ta) throws java.io.IOException, java.lang.ClassNotFoundException
StoreManager
The TransactionManager
let this method run exclusivly. However,
StoreManager.prepareCommitTransaction(org.ozoneDB.core.Transaction)
and StoreManager.commitTransaction(org.ozoneDB.core.Transaction)
are not
an atomar operation.
prepareCommitTransaction
in interface StoreManager
ta
- Transaction that will be commited.
java.io.IOException
java.lang.ClassNotFoundException
protected boolean isCleanShutdown()
protected void beginCommit(Transaction ta) throws java.io.IOException
java.io.IOException
protected void endCommit(Transaction ta) throws java.io.IOException
java.io.IOException
public void commitTransaction(Transaction ta) throws java.io.IOException, java.lang.ClassNotFoundException
commitTransaction
in interface StoreManager
java.io.IOException
java.lang.ClassNotFoundException
public void abortTransaction(Transaction ta) throws java.io.IOException, java.lang.ClassNotFoundException
abortTransaction
in interface StoreManager
ta
- ID of the comitting transaction.
java.io.IOException
java.lang.ClassNotFoundException
public void reportNamedObjectsToGarbageCollector()
reportNamedObjectsToGarbageCollector
in interface StoreManager
public Transaction createTransaction(Env env, User user)
StoreManager
Transaction
.
createTransaction
in interface StoreManager
|
ozone core API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |