public class JdbcDataStore extends DataStore
DataStore.DataItem
Constructor and Description |
---|
JdbcDataStore(JdbcMnodeStore mnodeStore,
java.lang.String tableName,
java.lang.String serverName) |
Modifier and Type | Method and Description |
---|---|
void |
addOrphanListener(MnodeOrphanListener listener) |
void |
close() |
void |
destroy() |
long |
getCount() |
void |
init() |
boolean |
isDataAvailable(HashKey id)
Checks if we have the data
|
boolean |
load(HashKey id,
CacheDataBacking dataBacking) |
boolean |
load(HashKey id,
WriteStream os)
Reads the object from the data store.
|
java.io.InputStream |
openInputStream(HashKey id)
Reads the object from the data store.
|
void |
removeOrphanListener(MnodeOrphanListener listener) |
void |
save(HashKey valueHash,
CacheDataBacking dataBacking) |
long |
save(HashKey id,
java.io.InputStream is,
int length)
Saves the data, returning true on success.
|
long |
save(HashKey id,
StreamSource source,
int length)
Saves the data, returning true on success.
|
java.lang.String |
toString() |
void |
validateDatabase()
Clears the expired data
|
isClosed, isDataAvailable, load, loadBlob, openInputStream, remove, save, save
public JdbcDataStore(JdbcMnodeStore mnodeStore, java.lang.String tableName, java.lang.String serverName) throws java.lang.Exception
java.lang.Exception
public void init() throws java.lang.Exception
public void addOrphanListener(MnodeOrphanListener listener)
addOrphanListener
in class DataStore
public void removeOrphanListener(MnodeOrphanListener listener)
removeOrphanListener
in class DataStore
public boolean load(HashKey id, WriteStream os)
id
- the hash identifier for the dataos
- the WriteStream to hold the datapublic boolean load(HashKey id, CacheDataBacking dataBacking)
valueKey
- dataBacking
- public boolean isDataAvailable(HashKey id)
id
- the hash identifier for the datapublic java.io.InputStream openInputStream(HashKey id)
id
- the hash identifier for the dataos
- the WriteStream to hold the datapublic long save(HashKey id, StreamSource source, int length) throws java.io.IOException
id
- the object's unique id.is
- the input stream to the serialized objectlength
- the length object the serialized objectjava.io.IOException
public void save(HashKey valueHash, CacheDataBacking dataBacking)
valueHash
- dataBacking
- public long save(HashKey id, java.io.InputStream is, int length) throws java.io.IOException
id
- the object's unique id.is
- the input stream to the serialized objectlength
- the length object the serialized objectjava.io.IOException
public void validateDatabase()
validateDatabase
in class DataStore
public void close()