use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class SplitManager method getSplits.
public SplitSource getSplits(Session session, TableLayoutHandle layout) {
ConnectorId connectorId = layout.getConnectorId();
ConnectorSplitManager splitManager = getConnectorSplitManager(connectorId);
ConnectorSession connectorSession = session.toConnectorSession(connectorId);
ConnectorSplitSource source = splitManager.getSplits(layout.getTransactionHandle(), connectorSession, layout.getConnectorHandle());
SplitSource splitSource = new ConnectorAwareSplitSource(connectorId, layout.getTransactionHandle(), source);
if (minScheduleSplitBatchSize > 1) {
splitSource = new BufferingSplitSource(splitSource, minScheduleSplitBatchSize);
}
return splitSource;
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class LocalQueryRunner method createCatalog.
public void createCatalog(String catalogName, ConnectorFactory connectorFactory, Map<String, String> properties) {
nodeManager.addCurrentNodeConnector(new ConnectorId(catalogName));
connectorManager.addConnectorFactory(connectorFactory);
connectorManager.createConnection(catalogName, connectorFactory.getName(), properties);
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class TestSystemSplit method testSerialization.
@Test
public void testSerialization() throws Exception {
ConnectorId connectorId = new ConnectorId("testid");
SystemTableHandle tableHandle = new SystemTableHandle(connectorId, "xyz", "foo");
SystemSplit expected = new SystemSplit(connectorId, tableHandle, HostAddress.fromParts("127.0.0.1", 0), TupleDomain.all());
JsonCodec<SystemSplit> codec = jsonCodec(SystemSplit.class);
SystemSplit actual = codec.fromJson(codec.toJson(expected));
assertEquals(actual.getConnectorId(), expected.getConnectorId());
assertEquals(actual.getTableHandle(), expected.getTableHandle());
assertEquals(actual.getAddresses(), expected.getAddresses());
assertEquals(actual.getConstraint(), expected.getConstraint());
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class MockRemoteTaskFactory method createTableScanTask.
public MockRemoteTask createTableScanTask(TaskId taskId, Node newNode, List<Split> splits, PartitionedSplitCountTracker partitionedSplitCountTracker) {
Symbol symbol = new Symbol("column");
PlanNodeId sourceId = new PlanNodeId("sourceId");
PlanFragment testFragment = new PlanFragment(new PlanFragmentId("test"), new TableScanNode(sourceId, new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null), ImmutableMap.of(symbol, VARCHAR), SOURCE_DISTRIBUTION, ImmutableList.of(sourceId), new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), ImmutableList.of(symbol)));
ImmutableMultimap.Builder<PlanNodeId, Split> initialSplits = ImmutableMultimap.builder();
for (Split sourceSplit : splits) {
initialSplits.put(sourceId, sourceSplit);
}
return createRemoteTask(TEST_SESSION, taskId, newNode, testFragment, initialSplits.build(), createInitialEmptyOutputBuffers(BROADCAST), partitionedSplitCountTracker, true);
}
use of com.facebook.presto.connector.ConnectorId in project presto by prestodb.
the class TestOutput method testRoundTrip.
@Test
public void testRoundTrip() throws Exception {
Output expected = new Output(new ConnectorId("connectorId"), "schema", "table");
String json = codec.toJson(expected);
Output actual = codec.fromJson(json);
assertEquals(actual, expected);
}
Aggregations