Search in sources :

Example 1 with MemoryInfo

use of io.trino.memory.MemoryInfo in project trino by trinodb.

the class TestFullNodeCapableNodeAllocator method setupNodeAllocatorService.

private void setupNodeAllocatorService(InMemoryNodeManager nodeManager, int maxFullNodesPerQuery) {
    // just in case
    shutdownNodeAllocatorService();
    MemoryInfo memoryInfo = new MemoryInfo(4, new MemoryPoolInfo(DataSize.of(64, GIGABYTE).toBytes(), 0, 0, ImmutableMap.of(), ImmutableMap.of(), ImmutableMap.of()));
    Map<String, Optional<MemoryInfo>> workerMemoryInfos = ImmutableMap.of(NODE_1.getNodeIdentifier(), Optional.of(memoryInfo), NODE_2.getNodeIdentifier(), Optional.of(memoryInfo), NODE_3.getNodeIdentifier(), Optional.of(memoryInfo), NODE_4.getNodeIdentifier(), Optional.of(memoryInfo));
    nodeAllocatorService = new FullNodeCapableNodeAllocatorService(nodeManager, () -> workerMemoryInfos, maxFullNodesPerQuery, 1.0, false);
    nodeAllocatorService.start();
}
Also used : MemoryInfo(io.trino.memory.MemoryInfo) Optional(java.util.Optional) MemoryPoolInfo(io.trino.spi.memory.MemoryPoolInfo)

Aggregations

MemoryInfo (io.trino.memory.MemoryInfo)1 MemoryPoolInfo (io.trino.spi.memory.MemoryPoolInfo)1 Optional (java.util.Optional)1