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