|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.obsearch.storage.bdb.BDBFactoryJe
public final class BDBFactoryJe
BDBFactory generates an environment in the given directory, and creates databases as OBSearch requests.
Constructor Summary | |
---|---|
BDBFactoryJe(File directory)
Creates a new factory that will be based in the given directory. |
Method Summary | |
---|---|
static byte |
bytesToByte(byte[] value)
|
static double |
bytesToDouble(byte[] value)
|
static float |
bytesToFloat(byte[] value)
|
static int |
bytesToInt(byte[] value)
|
static long |
bytesToLong(byte[] value)
|
static short |
bytesToShort(byte[] value)
|
static byte[] |
byteToBytes(byte value)
|
void |
close()
Close the factory. |
protected com.sleepycat.je.DatabaseConfig |
createDefaultDatabaseConfig()
Creates a default database configuration. |
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. |
static byte[] |
doubleToBytes(double value)
|
static byte[] |
floatToBytes(float value)
|
String |
getFactoryLocation()
Return the url where this factory is located. |
static byte[] |
intToBytes(int value)
|
static byte[] |
longToBytes(long value)
|
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. |
static byte[] |
shortToBytes(short 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 |
---|
public BDBFactoryJe(File directory) throws IOException, com.sleepycat.je.DatabaseException, OBStorageException
directory
- The directory where the Berkeley DB files will be stored.
IOException
- If the given directory does not exist.
com.sleepycat.je.DatabaseException
OBStorageException
Method Detail |
---|
public String getFactoryLocation()
OBStoreFactory
getFactoryLocation
in interface OBStoreFactory
public void close() throws OBStorageException
OBStoreFactory
close
in interface OBStoreFactory
OBStorageException
- if something goes wrong with the
underlying storage system.public OBStore<TupleBytes> createOBStore(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStore
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.protected com.sleepycat.je.DatabaseConfig createDefaultDatabaseConfig()
public void removeOBStore(OBStore storage) throws OBStorageException
OBStoreFactory
removeOBStore
in interface OBStoreFactory
storage
- The storage device to remove.
OBStorageException
- If something goes wrong with the delete operation.public OBStoreByte createOBStoreByte(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreByte
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeByte(byte value)
OBStoreFactory
serializeByte
in interface OBStoreFactory
public byte deSerializeByte(byte[] value)
OBStoreFactory
deSerializeByte
in interface OBStoreFactory
public static byte[] byteToBytes(byte value)
public static byte bytesToByte(byte[] value)
public OBStoreShort createOBStoreShort(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreShort
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeShort(short value)
OBStoreFactory
serializeShort
in interface OBStoreFactory
public short deSerializeShort(byte[] value)
OBStoreFactory
deSerializeShort
in interface OBStoreFactory
public static byte[] shortToBytes(short value)
public static short bytesToShort(byte[] value)
public OBStoreInt createOBStoreInt(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreInt
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeInt(int value)
OBStoreFactory
serializeInt
in interface OBStoreFactory
public int deSerializeInt(byte[] value)
OBStoreFactory
deSerializeInt
in interface OBStoreFactory
public static byte[] intToBytes(int value)
public static int bytesToInt(byte[] value)
public OBStoreLong createOBStoreLong(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreLong
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeLong(long value)
OBStoreFactory
serializeLong
in interface OBStoreFactory
public long deSerializeLong(byte[] value)
OBStoreFactory
deSerializeLong
in interface OBStoreFactory
public static byte[] longToBytes(long value)
public static long bytesToLong(byte[] value)
public OBStoreFloat createOBStoreFloat(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreFloat
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeFloat(float value)
OBStoreFactory
serializeFloat
in interface OBStoreFactory
public float deSerializeFloat(byte[] value)
OBStoreFactory
deSerializeFloat
in interface OBStoreFactory
public static byte[] floatToBytes(float value)
public static float bytesToFloat(byte[] value)
public OBStoreDouble createOBStoreDouble(String name, OBStorageConfig config) throws OBStorageException
OBStoreFactory
createOBStoreDouble
in interface OBStoreFactory
name
- The name of the database.
OBStorageException
- If the DB cannot be created.public byte[] serializeDouble(double value)
OBStoreFactory
serializeDouble
in interface OBStoreFactory
public double deSerializeDouble(byte[] value)
OBStoreFactory
deSerializeDouble
in interface OBStoreFactory
public static byte[] doubleToBytes(double value)
public static double bytesToDouble(byte[] value)
public byte[] serializeBigInteger(BigInteger value)
OBStoreFactory
serializeBigInteger
in interface OBStoreFactory
public BigInteger deSerializeBigInteger(byte[] value)
OBStoreFactory
deSerializeBigInteger
in interface OBStoreFactory
public Object stats() throws OBStorageException
OBStoreFactory
stats
in interface OBStoreFactory
OBStorageException
- if something goes wrong with the
underlying storage system.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |