public class GarbageCollector extends Object implements org.apache.jackrabbit.api.management.DataStoreGarbageCollector
Example code to run the data store garbage collection:
JackrabbitRepositoryFactory jf = (JackrabbitRepositoryFactory) factory; RepositoryManager m = jf.getRepositoryManager((JackrabbitRepository) repository); GarbageCollector gc = m.createDataStoreGarbageCollector(); try { gc.mark(); gc.sweep(); } finally { gc.close(); }
Modifier and Type | Field and Description |
---|---|
protected int |
testDelay |
Constructor and Description |
---|
GarbageCollector(RepositoryContext context,
DataStore dataStore,
IterablePersistenceManager[] list,
SessionImpl[] sessionList)
Create a new garbage collector.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize()
Auto-close in case the application didn't call it explicitly.
|
int |
getConcurrentThreadSize() |
DataStore |
getDataStore()
Get the data store if one is used.
|
long |
getMinSplitSize() |
long |
getSleepBetweenNodes() |
boolean |
isPersistenceManagerScan() |
void |
mark() |
void |
setConcurrentThreadSize(int concurrentThreadSize) |
void |
setMarkEventListener(org.apache.jackrabbit.api.management.MarkEventListener callback) |
void |
setMinSplitSize(long minSplitSize) |
void |
setPersistenceManagerScan(boolean allow) |
void |
setSleepBetweenNodes(long millis) |
void |
setTestDelay(int testDelay)
When testing the garbage collection, a delay is used instead of simulating concurrent access.
|
void |
stopScan()
Reset modifiedDateOnAccess to 0 and stop the observation
listener if any are installed.
|
int |
sweep() |
public GarbageCollector(RepositoryContext context, DataStore dataStore, IterablePersistenceManager[] list, SessionImpl[] sessionList)
context
- repository contextdataStore
- the data store to be garbage-collectedlist
- the persistence managerssessionList
- the sessions to access the workspacespublic void setSleepBetweenNodes(long millis)
setSleepBetweenNodes
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
public long getSleepBetweenNodes()
getSleepBetweenNodes
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
public long getMinSplitSize()
public void setMinSplitSize(long minSplitSize)
public int getConcurrentThreadSize()
public void setConcurrentThreadSize(int concurrentThreadSize)
public void setTestDelay(int testDelay)
testDelay
- the delay in millisecondspublic void setMarkEventListener(org.apache.jackrabbit.api.management.MarkEventListener callback)
setMarkEventListener
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
public void mark() throws RepositoryException
mark
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
RepositoryException
public void setPersistenceManagerScan(boolean allow)
setPersistenceManagerScan
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
public boolean isPersistenceManagerScan()
isPersistenceManagerScan
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
public void stopScan() throws RepositoryException
RepositoryException
public int sweep() throws RepositoryException
sweep
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
RepositoryException
public DataStore getDataStore()
public void close()
close
in interface org.apache.jackrabbit.api.management.DataStoreGarbageCollector
Copyright © 2004–2024 The Apache Software Foundation. All rights reserved.