1 package fi.vtt.simantics.procore.internal;
\r
3 import org.simantics.db.service.ClusterCollectorPolicy;
\r
4 import org.simantics.db.service.ClusterCollectorPolicy.CollectorCluster;
\r
6 class ClusterCollectorSupportImpl implements ClusterCollectorSupport {
\r
8 private final ClusterTable clusterTable;
\r
10 ClusterCollectorSupportImpl(ClusterTable clusterTable) {
\r
11 this.clusterTable = clusterTable;
\r
15 public void setPolicy(ClusterCollectorPolicy policy) {
\r
16 clusterTable.setCollectorPolicy(policy);
\r
20 public int getCurrentSize() {
\r
21 return (int)this.clusterTable.getSizeInBytes();
\r
25 public long getClusterSize(CollectorCluster id) {
\r
26 return clusterTable.getClusterByClusterId(id.getClusterId()).getCachedSize();
\r
30 public Iterable<CollectorCluster> getResidentClusters() {
\r
31 return clusterTable.importanceMap.values();
\r
35 public void release(CollectorCluster id) {
\r
36 clusterTable.release(id);
\r