// this.availableMemory = Runtime.getRuntime().maxMemory();
this.availableMemory = hstore_conf.site.memory * 1024l * 1024l;
if (debug.val)
LOG.debug("AVAILABLE MEMORY: " + StringUtil.formatSize(this.availableMemory));
CatalogContext catalogContext = hstore_site.getCatalogContext();
evictableTables = new String[catalogContext.getEvictableTables().size()];
int i = 0;
for (Table table : catalogContext.getEvictableTables()) {
if(!table.getBatchevicted()){
evictableTables[i] = table.getName();
i++;
}
}
AntiCacheEvictionPolicyType policy = AntiCacheEvictionPolicyType.get(hstore_conf.site.anticache_eviction_distribution);
if (policy == null) {
LOG.warn(String.format("Bad value for site.anticache_eviction_distribution: %s. Using default of 'even'",
hstore_conf.site.anticache_eviction_distribution));
policy = AntiCacheEvictionPolicyType.EVEN;
}
this.evictionDistributionPolicy = policy;
int num_partitions = hstore_site.getCatalogContext().numberOfPartitions;
this.partitionStats = new PartitionStats[num_partitions];
for(i = 0; i < num_partitions; i++) {
this.partitionStats[i] = new PartitionStats();
}
this.pendingStatsUpdates = new boolean[num_partitions];
Arrays.fill(pendingStatsUpdates, false);
this.profilers = new AntiCacheManagerProfiler[num_partitions];
for (int partition : hstore_site.getLocalPartitionIds().values()) {
this.profilers[partition] = new AntiCacheManagerProfiler();
} // FOR
this.statsMessage = new TableStatsRequestMessage(catalogContext.getDataTables());
this.statsMessage.getObservable().addObserver(new EventObserver<VoltTable>() {
@Override
public void update(EventObservable<VoltTable> o, VoltTable vt) {
if (debug.val)
LOG.debug("updating partition stats in observer");