|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vrspace.neurogrid.DBAdapter
org.vrspace.neurogrid.MapDB
| Field Summary | |
protected boolean |
active
|
protected SoftCache |
cache
|
static long |
getCnt
|
static long |
hitCnt
|
protected int |
mode
|
static long |
putCnt
|
protected Queue |
q
|
static int |
QUEUED
|
static long |
reloadCnt
|
long |
sleep
sleep time, millis |
protected Store |
store
|
static int |
SYNC
|
| Fields inherited from class org.vrspace.neurogrid.DBAdapter |
instance |
| Constructor Summary | |
MapDB()
|
|
| Method Summary | |
int |
count(java.lang.Class what)
Returns number of stored instances of this class. |
void |
delete(NGObject obj)
Delete obj |
NGObject |
get(java.lang.Class what,
long id)
Called from DBRef when SoftReference.get() returns null, that is - when gc expired the object |
NGObject |
get(java.lang.Class what,
NGObject value)
Utility method |
protected java.util.TreeSet |
getTable(java.lang.Class what)
Returns table used to store what |
void |
init(Store store)
Initializes this DBAdapter |
java.util.Iterator |
iterator(java.lang.Class what)
Returns the iterator on all instances of a class |
void |
loaded(NGObject obj)
Stores an object to a reference map |
void |
put(NGObject obj)
Stores the object |
void |
run()
Writer thread run() impl. |
void |
setMode(int mode)
Set new write mode: SYNC or QUEUED |
long |
size()
Returns total swap size |
protected void |
startWriter()
Creates and starts writer thread with maximum priority |
protected void |
stopWriter()
Interrupts and stops writer thread if any, flushes queue |
protected void |
store(NGObject obj)
Stores obj to current store |
java.util.SortedSet |
subSet(java.lang.Class what,
java.lang.Object start,
java.lang.Object end)
Retrieves a subset of a class |
| Methods inherited from class org.vrspace.neurogrid.DBAdapter |
getInstance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SoftCache cache
protected Store store
protected boolean active
public static final int QUEUED
public static final int SYNC
protected int mode
protected Queue q
public long sleep
public static long putCnt
public static long getCnt
public static long reloadCnt
public static long hitCnt
| Constructor Detail |
public MapDB()
| Method Detail |
public void init(Store store)
throws java.lang.Exception
init in class DBAdapterjava.lang.ExceptionStoreprotected void startWriter()
protected void stopWriter()
public void run()
run in interface java.lang.Runnable
public void put(NGObject obj)
throws java.lang.Exception
put in class DBAdapterjava.lang.Exception
public void delete(NGObject obj)
throws java.lang.Exception
delete in class DBAdapterjava.lang.Exceptionprotected java.util.TreeSet getTable(java.lang.Class what)
public void loaded(NGObject obj)
loaded in interface LoadListenerprotected void store(NGObject obj)
public int count(java.lang.Class what)
count in class DBAdapterpublic long size()
size in class DBAdapterpublic java.util.Iterator iterator(java.lang.Class what)
iterator in class DBAdapter
public java.util.SortedSet subSet(java.lang.Class what,
java.lang.Object start,
java.lang.Object end)
subSet in class DBAdapter
public NGObject get(java.lang.Class what,
NGObject value)
get in class DBAdapter
public NGObject get(java.lang.Class what,
long id)
get in class DBAdapterpublic void setMode(int mode)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||