public class MemoryStorageLocatorBucket extends OrderedLocalBucket<java.lang.String> implements java.io.Serializable
LocalBucket
.
It stores all objects in a memory storage
.
Objects are indexed by their object locators
and
iterator will return the objects ordered.
This bucket has an efficient LocalBucket.getObject(java.lang.String)
implementation
at the cost of additional memory overhead for maintaining the index.
If fast getObject
implementation is not required and
the iteration over all objects is used frequently, consider using
MemoryStorageBucket
.
BucketDispatcher
,
LocalBucket
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected ModifiableOrderedIndex<java.lang.String,LocalAbstractObject> |
objects
Object storage with object-id index
|
counterBucketAddObject, counterBucketDelObject, counterBucketRead
Constructor and Description |
---|
MemoryStorageLocatorBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes)
Constructs a new instance of MemoryStorageLocatorBucket.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy this bucket.
|
void |
finalize()
Finalize this bucket.
|
protected ModifiableOrderedIndex<java.lang.String,LocalAbstractObject> |
getModifiableIndex()
Returns the index (including storage) for this bucket.
|
getIndex
addObject, addObject, addObjectErrCode, deleteAllObjects, deleteObject, deleteObject, deleteObject, deleteObjects, deregisterFilter, getAllObjects, getBucketID, getCapacity, getFilter, getLowOccupation, getObject, getObject, getObjectCount, getOccupation, getOccupationRatio, getSoftCapacity, isBucketStandalone, isSoftCapacityExceeded, registerFilter, setLowOccupation, setSoftCapacity, toString
addObjects, addObjects, deleteObject, deleteObject, processQuery, provideObjects, split
protected ModifiableOrderedIndex<java.lang.String,LocalAbstractObject> objects
public MemoryStorageLocatorBucket(long capacity, long softCapacity, long lowOccupation, boolean occupationAsBytes)
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 objectsprotected ModifiableOrderedIndex<java.lang.String,LocalAbstractObject> getModifiableIndex()
LocalBucket
getModifiableIndex
in class OrderedLocalBucket<java.lang.String>
public void finalize() throws java.lang.Throwable
LocalBucket
BucketDispatcher
when it is finalized.finalize
in class LocalBucket
java.lang.Throwable
- if there was an error while cleaningpublic void destroy() throws java.lang.Throwable
LocalBucket
BucketDispatcher
when the bucket is removed
from the dispatcher.destroy
in class LocalBucket
java.lang.Throwable
- if there was an error while cleaning