Search in sources :

Example 1 with ConfidenceBasedClusterTtlProviderManager

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());
}
Also used : ConfidenceBasedClusterTtlProviderManager(com.facebook.presto.ttl.clusterttlprovidermanagers.ConfidenceBasedClusterTtlProviderManager) NodeTtlFetcherFactory(com.facebook.presto.spi.ttl.NodeTtlFetcherFactory) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) ConfidenceBasedNodeTtlFetcherManager(com.facebook.presto.ttl.nodettlfetchermanagers.ConfidenceBasedNodeTtlFetcherManager) NodeTtlFetcherManagerConfig(com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManagerConfig) TestingClusterTtlProviderFactory(com.facebook.presto.spi.ttl.TestingClusterTtlProviderFactory) TestingClusterTtlProviderFactory(com.facebook.presto.spi.ttl.TestingClusterTtlProviderFactory) ClusterTtlProviderFactory(com.facebook.presto.spi.ttl.ClusterTtlProviderFactory) NodeSchedulerConfig(com.facebook.presto.execution.scheduler.NodeSchedulerConfig) TestingNodeTtlFetcherFactory(com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory) InMemoryNodeManager(com.facebook.presto.metadata.InMemoryNodeManager) ConnectorId(com.facebook.presto.spi.ConnectorId) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

NodeSchedulerConfig (com.facebook.presto.execution.scheduler.NodeSchedulerConfig)1 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)1 ConnectorId (com.facebook.presto.spi.ConnectorId)1 ClusterTtlProviderFactory (com.facebook.presto.spi.ttl.ClusterTtlProviderFactory)1 NodeTtlFetcherFactory (com.facebook.presto.spi.ttl.NodeTtlFetcherFactory)1 TestingClusterTtlProviderFactory (com.facebook.presto.spi.ttl.TestingClusterTtlProviderFactory)1 TestingNodeTtlFetcherFactory (com.facebook.presto.spi.ttl.TestingNodeTtlFetcherFactory)1 ConfidenceBasedClusterTtlProviderManager (com.facebook.presto.ttl.clusterttlprovidermanagers.ConfidenceBasedClusterTtlProviderManager)1 ConfidenceBasedNodeTtlFetcherManager (com.facebook.presto.ttl.nodettlfetchermanagers.ConfidenceBasedNodeTtlFetcherManager)1 NodeTtlFetcherManagerConfig (com.facebook.presto.ttl.nodettlfetchermanagers.NodeTtlFetcherManagerConfig)1 BeforeClass (org.testng.annotations.BeforeClass)1