messif.buckets.impl
Class MemoryStorageBucket
java.lang.Object
messif.buckets.Bucket
messif.buckets.LocalBucket
messif.buckets.impl.MemoryStorageBucket
- All Implemented Interfaces:
- java.io.Serializable, ObjectProvider<LocalAbstractObject>
public class MemoryStorageBucket
- extends LocalBucket
- implements java.io.Serializable
A volatile implementation of LocalBucket
.
It stores all objects in a memory storage
and no index is provided for the objects.
- See Also:
BucketDispatcher
,
LocalBucket
,
Serialized Form
Constructor Summary |
MemoryStorageBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes)
Constructs a new MemoryStorageBucket instance. |
Methods inherited from class messif.buckets.LocalBucket |
addObject, addObject, addObjectErrCode, deleteAllObjects, deleteObject, deleteObject, deleteObject, deregisterFilter, getAllObjects, getBucketID, getCapacity, getFilter, getIndex, getLowOccupation, getObject, getObject, getObject, getObjectCount, getOccupation, getOccupationRatio, getSoftCapacity, isBucketStandalone, isSoftCapacityExceeded, registerFilter, setLowOccupation, setSoftCapacity, toString |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
objects
protected final ModifiableIndex<LocalAbstractObject> objects
- Object storage
MemoryStorageBucket
public MemoryStorageBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes)
- Constructs a new MemoryStorageBucket instance.
It uses an
MemoryStorage
to actually strore the objects.
- Parameters:
capacity
- maximal capacity of the bucket - cannot be exceededsoftCapacity
- maximal soft capacity of the bucketlowOccupation
- a minimal occupation for deleting objects - cannot be loweredoccupationAsBytes
- flag whether the occupation (and thus all the limits) are in bytes or number of objects
getModifiableIndex
protected ModifiableIndex<LocalAbstractObject> getModifiableIndex()
- Description copied from class:
LocalBucket
- Returns the index (including storage) for this bucket.
The index provides the access to the underlying storage of objects in this bucket.
- Specified by:
getModifiableIndex
in class LocalBucket
- Returns:
- the index for this bucket
finalize
public void finalize()
throws java.lang.Throwable
- Description copied from class:
LocalBucket
- Finalize this bucket. All transient resources associated with this
bucket are released.
After this method is called, the bucket methods' behavior is unpredictable.
This method is called by the
BucketDispatcher
when it is finalized.
- Overrides:
finalize
in class LocalBucket
- Throws:
java.lang.Throwable
- if there was an error while cleaning
destroy
public void destroy()
throws java.lang.Throwable
- Description copied from class:
LocalBucket
- Destroy this bucket. This method releases all resources (transient and persistent)
associated with this bucket (e.g. the statistics and all objects are deleted).
After this method is called, the bucket methods' behavior is unpredictable.
This method is called by the
BucketDispatcher
when the bucket is removed
from the dispatcher.
- Overrides:
destroy
in class LocalBucket
- Throws:
java.lang.Throwable
- if there was an error while cleaning