long took = gc(monitor, session, sync, errorCallback, DEFAULT_ALLOWED_TIME, DEFAULT_CLUSTER_TARGET);
return ((16*took) / DEFAULT_ALLOWED_TIME) > 15;
}
-
+
public static void gc(ReadGraph graph, final int allowedTimeInMs, final int clusterTarget) throws DatabaseException {
- doIt(null, graph, allowedTimeInMs, clusterTarget);
+ doIt(null, graph, allowedTimeInMs, clusterTarget);
+ }
+
+ public static void gc(IProgressMonitor monitor, ReadGraph graph, final int allowedTimeInMs, final int clusterTarget) throws DatabaseException {
+ doIt(monitor, graph, allowedTimeInMs, clusterTarget);
}
private static void doIt(IProgressMonitor _monitor, ReadGraph graph, final int allowedTimeInMs, final int clusterTarget) {
- if(_monitor == null) _monitor = new NullProgressMonitor();
+ if(_monitor == null) _monitor = new NullProgressMonitor();
QueryControl qc = graph.getService(QueryControl.class);
ClusterControl cc = graph.getService(ClusterControl.class);
_monitor.beginTask("Collect clusters", IProgressMonitor.UNKNOWN);
_monitor.beginTask("Collect queries", IProgressMonitor.UNKNOWN);
qc.gc(graph, allowedTimeInMs);
}
-
+
/**
* @param monitor
* @param session