net.obsearch.index.bucket.sleek
Class SleekBucketDouble<O extends OBDouble>

java.lang.Object
  extended by net.obsearch.index.bucket.sleek.SleekBucketDouble<O>
All Implemented Interfaces:
net.obsearch.index.bucket.BucketContainer<O,BucketObjectDouble<O>,OBQueryDouble<O>>

public class SleekBucketDouble<O extends OBDouble>
extends Object
implements net.obsearch.index.bucket.BucketContainer<O,BucketObjectDouble<O>,OBQueryDouble<O>>

AbstractSleekBucket is designed to hold objects that belong to one bucket. The bucket will hold ALL the buckets. Optionally, objects inside the bucket can be used as pivotCount. Format: ... ... .... This bucket design focuses on pivotCount local to a partition instead of global pivotCount. Also, the storage and reading of the container is responsability of the index. The class does not access directly the index unlike the bucket.* classes we now have something that partitions the data properly.

Author:
Arnoldo Jose Muller Molina

Constructor Summary
SleekBucketDouble(Class<O> type, int pivots)
          Create an empty, new bucket.
SleekBucketDouble(Class<O> type, int pivots, byte[] data)
          Create a new SleekBucket based on the given data.
 
Method Summary
 net.obsearch.OperationStatus delete(BucketObjectDouble<O> bucket, O object)
           
 boolean equals(Object o)
           
 net.obsearch.OperationStatus exists(BucketObjectDouble<O> bucket, O object)
           
 List<BucketObjectDouble<O>> getObjects()
           
 int getPivots()
           
 net.obsearch.OperationStatus insert(BucketObjectDouble<O> bucket, O object)
           
 net.obsearch.OperationStatus insertBulk(BucketObjectDouble<O> bucket, O object)
           
 boolean isModified()
           
 void parseData(int pivotCount, byte[] data)
          Parses the data from the given byte array.
 void search(net.obsearch.query.AbstractOBQuery<O> q, BucketObjectDouble<O> bucket, net.obsearch.filter.Filter<O> filter, net.obsearch.stats.Statistics stats)
           
 void search(OBQueryDouble<O> query, BucketObjectDouble<O> bucket, ByteBuffer b, net.obsearch.filter.Filter<O> filter, net.obsearch.stats.Statistics stats)
           
 void search(OBQueryDouble<O> query, BucketObjectDouble<O> bucket, net.obsearch.filter.Filter<O> filter, net.obsearch.stats.Statistics stats)
           
 byte[] serialize()
          Serialize the bucket into a stream of bytes.
 void setKey(byte[] key)
           
 void setPivots(int pivots)
           
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SleekBucketDouble

public SleekBucketDouble(Class<O> type,
                         int pivots)
Create an empty, new bucket.

Parameters:
pivotCount - number of pivotCount to use.

SleekBucketDouble

public SleekBucketDouble(Class<O> type,
                         int pivots,
                         byte[] data)
                  throws InstantiationException,
                         IllegalAccessException,
                         net.obsearch.exception.OBException,
                         IOException
Create a new SleekBucket based on the given data.

Parameters:
pivotCount -
data -
Throws:
IOException
net.obsearch.exception.OBException
IllegalAccessException
InstantiationException
IOException
Method Detail

getObjects

public List<BucketObjectDouble<O>> getObjects()
Specified by:
getObjects in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

parseData

public void parseData(int pivotCount,
                      byte[] data)
               throws InstantiationException,
                      IllegalAccessException,
                      net.obsearch.exception.OBException,
                      IOException
Parses the data from the given byte array.

Parameters:
data -
Throws:
IllegalAccessException
InstantiationException
IOException
net.obsearch.exception.OBException

equals

public boolean equals(Object o)
Overrides:
equals in class Object

delete

public net.obsearch.OperationStatus delete(BucketObjectDouble<O> bucket,
                                           O object)
                                    throws net.obsearch.exception.OBException,
                                           net.obsearch.exception.IllegalIdException,
                                           IllegalAccessException,
                                           InstantiationException
Specified by:
delete in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

isModified

public boolean isModified()
Specified by:
isModified in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

exists

public net.obsearch.OperationStatus exists(BucketObjectDouble<O> bucket,
                                           O object)
                                    throws net.obsearch.exception.OBException,
                                           net.obsearch.exception.IllegalIdException,
                                           IllegalAccessException,
                                           InstantiationException
Specified by:
exists in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

getPivots

public int getPivots()
Specified by:
getPivots in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

insert

public net.obsearch.OperationStatus insert(BucketObjectDouble<O> bucket,
                                           O object)
                                    throws net.obsearch.exception.OBException,
                                           net.obsearch.exception.IllegalIdException,
                                           IllegalAccessException,
                                           InstantiationException
Specified by:
insert in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

insertBulk

public net.obsearch.OperationStatus insertBulk(BucketObjectDouble<O> bucket,
                                               O object)
                                        throws net.obsearch.exception.OBException,
                                               net.obsearch.exception.IllegalIdException,
                                               IllegalAccessException,
                                               InstantiationException
Specified by:
insertBulk in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

search

public void search(net.obsearch.query.AbstractOBQuery<O> q,
                   BucketObjectDouble<O> bucket,
                   net.obsearch.filter.Filter<O> filter,
                   net.obsearch.stats.Statistics stats)
            throws IllegalAccessException,
                   net.obsearch.exception.OBException,
                   InstantiationException,
                   net.obsearch.exception.IllegalIdException
Specified by:
search in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
IllegalAccessException
net.obsearch.exception.OBException
InstantiationException
net.obsearch.exception.IllegalIdException

search

public void search(OBQueryDouble<O> query,
                   BucketObjectDouble<O> bucket,
                   ByteBuffer b,
                   net.obsearch.filter.Filter<O> filter,
                   net.obsearch.stats.Statistics stats)
            throws IllegalAccessException,
                   net.obsearch.exception.OBException,
                   InstantiationException,
                   net.obsearch.exception.IllegalIdException
Specified by:
search in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
IllegalAccessException
net.obsearch.exception.OBException
InstantiationException
net.obsearch.exception.IllegalIdException

search

public void search(OBQueryDouble<O> query,
                   BucketObjectDouble<O> bucket,
                   net.obsearch.filter.Filter<O> filter,
                   net.obsearch.stats.Statistics stats)
            throws IllegalAccessException,
                   net.obsearch.exception.OBException,
                   InstantiationException,
                   net.obsearch.exception.IllegalIdException
Specified by:
search in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Throws:
IllegalAccessException
net.obsearch.exception.OBException
InstantiationException
net.obsearch.exception.IllegalIdException

serialize

public byte[] serialize()
                 throws net.obsearch.exception.OBException
Serialize the bucket into a stream of bytes.

Specified by:
serialize in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>
Returns:
The list of
Throws:
IOException
net.obsearch.exception.OBException

setKey

public void setKey(byte[] key)
Specified by:
setKey in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

setPivots

public void setPivots(int pivots)
Specified by:
setPivots in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

size

public int size()
Specified by:
size in interface net.obsearch.index.bucket.BucketContainer<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>>

toString

public String toString()
Overrides:
toString in class Object


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