use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.
the class ConnectorManager method createConnection.
public synchronized ConnectorId createConnection(String catalogName, String connectorName, Map<String, String> properties) {
requireNonNull(connectorName, "connectorName is null");
ConnectorFactory connectorFactory = connectorFactories.get(connectorName);
checkArgument(connectorFactory != null, "No factory for connector %s", connectorName);
return createConnection(catalogName, connectorFactory, properties);
}
use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.
the class TestMongoPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
MongoPlugin plugin = new MongoPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
Connector connector = factory.create("test", ImmutableMap.of("mongodb.seeds", seed), new TestingConnectorContext());
Type type = getOnlyElement(plugin.getTypes());
assertEquals(type, OBJECT_ID);
connector.shutdown();
}
use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.
the class TestSheetsPlugin method testCreateConnector.
@Test
public void testCreateConnector() throws Exception {
Plugin plugin = new SheetsPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
ImmutableMap.Builder<String, String> propertiesMap = new ImmutableMap.Builder<String, String>().put("credentials-path", getTestCredentialsPath()).put("metadata-sheet-id", TEST_METADATA_SHEET_ID);
Connector connector = factory.create(GOOGLE_SHEETS, propertiesMap.build(), new TestingConnectorContext());
assertNotNull(connector);
connector.shutdown();
}
use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.
the class TestKafkaPlugin method testSpinup.
@Test
public void testSpinup() {
KafkaPlugin plugin = new KafkaPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
assertInstanceOf(factory, KafkaConnectorFactory.class);
Connector c = factory.create("test-connector", ImmutableMap.<String, String>builder().put("kafka.table-names", "test").put("kafka.nodes", "localhost:9092").build(), new TestingConnectorContext());
assertNotNull(c);
}
use of com.facebook.presto.spi.connector.ConnectorFactory in project presto by prestodb.
the class TestKuduPlugin method testCreateConnector.
@Test
public void testCreateConnector() throws Exception {
Plugin plugin = new KuduPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("kudu.client.master-addresses", "localhost:7051"), new TestingConnectorContext());
}
Aggregations