net.obsearch.index.bucket
Interface BucketContainer<O extends OB,B extends BucketObject,Q>

Type Parameters:
O - OB object.
B - The bucket that will be employed.
All Known Implementing Classes:
AbstractBucketContainerByte, AbstractBucketContainerDouble, AbstractBucketContainerFloat, AbstractBucketContainerInt, AbstractBucketContainerLong, AbstractBucketContainerShort, BucketContainerByte, BucketContainerDouble, BucketContainerFloat, BucketContainerInt, BucketContainerLong, BucketContainerShort, SleekBucketByte, SleekBucketDouble, SleekBucketFloat, SleekBucketInt, SleekBucketLong, SleekBucketShort

public interface BucketContainer<O extends OB,B extends BucketObject,Q>

A BucketContainer stores SMAP vectors of objects. It is possible to search, add and remove objects stored here.

Author:
Arnoldo Jose Muller Molina

Method Summary
 OperationStatus delete(B bucket, O object)
          Deletes the given object from this BucketContainer.
 OperationStatus exists(B bucket, O object)
          Returns true if the object and its bucket definition exist in this container
 List<B> getObjects()
          Return the object list!
 int getPivots()
          # of pivots for this container.
 OperationStatus insert(B bucket, O object)
          Inserts the given object with the given bucket details to this bucket.
 OperationStatus insertBulk(B bucket, O object)
          Inserts the given object with the given bucket details to this bucket.
 boolean isModified()
          Return true if the bucket has been modified since it was instantiated.
 void search(AbstractOBQuery<O> q, B bucket, Filter<O> filter, Statistics stats)
          Same as search(AbstractOBQuery, BucketObject, Filter, Statistics) but it forces the query AbstractOBQuery into the correct type.
 void search(Q query, B bucket, ByteBuffer b, Filter<O> filter, Statistics stats)
          Match the given query and bucket but only for one record found in b.
 void search(Q query, B bucket, Filter<O> filter, Statistics stats)
          Searches the given object with the given searchContainer parameters.
 byte[] serialize()
          Serialize the bucket
 void setKey(byte[] key)
          Sets the key (bucket id) of a bucket container
 void setPivots(int pivots)
          Sets the # of pivots for this container.
 int size()
          # of objects in this container.
 

Method Detail

delete

OperationStatus delete(B bucket,
                       O object)
                       throws OBException,
                              IllegalIdException,
                              IllegalAccessException,
                              InstantiationException
Deletes the given object from this BucketContainer.

Parameters:
bucket - This will should match this bucket's id. Used to pass additional information such as the SMAP vector
object - The object that will be deleted.
Returns:
Status.OK and the deleted object's id if the object was found and successfully deleted. Status.NOT_EXISTS if the object is not in the database.
Throws:
OBException
IllegalIdException
IllegalAccessException
InstantiationException

insert

OperationStatus insert(B bucket,
                       O object)
                       throws OBException,
                              IllegalIdException,
                              IllegalAccessException,
                              InstantiationException
Inserts the given object with the given bucket details to this bucket. Warning: This method assumes that object does not exist in the DB. In bucket, an id will be provided by the caller.

Parameters:
bucket - This will should match this bucket's id. Used to pass additional information such as the SMAP vector.
Returns:
If Status.OK or Status.EXISTS then the result will hold the id of the inserted object and the operation is successful.
Throws:
OBException
IllegalIdException
IllegalAccessException
InstantiationException

insertBulk

OperationStatus insertBulk(B bucket,
                           O object)
                           throws OBException,
                                  IllegalIdException,
                                  IllegalAccessException,
                                  InstantiationException
Inserts the given object with the given bucket details to this bucket. No existence checks are performed, we believe the caller each object is unique or the caller does not care about uniqueness.

Parameters:
bucket - This will should match this bucket's id. Used to pass additional information such as the SMAP vector.
Returns:
Status.OK
Throws:
OBException
IllegalIdException
IllegalAccessException
InstantiationException

getObjects

List<B> getObjects()
Return the object list!

Returns:

exists

OperationStatus exists(B bucket,
                       O object)
                       throws OBException,
                              IllegalIdException,
                              IllegalAccessException,
                              InstantiationException
Returns true if the object and its bucket definition exist in this container

Parameters:
bucket - The bucket associated to object
object - The object that will be inserted
Returns:
true if object exists in this container.
Throws:
OBException
com.sleepycat.je.DatabaseException
IllegalIdException
IllegalAccessException
InstantiationException

search

void search(Q query,
            B bucket,
            ByteBuffer b,
            Filter<O> filter,
            Statistics stats)
            throws IllegalAccessException,
                   OBException,
                   InstantiationException,
                   IllegalIdException
Match the given query and bucket but only for one record found in b.

Parameters:
query - The search parameters (range, priority queue with the closest elements)
bucket - The bucket of the given object.
object - The object that will be searched.
filter - Filter to be employed.
Throws:
IllegalAccessException
OBException
InstantiationException
IllegalIdException

search

void search(Q query,
            B bucket,
            Filter<O> filter,
            Statistics stats)
            throws IllegalAccessException,
                   OBException,
                   InstantiationException,
                   IllegalIdException
Searches the given object with the given searchContainer parameters. The searchContainer will be updated as necessary.

Parameters:
query - The search parameters (range, priority queue with the closest elements)
bucket - The bucket of the given object.
object - The object that will be searched.
filter - Filter to be employed.
Throws:
IllegalAccessException
OBException
InstantiationException
IllegalIdException

search

void search(AbstractOBQuery<O> q,
            B bucket,
            Filter<O> filter,
            Statistics stats)
            throws IllegalAccessException,
                   OBException,
                   InstantiationException,
                   IllegalIdException
Same as search(AbstractOBQuery, BucketObject, Filter, Statistics) but it forces the query AbstractOBQuery into the correct type.

Parameters:
q -
bucket -
stats -
Throws:
IllegalAccessException
com.sleepycat.je.DatabaseException
OBException
InstantiationException
IllegalIdException

size

int size()
         throws OBException
# of objects in this container.

Returns:
The # of objects in this container.
Throws:
OBException

getPivots

int getPivots()
# of pivots for this container.

Returns:

setPivots

void setPivots(int pivots)
Sets the # of pivots for this container.


setKey

void setKey(byte[] key)
Sets the key (bucket id) of a bucket container

Parameters:
key -

serialize

byte[] serialize()
                 throws OBException
Serialize the bucket

Throws:
OBException

isModified

boolean isModified()
Return true if the bucket has been modified since it was instantiated.

Returns:
true if the bucket has been modified since it was instantiated.


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.