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();
}
Aggregations