|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.data.GarbageCollector
public class GarbageCollector
Garbage collector for DataStore. This implementation is iterates through all nodes and reads the binary properties. To detect nodes that are moved while the scan runs, event listeners are started. Like the well known garbage collection in Java, the items that are still in use are marked. Currently this achieved by updating the modified date of the entries. Newly added entries are detected because the modified date is changed when they are added.
Example code to run the data store garbage collection:
GarbageCollector gc = ((SessionImpl)session).createDataStoreGarbageCollector(); gc.scan(); gc.stopScan(); gc.deleteUnused();
Constructor Summary | |
---|---|
GarbageCollector(SessionImpl session,
IterablePersistenceManager[] list,
Session[] sessionList)
Create a new garbage collector. |
Method Summary | |
---|---|
int |
deleteUnused()
|
DataStore |
getDataStore()
|
boolean |
getPersistenceManagerScan()
Check if using the IterablePersistenceManager interface is allowed. |
void |
scan()
Scan the repository. |
void |
setPersistenceManagerScan(boolean allow)
Enable or disable using the IterablePersistenceManager interface to scan the items. |
void |
setScanEventListener(ScanEventListener callback)
Set the event listener. |
void |
setSleepBetweenNodes(int millis)
Set the delay between scanning items. |
void |
setTestDelay(int testDelay)
When testing the garbage collection, a delay is used instead of simulating concurrent access. |
void |
stopScan()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GarbageCollector(SessionImpl session, IterablePersistenceManager[] list, Session[] sessionList)
list
- the persistence managersMethod Detail |
---|
public void setSleepBetweenNodes(int millis)
sleepBetweenNodes
- the number of milliseconds to sleeppublic void setTestDelay(int testDelay)
testDelay
- the delay in millisecondspublic void setScanEventListener(ScanEventListener callback)
callback
- if set, this is called while scanningpublic void scan() throws RepositoryException, IllegalStateException, IOException, ItemStateException
RepositoryException
IllegalStateException
IOException
ItemStateException
public void setPersistenceManagerScan(boolean allow)
allow
- true if using the IterablePersistenceManager interface is allowedpublic boolean getPersistenceManagerScan()
public void stopScan() throws RepositoryException
RepositoryException
public int deleteUnused() throws RepositoryException
RepositoryException
public DataStore getDataStore()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |