public class MnodeStore
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MnodeStore.ExpiredMnode |
class |
MnodeStore.ExpiredState |
static class |
MnodeStore.Mnode |
Constructor and Description |
---|
MnodeStore(javax.sql.DataSource dataSource,
java.lang.String tableName,
java.lang.String serverName) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
MnodeStore.ExpiredState |
createExpiredState() |
void |
destroy() |
long |
getCount() |
javax.sql.DataSource |
getDataSource()
Returns the data source.
|
java.util.Iterator<HashKey> |
getKeys(HashKey cacheKey) |
long |
getStartupLastUpdateTime()
Returns the max update time detected on startup.
|
long |
getStartupLastUpdateTime(HashKey cacheKey)
Returns the max update time detected on startup.
|
java.lang.String |
getTableName()
Returns the data source.
|
java.util.ArrayList<CacheData> |
getUpdates(HashKey cacheKey,
long updateTime,
int offset)
Returns the maximum update time on startup
|
java.util.ArrayList<CacheData> |
getUpdates(long updateTime,
int offset)
Returns the maximum update time on startup
|
protected 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.
|
boolean |
remove(byte[] key)
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[] key,
byte[] cacheHash,
MnodeValue mnodeUpdate,
long valueDataId,
long valueDataTime,
long lastAccessTime,
long lastModifiedTime)
Stores the data, returning true on success
|
public MnodeStore(javax.sql.DataSource dataSource, java.lang.String tableName, java.lang.String serverName) throws java.lang.Exception
java.lang.Exception
public javax.sql.DataSource getDataSource()
public java.lang.String getTableName()
public long getStartupLastUpdateTime()
public long getStartupLastUpdateTime(HashKey cacheKey)
protected void init() throws java.lang.Exception
java.lang.Exception
protected void initDatabase() throws java.lang.Exception
java.lang.Exception
public void close()
public java.util.ArrayList<CacheData> getUpdates(long updateTime, int offset)
public java.util.ArrayList<CacheData> getUpdates(HashKey cacheKey, long updateTime, int offset)
public MnodeEntry load(HashKey id)
id
- the hash identifier for the datapublic boolean insert(HashKey id, HashKey cacheKey, MnodeValue mnodeUpdate, long valueDataId, long valueDataTime, long lastAccessTime, long lastModifiedTime)
id
- the key hashvalue
- the value hashidleTimeout
- the item's timeoutpublic boolean updateSave(byte[] key, byte[] cacheHash, MnodeValue mnodeUpdate, long valueDataId, long valueDataTime, long lastAccessTime, long lastModifiedTime)
id
- the key hashvalue
- the value hashidleTimeout
- the item's timeoutpublic boolean updateAccessTime(HashKey id, long itemVersion, long accessTimeout, long accessTime)
id
- the key hashitemVersion
- the value versionidleTimeout
- the item's timeoutupdateTime
- the item's timeoutpublic boolean remove(byte[] key)
id
- the hash identifier for the datapublic MnodeStore.ExpiredState createExpiredState()
public long getCount()
public void destroy()
public java.lang.String toString()
toString
in class java.lang.Object