net.obsearch.storage.tc
Class TCFactory

java.lang.Object
  extended by net.obsearch.storage.tc.TCFactory
All Implemented Interfaces:
OBStoreFactory

public class TCFactory
extends Object
implements OBStoreFactory


Constructor Summary
TCFactory(File directory)
           
 
Method Summary
 void close()
          Close the factory.
 OBStore<TupleBytes> createOBStore(String name, OBStorageConfig config)
          Creates a generic OBStore.
 OBStoreByte createOBStoreByte(String name, OBStorageConfig config)
          Creates an OBStoreByte whose key is based on bytes.
 OBStoreDouble createOBStoreDouble(String name, OBStorageConfig config)
          Creates an OBStoreDouble whose key is based on doubles.
 OBStoreFloat createOBStoreFloat(String name, OBStorageConfig config)
          Creates an OBStoreFloat whose key is based on floats.
 OBStoreInt createOBStoreInt(String name, OBStorageConfig config)
          Creates an OBStoreInt whose key is based on ints.
 OBStoreLong createOBStoreLong(String name, OBStorageConfig config)
          Creates an OBStoreLong whose key is based on longs.
 OBStoreShort createOBStoreShort(String name, OBStorageConfig config)
          Creates an OBStoreShort whose key is based on shorts.
 BigInteger deSerializeBigInteger(byte[] value)
          Creates a BigInteger of the given value.
 byte deSerializeByte(byte[] value)
          Creates a byte of the given value.
 double deSerializeDouble(byte[] value)
          Creates a double of the given value.
 float deSerializeFloat(byte[] value)
          Creates a float of the given value.
 int deSerializeInt(byte[] value)
          Creates a int of the given value.
 long deSerializeLong(byte[] value)
          Creates a long of the given value.
 short deSerializeShort(byte[] value)
          Creates a short of the given value.
 String getFactoryLocation()
          Return the url where this factory is located.
 void removeOBStore(OBStore storage)
          Removes all indexes and structures related to the given storage device.
 byte[] serializeBigInteger(BigInteger value)
          Creates a binary representation of the given value.
 byte[] serializeByte(byte value)
          Creates a binary representation of the given value.
 byte[] serializeDouble(double value)
          Creates a binary representation of the given value.
 byte[] serializeFloat(float value)
          Creates a binary representation of the given value.
 byte[] serializeInt(int value)
          Creates a binary representation of the given value.
 byte[] serializeLong(long value)
          Creates a binary representation of the given value.
 byte[] serializeShort(short value)
          Creates a binary representation of the given value.
 Object stats()
          Return a stats object that is to be printed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TCFactory

public TCFactory(File directory)
Method Detail

close

public void close()
           throws OBStorageException
Description copied from interface: OBStoreFactory
Close the factory. All opened OBStores must be closed before this method is called.

Specified by:
close in interface OBStoreFactory
Throws:
OBStorageException - if something goes wrong with the underlying storage system.

createOBStore

public OBStore<TupleBytes> createOBStore(String name,
                                         OBStorageConfig config)
                                  throws OBStorageException,
                                         OBException
Description copied from interface: OBStoreFactory
Creates a generic OBStore.

Specified by:
createOBStore in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStore ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreByte

public OBStoreByte createOBStoreByte(String name,
                                     OBStorageConfig config)
                              throws OBStorageException,
                                     OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreByte whose key is based on bytes.

Specified by:
createOBStoreByte in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreByte ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreDouble

public OBStoreDouble createOBStoreDouble(String name,
                                         OBStorageConfig config)
                                  throws OBStorageException,
                                         OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreDouble whose key is based on doubles.

Specified by:
createOBStoreDouble in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreDouble ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreFloat

public OBStoreFloat createOBStoreFloat(String name,
                                       OBStorageConfig config)
                                throws OBStorageException,
                                       OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreFloat whose key is based on floats.

Specified by:
createOBStoreFloat in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreFloat ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreInt

public OBStoreInt createOBStoreInt(String name,
                                   OBStorageConfig config)
                            throws OBStorageException,
                                   OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreInt whose key is based on ints.

Specified by:
createOBStoreInt in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreInt ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreLong

public OBStoreLong createOBStoreLong(String name,
                                     OBStorageConfig config)
                              throws OBStorageException,
                                     OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreLong whose key is based on longs.

Specified by:
createOBStoreLong in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreLong ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

createOBStoreShort

public OBStoreShort createOBStoreShort(String name,
                                       OBStorageConfig config)
                                throws OBStorageException,
                                       OBException
Description copied from interface: OBStoreFactory
Creates an OBStoreShort whose key is based on shorts.

Specified by:
createOBStoreShort in interface OBStoreFactory
Parameters:
name - The name of the database.
Returns:
An OBStoreShort ready to be used.
Throws:
OBStorageException - If the DB cannot be created.
OBException

deSerializeBigInteger

public BigInteger deSerializeBigInteger(byte[] value)
Description copied from interface: OBStoreFactory
Creates a BigInteger of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeBigInteger in interface OBStoreFactory

deSerializeByte

public byte deSerializeByte(byte[] value)
Description copied from interface: OBStoreFactory
Creates a byte of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeByte in interface OBStoreFactory

deSerializeDouble

public double deSerializeDouble(byte[] value)
Description copied from interface: OBStoreFactory
Creates a double of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeDouble in interface OBStoreFactory

deSerializeFloat

public float deSerializeFloat(byte[] value)
Description copied from interface: OBStoreFactory
Creates a float of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeFloat in interface OBStoreFactory

deSerializeInt

public int deSerializeInt(byte[] value)
Description copied from interface: OBStoreFactory
Creates a int of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeInt in interface OBStoreFactory

deSerializeLong

public long deSerializeLong(byte[] value)
Description copied from interface: OBStoreFactory
Creates a long of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeLong in interface OBStoreFactory

deSerializeShort

public short deSerializeShort(byte[] value)
Description copied from interface: OBStoreFactory
Creates a short of the given value. Only the required bytes are taken from the input.

Specified by:
deSerializeShort in interface OBStoreFactory

getFactoryLocation

public String getFactoryLocation()
Description copied from interface: OBStoreFactory
Return the url where this factory is located.

Specified by:
getFactoryLocation in interface OBStoreFactory

removeOBStore

public void removeOBStore(OBStore storage)
                   throws OBStorageException,
                          OBException
Description copied from interface: OBStoreFactory
Removes all indexes and structures related to the given storage device.

Specified by:
removeOBStore in interface OBStoreFactory
Parameters:
storage - The storage device to remove.
Throws:
OBStorageException - If something goes wrong with the delete operation.
OBException

serializeBigInteger

public byte[] serializeBigInteger(BigInteger value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeBigInteger in interface OBStoreFactory

serializeByte

public byte[] serializeByte(byte value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeByte in interface OBStoreFactory

serializeDouble

public byte[] serializeDouble(double value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeDouble in interface OBStoreFactory

serializeFloat

public byte[] serializeFloat(float value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeFloat in interface OBStoreFactory

serializeInt

public byte[] serializeInt(int value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeInt in interface OBStoreFactory

serializeLong

public byte[] serializeLong(long value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeLong in interface OBStoreFactory

serializeShort

public byte[] serializeShort(short value)
Description copied from interface: OBStoreFactory
Creates a binary representation of the given value. The value must be returned in such a way that it can be sorted with bytes.

Specified by:
serializeShort in interface OBStoreFactory

stats

public Object stats()
             throws OBStorageException
Description copied from interface: OBStoreFactory
Return a stats object that is to be printed

Specified by:
stats in interface OBStoreFactory
Throws:
OBStorageException - if something goes wrong with the underlying storage system.


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