|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.unister.semweb.drums.bucket.BucketContainer<Data>
Data - an implementation of AbstractKVStorable, e.g. GeneralStorablepublic class BucketContainer<Data extends AbstractKVStorable>
This class handles AbstractKVStorable-objects in memory. Depending on the given AbstractHashFunction,
the BucketContainer distributes incoming data to a defined number of Buckets. This class is allowed
to use the by DRUMSParameterSet.BUCKET_MEMORY defined amount of memory.
| Constructor Summary | |
|---|---|
BucketContainer(Bucket<Data>[] buckets,
AbstractHashFunction hashFunction)
|
|
| Method Summary | |
|---|---|
void |
addToCache(Data... toAdd)
Add the given records to the Buckets, if possible. |
boolean |
contains(Data element)
|
Bucket<Data> |
getBucket(int bucketId)
|
AbstractHashFunction |
getHashFunction()
returns the AbstractHashFunction for mapping keys to Buckets. |
int |
getNumberOfBuckets()
|
void |
setBucket(Bucket<Data> bucket)
sets a new bucket. |
void |
shutdown()
This method initializes the shutdown of this BucketContainer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BucketContainer(Bucket<Data>[] buckets,
AbstractHashFunction hashFunction)
buckets - the buckets, where to store the AbstractKVStorablehashFunction - the AbstractHashFunction is used to map from the key of a AbstractKVStorable-object to
the relevant Bucket| Method Detail |
|---|
public void addToCache(Data... toAdd)
throws BucketContainerException,
java.lang.InterruptedException
Buckets, if possible. If all Buckets are full the method is
blocking.
toAdd - the data to add
BucketContainerException
java.lang.InterruptedExceptionpublic int getNumberOfBuckets()
public Bucket<Data> getBucket(int bucketId)
bucketId -
public void setBucket(Bucket<Data> bucket)
throws BucketContainerException,
java.lang.InterruptedException
Bucket-object
bucket - the Bucket-object to add
BucketContainerException
java.lang.InterruptedExceptionpublic boolean contains(Data element)
element -
public AbstractHashFunction getHashFunction()
AbstractHashFunction for mapping keys to Buckets.
AbstractHashFunctionpublic void shutdown()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||