--- /dev/null
+package fi.vtt.simantics.procore.internal;\r
+\r
+import org.simantics.db.service.ClusterCollectorPolicy;\r
+import org.simantics.db.service.ClusterCollectorPolicy.CollectorCluster;\r
+\r
+class ClusterCollectorSupportImpl implements ClusterCollectorSupport {\r
+\r
+ private final ClusterTable clusterTable;\r
+\r
+ ClusterCollectorSupportImpl(ClusterTable clusterTable) {\r
+ this.clusterTable = clusterTable;\r
+ }\r
+\r
+ @Override\r
+ public void setPolicy(ClusterCollectorPolicy policy) {\r
+ clusterTable.setCollectorPolicy(policy);\r
+ }\r
+ \r
+ @Override\r
+ public int getCurrentSize() {\r
+ return (int)this.clusterTable.getSizeInBytes();\r
+ }\r
+ \r
+ @Override\r
+ public long getClusterSize(CollectorCluster id) {\r
+ return clusterTable.getClusterByClusterId(id.getClusterId()).getCachedSize();\r
+ }\r
+ \r
+ @Override\r
+ public Iterable<CollectorCluster> getResidentClusters() {\r
+ return clusterTable.importanceMap.values();\r
+ }\r
+\r
+ @Override\r
+ public void release(CollectorCluster id) {\r
+ clusterTable.release(id);\r
+ }\r
+ \r
+}
\ No newline at end of file