public class JdbcMnodeStore extends MnodeStore
MnodeStore.ExpiredMnode, MnodeStore.ExpiredState, MnodeStore.Mnode| Constructor and Description |
|---|
JdbcMnodeStore(javax.sql.DataSource dataSource,
java.lang.String tableName,
java.lang.String serverName) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
destroy() |
long |
getCount()
Clears the expired data
|
javax.sql.DataSource |
getDataSource()
Returns the data source.
|
java.util.ArrayList<CacheData> |
getGlobalUpdates(long updateTime,
int offset)
Returns the maximum update time on startup
|
long |
getStartupLastUpdateTime()
Returns the max update time detected on startup.
|
java.lang.String |
getTableName()
Returns the data source.
|
java.util.ArrayList<CacheData> |
getUpdates(long updateTime,
int offset)
Returns the maximum update time on startup
|
void |
init() |
protected void |
initDatabase()
Create the database, initializing if necessary.
|
boolean |
insert(HashKey id,
HashKey cacheKey,
MnodeValue mnodeUpdate,
long valueDataId,
long valueDataTime,
long lastAccessTime,
long lastModifiedTime)
Stores the data, returning true on success
|
MnodeEntry |
load(HashKey id)
Reads the object from the data store.
|
java.lang.String |
toString() |
boolean |
updateAccessTime(HashKey id,
long itemVersion,
long accessTimeout,
long accessTime)
Updates the update time, returning true on success
|
boolean |
updateSave(byte[] keyHash,
byte[] cacheHash,
MnodeValue mnodeUpdate,
long valueDataId,
long valueDataTime,
long lastAccessTime,
long lastModifiedTime)
Stores the data, returning true on success
|
createExpiredState, getKeys, getStartupLastUpdateTime, getUpdates, removepublic JdbcMnodeStore(javax.sql.DataSource dataSource,
java.lang.String tableName,
java.lang.String serverName)
throws java.lang.Exception
java.lang.Exceptionpublic javax.sql.DataSource getDataSource()
getDataSource in class MnodeStorepublic java.lang.String getTableName()
getTableName in class MnodeStorepublic long getStartupLastUpdateTime()
getStartupLastUpdateTime in class MnodeStorepublic void init()
throws java.lang.Exception
init in class MnodeStorejava.lang.Exceptionprotected void initDatabase()
throws java.lang.Exception
initDatabase in class MnodeStorejava.lang.Exceptionpublic void close()
close in class MnodeStorepublic java.util.ArrayList<CacheData> getUpdates(long updateTime, int offset)
getUpdates in class MnodeStorepublic java.util.ArrayList<CacheData> getGlobalUpdates(long updateTime, int offset)
public MnodeEntry load(HashKey id)
load in class MnodeStoreid - the hash identifier for the datapublic boolean insert(HashKey id, HashKey cacheKey, MnodeValue mnodeUpdate, long valueDataId, long valueDataTime, long lastAccessTime, long lastModifiedTime)
insert in class MnodeStoreid - the key hashvalue - the value hashidleTimeout - the item's timeoutpublic boolean updateSave(byte[] keyHash,
byte[] cacheHash,
MnodeValue mnodeUpdate,
long valueDataId,
long valueDataTime,
long lastAccessTime,
long lastModifiedTime)
updateSave in class MnodeStoreid - the key hashvalue - the value hashidleTimeout - the item's timeoutpublic boolean updateAccessTime(HashKey id, long itemVersion, long accessTimeout, long accessTime)
updateAccessTime in class MnodeStoreid - the key hashitemVersion - the value versionaccessTimeout - the item's timeoutaccessTime - the item's timeoutpublic long getCount()
getCount in class MnodeStorepublic void destroy()
destroy in class MnodeStorepublic java.lang.String toString()
toString in class MnodeStore