use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestingPrestoServerLauncher method run.
public void run() throws Exception {
try (TestingPrestoServer server = new TestingPrestoServer()) {
for (String pluginClass : options.getPluginClassNames()) {
Plugin plugin = (Plugin) Class.forName(pluginClass).getConstructor().newInstance();
server.installPlugin(plugin);
}
for (Catalog catalog : options.getCatalogs()) {
server.createCatalog(catalog.getCatalogName(), catalog.getConnectorName());
}
System.out.println(server.getAddress());
waitForInterruption();
}
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestPostgreSqlPlugin method testCreateConnector.
@Test
public void testCreateConnector() {
Plugin plugin = new PostgreSqlPlugin();
ConnectorFactory factory = getOnlyElement(plugin.getConnectorFactories());
factory.create("test", ImmutableMap.of("connection-url", "test"), new TestingConnectorContext());
}
use of com.facebook.presto.spi.Plugin in project presto by prestodb.
the class TestMetadataManager method setUp.
@BeforeClass
public void setUp() throws Exception {
queryRunner = TpchQueryRunnerBuilder.builder().build();
queryRunner.installPlugin(new Plugin() {
@Override
public Iterable<ConnectorFactory> getConnectorFactories() {
MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")).withListTables((session, schemaNameOrNull) -> {
throw new UnsupportedOperationException();
}).withGetViews((session, prefix) -> ImmutableMap.of()).withGetColumnHandles((session, tableHandle) -> {
throw new UnsupportedOperationException();
}).withGetTableStatistics(() -> {
throw new UnsupportedOperationException();
}).build();
return ImmutableList.of(connectorFactory);
}
});
queryRunner.createCatalog("upper_case_schema_catalog", "mock");
metadataManager = (MetadataManager) queryRunner.getMetadata();
}
Aggregations