use of org.weakref.jmx.JmxException in project presto by prestodb.
the class ClusterMemoryManager method createClusterMemoryPools.
private Map<MemoryPoolId, ClusterMemoryPool> createClusterMemoryPools(boolean reservedPoolEnabled) {
Set<MemoryPoolId> memoryPools = new HashSet<>();
memoryPools.add(GENERAL_POOL);
if (reservedPoolEnabled) {
memoryPools.add(RESERVED_POOL);
}
ImmutableMap.Builder<MemoryPoolId, ClusterMemoryPool> builder = ImmutableMap.builder();
for (MemoryPoolId poolId : memoryPools) {
ClusterMemoryPool pool = new ClusterMemoryPool(poolId);
builder.put(poolId, pool);
try {
exporter.export(generatedNameOf(ClusterMemoryPool.class, poolId.toString()), pool);
} catch (JmxException e) {
log.error(e, "Error exporting memory pool %s", poolId);
}
}
return builder.build();
}
Aggregations