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, remove
public JdbcMnodeStore(javax.sql.DataSource dataSource, java.lang.String tableName, java.lang.String serverName) throws java.lang.Exception
java.lang.Exception
public javax.sql.DataSource getDataSource()
getDataSource
in class MnodeStore
public java.lang.String getTableName()
getTableName
in class MnodeStore
public long getStartupLastUpdateTime()
getStartupLastUpdateTime
in class MnodeStore
public void init() throws java.lang.Exception
init
in class MnodeStore
java.lang.Exception
protected void initDatabase() throws java.lang.Exception
initDatabase
in class MnodeStore
java.lang.Exception
public void close()
close
in class MnodeStore
public java.util.ArrayList<CacheData> getUpdates(long updateTime, int offset)
getUpdates
in class MnodeStore
public java.util.ArrayList<CacheData> getGlobalUpdates(long updateTime, int offset)
public MnodeEntry load(HashKey id)
load
in class MnodeStore
id
- 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 MnodeStore
id
- 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 MnodeStore
id
- the key hashvalue
- the value hashidleTimeout
- the item's timeoutpublic boolean updateAccessTime(HashKey id, long itemVersion, long accessTimeout, long accessTime)
updateAccessTime
in class MnodeStore
id
- the key hashitemVersion
- the value versionaccessTimeout
- the item's timeoutaccessTime
- the item's timeoutpublic long getCount()
getCount
in class MnodeStore
public void destroy()
destroy
in class MnodeStore
public java.lang.String toString()
toString
in class MnodeStore