|
||||||||||
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. GeneralStorable
public 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 Bucket
s. 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 Bucket s, if possible. |
boolean |
contains(Data element)
|
Bucket<Data> |
getBucket(int bucketId)
|
AbstractHashFunction |
getHashFunction()
returns the AbstractHashFunction for mapping keys to Bucket s. |
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 AbstractKVStorable
hashFunction
- 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
Bucket
s, if possible. If all Bucket
s are full the method is
blocking.
toAdd
- the data to add
BucketContainerException
java.lang.InterruptedException
public 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.InterruptedException
public boolean contains(Data element)
element
-
public AbstractHashFunction getHashFunction()
AbstractHashFunction
for mapping keys to Bucket
s.
AbstractHashFunction
public void shutdown()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |