use of com.facebook.presto.ttl.clusterttlprovidermanagers.ConfidenceBasedClusterTtlProviderManager in project presto by prestodb.
the class TestConfidenceBasedClusterTtlProviderManager method setup.
@BeforeClass
public void setup() {
InMemoryNodeManager nodeManager = new InMemoryNodeManager();
nodeManager.addNode(new ConnectorId("prism"), ImmutableSet.of(node1, node2, node3));
ConfidenceBasedNodeTtlFetcherManager nodeTtlFetcherManager = new ConfidenceBasedNodeTtlFetcherManager(nodeManager, new NodeSchedulerConfig(), new NodeTtlFetcherManagerConfig());
NodeTtlFetcherFactory nodeTtlFetcherFactory = new TestingNodeTtlFetcherFactory(nodeToTtl);
nodeTtlFetcherManager.addNodeTtlFetcherFactory(nodeTtlFetcherFactory);
nodeTtlFetcherManager.load(nodeTtlFetcherFactory.getName(), ImmutableMap.of());
nodeTtlFetcherManager.refreshTtlInfo();
clusterTtlProviderManager = new ConfidenceBasedClusterTtlProviderManager(nodeTtlFetcherManager);
ClusterTtlProviderFactory clusterTtlProviderFactory = new TestingClusterTtlProviderFactory();
clusterTtlProviderManager.addClusterTtlProviderFactory(clusterTtlProviderFactory);
clusterTtlProviderManager.load(clusterTtlProviderFactory.getName(), ImmutableMap.of());
}
Aggregations