|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.buckets.Bucket
messif.buckets.LocalBucket
messif.buckets.impl.DiskBlockBucket
public class DiskBlockBucket
A disk-oriented implementation of LocalBucket
.
It stores all objects in a specified blocks of a file.
The storage is persistent, even if the process using this bucket
quits, the bucket can be opened afterwards.
Note that this bucket only saves the name of the file when serialized,
thus the file must exist when the bucket is deserialized.
BucketDispatcher
,
LocalBucket
,
DiskBlockObjectKeyBucket
,
Serialized FormField Summary | |
---|---|
protected static java.lang.String |
FILENAME_PREFIX
The prefix for auto-generated filenames |
protected static java.lang.String |
FILENAME_SUFFIX
The suffix for auto-generated filenames |
protected ModifiableIndex<LocalAbstractObject> |
objects
Object storage |
Fields inherited from class messif.buckets.LocalBucket |
---|
counterBucketAddObject, counterBucketDelObject, counterBucketRead |
Constructor Summary | |
---|---|
DiskBlockBucket(long capacity,
long softCapacity,
long lowOccupation,
java.io.File file)
Constructs a new DiskBlockBucket instance with 16k direct-buffered input. |
|
DiskBlockBucket(long capacity,
long softCapacity,
long lowOccupation,
java.io.File file,
int bufferSize,
boolean directBuffers,
boolean memoryMap,
BinarySerializator serializator)
Constructs a new DiskBlockBucket instance. |
Method Summary | |
---|---|
void |
destroy()
Destroy this bucket. |
void |
finalize()
Finalize this bucket. |
static DiskBlockBucket |
getBucket(long capacity,
long softCapacity,
long lowOccupation,
boolean occupationAsBytes,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Creates a bucket. |
protected ModifiableIndex<LocalAbstractObject> |
getModifiableIndex()
Returns the index (including storage) for this bucket. |
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 messif.buckets.Bucket |
---|
addObjects, addObjects, deleteObject, deleteObjects, processQuery, provideObjects, split |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String FILENAME_PREFIX
protected static final java.lang.String FILENAME_SUFFIX
protected final ModifiableIndex<LocalAbstractObject> objects
Constructor Detail |
---|
public DiskBlockBucket(long capacity, long softCapacity, long lowOccupation, java.io.File file) throws java.io.IOException
MultiClassSerializator
is used to serialize objects and
the occupation is counted in bytes.
capacity
- maximal capacity of the bucket - cannot be exceededsoftCapacity
- maximal soft capacity of the bucketlowOccupation
- a minimal occupation for deleting objects - cannot be loweredfile
- the file where the bucket will be stored
java.io.IOException
- if there was a problem opening or creating the bucket filepublic DiskBlockBucket(long capacity, long softCapacity, long lowOccupation, java.io.File file, int bufferSize, boolean directBuffers, boolean memoryMap, BinarySerializator serializator) throws java.io.IOException
capacity
- maximal capacity of the bucket - cannot be exceededsoftCapacity
- maximal soft capacity of the bucketlowOccupation
- a minimal occupation for deleting objects - cannot be loweredfile
- the file where the bucket will be storedbufferSize
- the size of the buffer used for I/O operationsdirectBuffers
- flag whether to use the direct buffers
memoryMap
- flag whether to use memory-mapped I/Oserializator
- the binary serializator
used to store objects
java.io.IOException
- if there was a problem opening or creating the bucket fileMethod Detail |
---|
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 cleaningpublic static DiskBlockBucket 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.InstantiationException, java.lang.ClassNotFoundException
DiskStorage.create(java.lang.Class, java.util.Map)
.
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 filesystem
java.lang.InstantiationException
- 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 LocalAbstractObjectprotected ModifiableIndex<LocalAbstractObject> getModifiableIndex()
LocalBucket
getModifiableIndex
in class LocalBucket
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |