@Override public synchronized <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new ExampleConnectorFactory(typeManager, getOptionalConfig()))); } return ImmutableList.of(); }
@Override public synchronized <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new RedisConnectorFactory(typeManager, nodeManager, tableDescriptionSupplier, optionalConfig))); } return ImmutableList.of(); }
@Test public ConnectorFactory testConnectorExists() { RedisPlugin plugin = new RedisPlugin(); plugin.setTypeManager(new TestingTypeManager()); plugin.setNodeManager(new TestingNodeManager()); List<ConnectorFactory> factories = plugin.getServices(ConnectorFactory.class); assertNotNull(factories); assertEquals(factories.size(), 1); ConnectorFactory factory = factories.get(0); assertNotNull(factory); return factory; }
@Test public void testStartup() { ConnectorFactory factory = testConnectorExists(); Connector c = factory.create("test-connector", ImmutableMap.<String, String>builder() .put("redis.table-names", "test") .put("redis.nodes", "localhost:6379") .build()); assertNotNull(c); }
@Test public void testCreateConnector() throws Exception { Plugin plugin = new PostgreSqlPlugin(); ConnectorFactory factory = getOnlyElement(plugin.getServices(ConnectorFactory.class)); factory.create("test", ImmutableMap.of("connection-url", "test")); }
@Override public <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new JdbcConnectorFactory(name, module, optionalConfig, getClassLoader()))); } return ImmutableList.of(); }
@Test public void testCreateConnector() throws Exception { Plugin plugin = new MySqlPlugin(); ConnectorFactory factory = getOnlyElement(plugin.getServices(ConnectorFactory.class)); factory.create("test", ImmutableMap.of("connection-url", "test")); }
@Override public <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new HiveConnectorFactory(name, optionalConfig, getClassLoader(), metastore, typeManager, pageIndexerFactory))); } return ImmutableList.of(); }
@Override public <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new RiakConnectorFactory(typeManager, getOptionalConfig()))); } return ImmutableList.of(); }
@Override public <T> List<T> getServices(Class<T> type) { if (type == ConnectorFactory.class) { return ImmutableList.of(type.cast(new KafkaConnectorFactory( "kafka", optionalConfig, getClassLoader()))); } return ImmutableList.of(); }
public SqlEngine(StructuredStore store, ExecutorService executor) { this.store = store; this.executor = executor; MetadataManager metadataManager = new MetadataManager(); SplitManager splitManager = new SplitManager(Sets.<ConnectorSplitManager> newHashSet()); this.dataStreamManager = new DataStreamManager(); HandleResolver handleResolver = new HandleResolver(); Map<String, ConnectorFactory> connectorFactories = Maps.newHashMap(); Map<String, Connector> globalConnectors = Maps.newHashMap(); RecordSinkManager recordSinkManager = new RecordSinkManager(); Map<String, ConnectorOutputHandleResolver> handleIdResolvers = Maps.newHashMap(); OutputTableHandleResolver outputTableHandleResolver = new OutputTableHandleResolver(handleIdResolvers); this.connectorManager = new ConnectorManager(metadataManager, splitManager, dataStreamManager, recordSinkManager, handleResolver, outputTableHandleResolver, connectorFactories, globalConnectors); // NodeManager nodeManager = new InMemoryNodeManager(); PlanOptimizersFactory planOptimizersFactory = new PlanOptimizersFactory(metadataManager, splitManager); List<PlanOptimizer> planOptimizers = planOptimizersFactory.get(); this.metadataManager = metadataManager; this.planOptimizers = planOptimizers; this.periodicImportManager = new StubPeriodicImportManager(); this.storageManager = new StubStorageManager(); NodeManager nodeManager = new InMemoryNodeManager(); CloudataConnectorFactory cloudataConnectorFactory = new CloudataConnectorFactory(nodeManager, Maps.<String, String> newHashMap(), store); connectorManager.addConnectorFactory(cloudataConnectorFactory); connectorManager.createConnection(catalogName, CloudataConnectorFactory.PROVIDER_ID, Maps.<String, String> newHashMap()); this.cloudataConnector = cloudataConnectorFactory.get(catalogName); }