net.obsearch.index.bucket.sleek
Class SleekBucketByte<O extends OBByte>

java.lang.Object
  extended by net.obsearch.index.bucket.sleek.SleekBucketByte<O>
All Implemented Interfaces:
net.obsearch.index.bucket.BucketContainer<O,BucketObjectByte<O>,OBQueryByte<O>>

public class SleekBucketByte<O extends OBByte>
extends Object
implements net.obsearch.index.bucket.BucketContainer<O,BucketObjectByte<O>,OBQueryByte<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
SleekBucketByte(Class<O> type, int pivots)
          Create an empty, new bucket.
SleekBucketByte(Class<O> type, int pivots, byte[] data)
          Create a new SleekBucket based on the given data.
 
Method Summary
 net.obsearch.OperationStatus delete(BucketObjectByte<O> bucket, O object)
           
 boolean equals(Object o)
           
 net.obsearch.OperationStatus exists(BucketObjectByte<O> bucket, O object)
           
 List<BucketObjectByte<O>> getObjects()
           
 int getPivots()
           
 net.obsearch.OperationStatus insert(BucketObjectByte<O> bucket, O object)
           
 net.obsearch.OperationStatus insertBulk(BucketObjectByte<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, BucketObjectByte<O> bucket, net.obsearch.filter.Filter<O> filter, net.obsearch.stats.Statistics stats)
           
 void search(OBQueryByte<O> query, BucketObjectByte<O> bucket, ByteBuffer b, net.obsearch.filter.Filter<O> filter, net.obsearch.stats.Statistics stats)
           
 void search(OBQueryByte<O> query, BucketObjectByte<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

SleekBucketByte

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

Parameters:
pivotCount - number of pivotCount to use.

SleekBucketByte

public SleekBucketByte(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<BucketObjectByte<O>> getObjects()
Specified by:
getObjects in interface net.obsearch.index.bucket.BucketContainer<O extends OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

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(BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

exists

public net.obsearch.OperationStatus exists(BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

insert

public net.obsearch.OperationStatus insert(BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

insertBulk

public net.obsearch.OperationStatus insertBulk(BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
Throws:
net.obsearch.exception.OBException
net.obsearch.exception.IllegalIdException
IllegalAccessException
InstantiationException

search

public void search(net.obsearch.query.AbstractOBQuery<O> q,
                   BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
Throws:
IllegalAccessException
net.obsearch.exception.OBException
InstantiationException
net.obsearch.exception.IllegalIdException

search

public void search(OBQueryByte<O> query,
                   BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
Throws:
IllegalAccessException
net.obsearch.exception.OBException
InstantiationException
net.obsearch.exception.IllegalIdException

search

public void search(OBQueryByte<O> query,
                   BucketObjectByte<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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>
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 OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

setPivots

public void setPivots(int pivots)
Specified by:
setPivots in interface net.obsearch.index.bucket.BucketContainer<O extends OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

size

public int size()
Specified by:
size in interface net.obsearch.index.bucket.BucketContainer<O extends OBByte,BucketObjectByte<O extends OBByte>,OBQueryByte<O extends OBByte>>

toString

public String toString()
Overrides:
toString in class Object


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