C
- type of the keys that this bucket's objects are ordered bypublic final class VirtualStorageBucket<C> extends OrderedLocalBucket<C>
counterBucketAddObject, counterBucketDelObject, counterBucketRead
Constructor and Description |
---|
VirtualStorageBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes,
ModifiableOrderedIndex<C,LocalAbstractObject> index)
Creates a new instance of VirtualStorageBucket.
|
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Destroy this bucket.
|
void |
finalize()
Finalize this bucket.
|
static VirtualStorageBucket<?> |
getBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a bucket.
|
static <T> VirtualStorageBucket<T> |
getBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes,
Storage<LocalAbstractObject> storage,
IndexComparator<T,LocalAbstractObject> comparator)
Creates a bucket for the given storage and comparator.
|
protected ModifiableOrderedIndex<C,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
public VirtualStorageBucket(long capacity, long softCapacity, long lowOccupation, boolean occupationAsBytes, ModifiableOrderedIndex<C,LocalAbstractObject> index)
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 objectsindex
- the index to encapsulatepublic 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 cleaningprotected ModifiableOrderedIndex<C,LocalAbstractObject> getModifiableIndex()
LocalBucket
getModifiableIndex
in class OrderedLocalBucket<C>
public static VirtualStorageBucket<?> getBucket(long capacity, long softCapacity, long lowOccupation, boolean occupationAsBytes, java.util.Map<java.lang.String,java.lang.Object> parameters) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.ClassNotFoundException
IndexComparator
IndexComparator
LocalAbstractObjectOrder
Note that one of the comparatorInstance, comparatorClass, localAbstractObjectOrder
parameters must be specified in order to be able to create an index comparator.
If a storage should be used in internal order, use PlainStorageBucket
instead.
Note that additional parameters may be required according to the specified storageClass. See the documentation of that storage.
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 objectsparameters
- list of named parameters (see above)java.io.IOException
- if something goes wrong when working with the filesystemjava.lang.IllegalArgumentException
- if the parameters specified are invalid (non existent directory, null values, etc.)java.lang.ClassNotFoundException
- if the parameter class could not be resolved or is not a descendant of LocalAbstractObjectpublic static <T> VirtualStorageBucket<T> getBucket(long capacity, long softCapacity, long lowOccupation, boolean occupationAsBytes, Storage<LocalAbstractObject> storage, IndexComparator<T,LocalAbstractObject> comparator) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.ClassNotFoundException
T
- type of the keys that the new bucket's objects will be ordered bycapacity
- 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 objectsstorage
- the underlying storage for object persistencecomparator
- the comparator that imposes order on the indexed objectsjava.io.IOException
- if something goes wrong when working with the filesystemjava.lang.IllegalArgumentException
- if the parameters specified are invalid (non existent directory, null values, etc.)java.lang.ClassNotFoundException
- if the parameter class could not be resolved or is not a descendant of LocalAbstractObject