Search in sources :

Example 16 with HostAddress

use of com.facebook.presto.spi.HostAddress in project presto by prestodb.

the class TestJmxSplitManager method testNoPredicate.

@Test
public void testNoPredicate() throws Exception {
    ConnectorTableLayoutHandle layout = new JmxTableLayoutHandle(tableHandle, TupleDomain.all());
    ConnectorSplitSource splitSource = splitManager.getSplits(JmxTransactionHandle.INSTANCE, SESSION, layout);
    List<ConnectorSplit> allSplits = getAllSplits(splitSource);
    assertEquals(allSplits.size(), nodes.size());
    Set<String> actualNodes = nodes.stream().map(Node::getNodeIdentifier).collect(toSet());
    Set<String> expectedNodes = new HashSet<>();
    for (ConnectorSplit split : allSplits) {
        List<HostAddress> addresses = split.getAddresses();
        assertEquals(addresses.size(), 1);
        expectedNodes.add(addresses.get(0).getHostText());
    }
    assertEquals(actualNodes, expectedNodes);
}
Also used : ConnectorTableLayoutHandle(com.facebook.presto.spi.ConnectorTableLayoutHandle) ConnectorSplitSource(com.facebook.presto.spi.ConnectorSplitSource) HostAddress(com.facebook.presto.spi.HostAddress) ConnectorSplit(com.facebook.presto.spi.ConnectorSplit) HashSet(java.util.HashSet) Test(org.testng.annotations.Test)

Aggregations

HostAddress (com.facebook.presto.spi.HostAddress)16 ConnectorSplit (com.facebook.presto.spi.ConnectorSplit)9 ImmutableList (com.google.common.collect.ImmutableList)9 FixedSplitSource (com.facebook.presto.spi.FixedSplitSource)5 Node (com.facebook.presto.spi.Node)5 HashSet (java.util.HashSet)5 Test (org.testng.annotations.Test)4 Split (com.facebook.presto.metadata.Split)3 ImmutableSet (com.google.common.collect.ImmutableSet)3 HashMap (java.util.HashMap)3 List (java.util.List)3 Map (java.util.Map)3 Host (com.datastax.driver.core.Host)2 HostAddressFactory (com.facebook.presto.cassandra.util.HostAddressFactory)2 InternalNodeManager (com.facebook.presto.metadata.InternalNodeManager)2 ColumnHandle (com.facebook.presto.spi.ColumnHandle)2 ConnectorSplitSource (com.facebook.presto.spi.ConnectorSplitSource)2 ConnectorTableLayoutHandle (com.facebook.presto.spi.ConnectorTableLayoutHandle)2 ImmutableMap (com.google.common.collect.ImmutableMap)2 ImmutableSetMultimap (com.google.common.collect.ImmutableSetMultimap)2