Search in sources :

Example 1 with JmxException

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();
}
Also used : JmxException(org.weakref.jmx.JmxException) MemoryPoolId(com.facebook.presto.spi.memory.MemoryPoolId) ImmutableMap(com.google.common.collect.ImmutableMap) HashSet(java.util.HashSet)

Aggregations

MemoryPoolId (com.facebook.presto.spi.memory.MemoryPoolId)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 HashSet (java.util.HashSet)1 JmxException (org.weakref.jmx.JmxException)1