ozone core API

org.ozoneDB.core.storage.gammaStore
Class GammaTransaction

java.lang.Object
  extended byorg.ozoneDB.core.Transaction
      extended byorg.ozoneDB.core.storage.gammaStore.GammaTransaction
All Implemented Interfaces:
Locker

public class GammaTransaction
extends Transaction

Version:
$Id: GammaTransaction.java,v 1.3 2004/01/03 10:39:41 per_nyfelt Exp $
Author:
Leo Mekenkamp (mind the anti sp@m)

Field Summary
private  java.util.LinkedHashMap changedObjectIds
          An unlimited number of objects might be changed during any transaction.
private  Cache containerCache
          Transactions have their own private cache.
private static float FIXME_LOADFACTOR_OBJECT_IDS
           
private static int FIXME_MAX_OBJECT_IDS
           
private  GammaStore gammaStore
           
private static java.lang.String LOGPOSTFIX
           
private  Storage logStorage
           
 
Fields inherited from class org.ozoneDB.core.Transaction
acquireCount, blocker, blockTimeout, callStack, commandCount, deadlocked, deadlockWaitTimeMaximum, deadlockWaitTimeMaximumMaximum, deadlockWaitTimeMaximumMinimum, env, HASHTABLE_INIT_SIZE, maxLockLevel, owner, ownerName, rollbackOnly, sleeping, startTime, status, STATUS_ABORTED, STATUS_ABORTING, STATUS_COMMITED, STATUS_COMMITING, STATUS_NONE, STATUS_PREPARED, STATUS_PREPARING, STATUS_STARTED, stopped, taID
 
Constructor Summary
GammaTransaction(GammaStore gammaStore, StorageFactory logStorageFactory, Env env, User owner)
           
 
Method Summary
protected  ObjectContainer acquireContainer(ObjectContainer container, int lockLevel)
          Blatantly stolen from org.ozoneDB.core.Transaction.
 ObjectContainer createObject(java.lang.String className, int access, java.lang.String name, java.lang.String sig, java.lang.Object[] args, ObjectID id)
          Create a new database object.
 void deleteObject(ObjectID id)
           
(package private)  Cache getContainerCache()
           
private  GammaStore getGammaStore()
           
(package private)  Storage getLogStorage()
           
 java.lang.Object invokeObject(ObjectID id, int methodIndex, java.lang.Object[] args, int lockLevel)
           
 java.lang.Object invokeObject(ObjectID id, java.lang.String methodName, java.lang.String sig, java.lang.Object[] args, int lockLevel)
           
(package private)  java.lang.String logFilename()
           
 void nameObject(ObjectID id, java.lang.String name)
           
private  void setGammaStore(GammaStore gammaStore)
           
private  void setLogStorage(Storage logStorage)
           
 
Methods inherited from class org.ozoneDB.core.Transaction
abort, acquireObject, blockedBy, callOnActivateIfNeeded, callOnPassivateIfNeeded, commit, copyObject, equals, finalize, getCallStack, getDeadlockWaitTimeMaximum, getManager, increaseDeadlockWaitTimeMaximum, isBlocked, isDeadlocked, isSleeping, maxLockLevel, objectForID, objectForName, objectNames, owner, performCommand, prepareCommit, releaseObject, requireWriteLockingCallByUser, reset, setDeadlocked, setDeadlockWaitTimeMaximum, sleep, status, stop, taID, toString
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FIXME_MAX_OBJECT_IDS

private static final int FIXME_MAX_OBJECT_IDS
See Also:
Constant Field Values

FIXME_LOADFACTOR_OBJECT_IDS

private static final float FIXME_LOADFACTOR_OBJECT_IDS
See Also:
Constant Field Values

LOGPOSTFIX

private static final java.lang.String LOGPOSTFIX
See Also:
Constant Field Values

gammaStore

private GammaStore gammaStore

logStorage

private Storage logStorage

containerCache

private Cache containerCache
Transactions have their own private cache. Should be a WeakReferenceCache because GammaStore has the last say in which objects should be cached. Having its own cache means this tx can find out when containers are no longer in memory. When a container is swapped out it can (through a shadow remover specified in this tx) write its object id to the log of this tx.


changedObjectIds

private java.util.LinkedHashMap changedObjectIds
An unlimited number of objects might be changed during any transaction. It is impossible to keep track of all object ids in memory, instead this LinkedHashMap is used to keep the MRU in memory, while writing the LRU out to disk. We could use a LinkedHashSet instead (since we only use the keys, and not the values

Constructor Detail

GammaTransaction

public GammaTransaction(GammaStore gammaStore,
                        StorageFactory logStorageFactory,
                        Env env,
                        User owner)
Method Detail

logFilename

java.lang.String logFilename()

acquireContainer

protected ObjectContainer acquireContainer(ObjectContainer container,
                                           int lockLevel)
                                    throws PermissionError,
                                           org.ozoneDB.TransactionException,
                                           TransactionError,
                                           java.io.IOException,
                                           org.ozoneDB.ObjectNotFoundException,
                                           java.lang.ClassNotFoundException
Blatantly stolen from org.ozoneDB.core.Transaction. Removed code dependent on WizardStore

Overrides:
acquireContainer in class Transaction
Throws:
PermissionError
org.ozoneDB.TransactionException
TransactionError
java.io.IOException
org.ozoneDB.ObjectNotFoundException
java.lang.ClassNotFoundException

getGammaStore

private GammaStore getGammaStore()

setGammaStore

private void setGammaStore(GammaStore gammaStore)

getContainerCache

Cache getContainerCache()

createObject

public ObjectContainer createObject(java.lang.String className,
                                    int access,
                                    java.lang.String name,
                                    java.lang.String sig,
                                    java.lang.Object[] args,
                                    ObjectID id)
                             throws java.lang.Exception,
                                    org.ozoneDB.OzoneObjectException
Description copied from class: Transaction
Create a new database object. If the className is null, an empty container is created.

Overrides:
createObject in class Transaction
Parameters:
className -
access -
name -
id - The ID of the new container or null.
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

invokeObject

public java.lang.Object invokeObject(ObjectID id,
                                     java.lang.String methodName,
                                     java.lang.String sig,
                                     java.lang.Object[] args,
                                     int lockLevel)
                              throws java.lang.Exception,
                                     org.ozoneDB.OzoneObjectException
Overrides:
invokeObject in class Transaction
Parameters:
id -
methodName -
sig -
lockLevel -
Returns:
the result of the invocation
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

invokeObject

public java.lang.Object invokeObject(ObjectID id,
                                     int methodIndex,
                                     java.lang.Object[] args,
                                     int lockLevel)
                              throws java.lang.Exception,
                                     org.ozoneDB.OzoneObjectException
Overrides:
invokeObject in class Transaction
Throws:
java.lang.Exception
org.ozoneDB.OzoneObjectException

nameObject

public void nameObject(ObjectID id,
                       java.lang.String name)
                throws java.lang.Exception
Overrides:
nameObject in class Transaction
Throws:
java.lang.Exception

deleteObject

public void deleteObject(ObjectID id)
                  throws org.ozoneDB.ObjectNotFoundException,
                         java.io.IOException,
                         java.lang.ClassNotFoundException,
                         org.ozoneDB.TransactionException,
                         TransactionError,
                         org.ozoneDB.OzoneRemoteException,
                         org.ozoneDB.OzoneInternalException,
                         org.ozoneDB.OzoneObjectException
Overrides:
deleteObject in class Transaction
Throws:
org.ozoneDB.ObjectNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
org.ozoneDB.TransactionException
TransactionError
org.ozoneDB.OzoneRemoteException
org.ozoneDB.OzoneInternalException
org.ozoneDB.OzoneObjectException

getLogStorage

Storage getLogStorage()

setLogStorage

private void setLogStorage(Storage logStorage)

ozone core API

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