io.airlift.bootstrap.LifeCycleManager Java Examples
The following examples show how to use
io.airlift.bootstrap.LifeCycleManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PrometheusHttpServer.java From presto with Apache License 2.0 | 6 votes |
public PrometheusHttpServer() throws Exception { Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new PrometheusHttpServerModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); baseUri = injector.getInstance(TestingHttpServer.class).getBaseUrl(); }
Example #2
Source File: KuduConnector.java From presto-kudu with Apache License 2.0 | 6 votes |
@Inject public KuduConnector(LifeCycleManager lifeCycleManager, KuduMetadata metadata, ConnectorSplitManager splitManager, ConnectorRecordSetProvider recordSetProvider, KuduTableProperties tableProperties, ConnectorPageSourceProvider pageSourceProvider, ConnectorPageSinkProvider pageSinkProvider, Set<Procedure> procedures) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); }
Example #3
Source File: KuduConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public KuduConnector( LifeCycleManager lifeCycleManager, KuduMetadata metadata, ConnectorSplitManager splitManager, KuduTableProperties tableProperties, ConnectorPageSourceProvider pageSourceProvider, ConnectorPageSinkProvider pageSinkProvider, Set<Procedure> procedures) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); }
Example #4
Source File: AccumuloConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public AccumuloConnector( LifeCycleManager lifeCycleManager, AccumuloMetadataFactory metadataFactory, AccumuloSplitManager splitManager, AccumuloRecordSetProvider recordSetProvider, AccumuloPageSinkProvider pageSinkProvider, AccumuloSessionProperties sessionProperties, AccumuloTableProperties tableProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadataFactory = requireNonNull(metadataFactory, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null"); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); }
Example #5
Source File: JdbcConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public JdbcConnector( LifeCycleManager lifeCycleManager, JdbcMetadataFactory jdbcMetadataFactory, ConnectorSplitManager jdbcSplitManager, ConnectorRecordSetProvider jdbcRecordSetProvider, ConnectorPageSinkProvider jdbcPageSinkProvider, Optional<ConnectorAccessControl> accessControl, Set<Procedure> procedures, Set<SessionPropertiesProvider> sessionProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.jdbcMetadataFactory = requireNonNull(jdbcMetadataFactory, "jdbcMetadataFactory is null"); this.jdbcSplitManager = requireNonNull(jdbcSplitManager, "jdbcSplitManager is null"); this.jdbcRecordSetProvider = requireNonNull(jdbcRecordSetProvider, "jdbcRecordSetProvider is null"); this.jdbcPageSinkProvider = requireNonNull(jdbcPageSinkProvider, "jdbcPageSinkProvider is null"); this.accessControl = requireNonNull(accessControl, "accessControl is null"); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").stream() .flatMap(sessionPropertiesProvider -> sessionPropertiesProvider.getSessionProperties().stream()) .collect(toImmutableList()); }
Example #6
Source File: PhoenixConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public PhoenixConnector( LifeCycleManager lifeCycleManager, ConnectorMetadata metadata, ConnectorSplitManager splitManager, ConnectorRecordSetProvider recordSetProvider, ConnectorPageSinkProvider pageSinkProvider, PhoenixTableProperties tableProperties, PhoenixColumnProperties columnProperties, Set<SessionPropertiesProvider> sessionProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); this.columnProperties = requireNonNull(columnProperties, "columnProperties is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").stream() .flatMap(sessionPropertiesProvider -> sessionPropertiesProvider.getSessionProperties().stream()) .collect(toImmutableList()); }
Example #7
Source File: CassandraConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public CassandraConnector( LifeCycleManager lifeCycleManager, CassandraMetadata metadata, CassandraSplitManager splitManager, CassandraRecordSetProvider recordSetProvider, CassandraPageSinkProvider pageSinkProvider, CassandraSessionProperties sessionProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.sessionProperties = requireNonNull(sessionProperties.getSessionProperties(), "sessionProperties is null"); }
Example #8
Source File: BackupModule.java From presto with Apache License 2.0 | 6 votes |
@Provides @Singleton private static Optional<BackupStore> createBackupStore( @Nullable BackupStore store, LifeCycleManager lifeCycleManager, MBeanExporter exporter, RaptorConnectorId connectorId, BackupConfig config) { if (store == null) { return Optional.empty(); } BackupStore proxy = new TimeoutBackupStore( store, connectorId.toString(), config.getTimeout(), config.getTimeoutThreads()); lifeCycleManager.addInstance(proxy); BackupStore managed = new ManagedBackupStore(proxy); exporter.exportWithGeneratedName(managed, BackupStore.class, connectorId.toString()); return Optional.of(managed); }
Example #9
Source File: HbaseConnector.java From presto-connectors with Apache License 2.0 | 6 votes |
@Inject public HbaseConnector( LifeCycleManager lifeCycleManager, HbaseMetadata metadata, HbaseSplitManager splitManager, HbaseRecordSetProvider recordSetProvider, HbasePageSinkProvider pageSinkProvider, HbaseSessionProperties sessionProperties, HbaseTableProperties tableProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null"); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); }
Example #10
Source File: ElasticsearchConnector.java From presto-connectors with Apache License 2.0 | 6 votes |
@Inject public ElasticsearchConnector( ElasticsearchConnectorId connectorId, BaseClient client, LifeCycleManager lifeCycleManager, ElasticsearchSplitManager splitManager, ElasticsearchPageSourceProvider pageSourceProvider, ElasticsearchPageSinkProvider pageSinkProvider, ElasticsearchSessionProperties sessionProperties) { this.connectorId = requireNonNull(connectorId, "connectorId is null"); this.client = requireNonNull(client, "client is null"); this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null"); // this.tableProperties = requireNonNull(tableProperties, "tableProperties is null"); }
Example #11
Source File: ThriftConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public ThriftConnector( LifeCycleManager lifeCycleManager, ThriftMetadata metadata, ThriftSplitManager splitManager, ThriftPageSourceProvider pageSourceProvider, ThriftSessionProperties sessionProperties, ThriftIndexProvider indexProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null"); this.indexProvider = requireNonNull(indexProvider, "indexProvider is null"); }
Example #12
Source File: PinotConnector.java From presto with Apache License 2.0 | 6 votes |
@Inject public PinotConnector( LifeCycleManager lifeCycleManager, PinotMetadata metadata, PinotSplitManager splitManager, PinotPageSourceProvider pageSourceProvider, PinotNodePartitioningProvider partitioningProvider, PinotSessionProperties pinotSessionProperties) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.partitioningProvider = requireNonNull(partitioningProvider, "partitioningProvider is null"); this.sessionProperties = requireNonNull(pinotSessionProperties, "sessionProperties is null"); }
Example #13
Source File: TestProxyServer.java From presto with Apache License 2.0 | 5 votes |
@BeforeClass public void setupServer() throws Exception { byte[] sharedSecret = Base64.getMimeEncoder().encode("test secret".getBytes(US_ASCII)); sharedSecretFile = Files.createTempFile("secret", "txt"); Files.write(sharedSecretFile, sharedSecret); Logging.initialize(); server = TestingPrestoServer.create(); server.installPlugin(new TpchPlugin()); server.createCatalog("tpch", "tpch"); server.installPlugin(new BlackHolePlugin()); server.createCatalog("blackhole", "blackhole"); server.refreshNodes(); Bootstrap app = new Bootstrap( new TestingNodeModule("test"), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(), new TestingJmxModule(), new ProxyModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .setRequiredConfigurationProperty("proxy.uri", server.getBaseUrl().toString()) .setRequiredConfigurationProperty("proxy.shared-secret-file", sharedSecretFile.toString()) .quiet() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); httpServerInfo = injector.getInstance(HttpServerInfo.class); executorService = newCachedThreadPool(daemonThreadsNamed("test-%s")); setupTestTable(); }
Example #14
Source File: SheetsConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public SheetsConnector( LifeCycleManager lifeCycleManager, SheetsMetadata metadata, SheetsSplitManager splitManager, SheetsRecordSetProvider recordSetProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); }
Example #15
Source File: HiveConnector.java From presto with Apache License 2.0 | 5 votes |
public HiveConnector( LifeCycleManager lifeCycleManager, TransactionalMetadataFactory metadataFactory, HiveTransactionManager transactionManager, ConnectorSplitManager splitManager, ConnectorPageSourceProvider pageSourceProvider, ConnectorPageSinkProvider pageSinkProvider, ConnectorNodePartitioningProvider nodePartitioningProvider, Set<SystemTable> systemTables, Set<Procedure> procedures, Set<EventListener> eventListeners, List<PropertyMetadata<?>> sessionProperties, List<PropertyMetadata<?>> schemaProperties, List<PropertyMetadata<?>> tableProperties, List<PropertyMetadata<?>> analyzeProperties, ConnectorAccessControl accessControl, ClassLoader classLoader) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadataFactory = requireNonNull(metadataFactory, "metadata is null"); this.transactionManager = requireNonNull(transactionManager, "transactionManager is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.nodePartitioningProvider = requireNonNull(nodePartitioningProvider, "nodePartitioningProvider is null"); this.systemTables = ImmutableSet.copyOf(requireNonNull(systemTables, "systemTables is null")); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); this.eventListeners = ImmutableSet.copyOf(requireNonNull(eventListeners, "eventListeners is null")); this.sessionProperties = ImmutableList.copyOf(requireNonNull(sessionProperties, "sessionProperties is null")); this.schemaProperties = ImmutableList.copyOf(requireNonNull(schemaProperties, "schemaProperties is null")); this.tableProperties = ImmutableList.copyOf(requireNonNull(tableProperties, "tableProperties is null")); this.analyzeProperties = ImmutableList.copyOf(requireNonNull(analyzeProperties, "analyzeProperties is null")); this.accessControl = requireNonNull(accessControl, "accessControl is null"); this.classLoader = requireNonNull(classLoader, "classLoader is null"); }
Example #16
Source File: AtopConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public AtopConnector( LifeCycleManager lifeCycleManager, AtopMetadata metadata, AtopSplitManager splitManager, AtopPageSourceProvider pageSourceProvider, ConnectorAccessControl accessControl) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.accessControl = requireNonNull(accessControl, "accessControl is null"); }
Example #17
Source File: HBaseConnector.java From presto-hbase-connector with Apache License 2.0 | 5 votes |
@Inject public HBaseConnector(LifeCycleManager lifeCycleManager, HBaseMetadata metadata, HBaseSplitManager splitManager, ConnectorPageSinkProvider pageSinkProvider, ConnectorPageSourceProvider pageSourceProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); }
Example #18
Source File: TestSimpleAddressSelectorBinder.java From drift with Apache License 2.0 | 5 votes |
private static void testAddressSelector( AddressSelectorBinder addressSelectorBinder, Map<String, String> configurationProperties, List<HostAndPort> expected) throws Exception { Bootstrap app = new Bootstrap( binder -> addressSelectorBinder.bind(binder, THRIFT_SERVICE_ANNOTATION, "testService")); LifeCycleManager lifeCycleManager = null; try { Injector injector = app .setRequiredConfigurationProperties(configurationProperties) .strictConfig() .doNotInitializeLogging() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); AddressSelector<?> addressSelector = injector.getInstance(Key.get(AddressSelector.class, THRIFT_SERVICE_ANNOTATION)); assertInstanceOf(addressSelector, SimpleAddressSelector.class); SimpleAddressSelector simpleAddressSelector = (SimpleAddressSelector) addressSelector; assertEquals(simpleAddressSelector.getAddresses(), expected); } finally { if (lifeCycleManager != null) { try { lifeCycleManager.stop(); } catch (Exception ignored) { } } } }
Example #19
Source File: ParaflowConnector.java From paraflow with Apache License 2.0 | 5 votes |
@Inject public ParaflowConnector( LifeCycleManager lifeCycleManager, ParaflowMetadataFactory paraflowMetadataFactory, ParaflowSplitManager paraflowSplitManager, ParaflowPageSourceProvider paraflowPageSourceProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.paraflowMetadataFactory = requireNonNull(paraflowMetadataFactory, "paraflowMetadataFactory is null"); this.paraflowSplitManager = requireNonNull(paraflowSplitManager, "paraflowSplitManager is null"); this.paraflowPageSourceProvider = requireNonNull(paraflowPageSourceProvider, "paraflowPageSourceProvider is null"); }
Example #20
Source File: EthereumConnector.java From presto-ethereum with Apache License 2.0 | 5 votes |
@Inject public EthereumConnector( LifeCycleManager lifeCycleManager, EthereumMetadata metadata, EthereumSplitManager splitManager, EthereumRecordSetProvider recordSetProvider ) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); }
Example #21
Source File: PulsarConnector.java From pulsar with Apache License 2.0 | 5 votes |
@Inject public PulsarConnector( LifeCycleManager lifeCycleManager, PulsarMetadata metadata, PulsarSplitManager splitManager, PulsarRecordSetProvider recordSetProvider, PulsarConnectorConfig pulsarConnectorConfig ) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.pulsarConnectorConfig = requireNonNull(pulsarConnectorConfig, "pulsarConnectorConfig is null"); }
Example #22
Source File: LocalFileConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public LocalFileConnector( LifeCycleManager lifeCycleManager, LocalFileMetadata metadata, LocalFileSplitManager splitManager, LocalFileRecordSetProvider recordSetProvider) { this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); }
Example #23
Source File: PrometheusConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public PrometheusConnector( LifeCycleManager lifeCycleManager, PrometheusMetadata metadata, PrometheusSplitManager splitManager, PrometheusRecordSetProvider recordSetProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); }
Example #24
Source File: ExampleConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public ExampleConnector( LifeCycleManager lifeCycleManager, ExampleMetadata metadata, ExampleSplitManager splitManager, ExampleRecordSetProvider recordSetProvider) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.recordSetProvider = requireNonNull(recordSetProvider, "recordSetProvider is null"); }
Example #25
Source File: ExampleHttpServer.java From presto with Apache License 2.0 | 5 votes |
public ExampleHttpServer() { Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new ExampleHttpServerModule()); Injector injector = app .strictConfig() .doNotInitializeLogging() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); baseUri = injector.getInstance(TestingHttpServer.class).getBaseUrl(); }
Example #26
Source File: GracefulShutdownHandler.java From presto with Apache License 2.0 | 5 votes |
@Inject public GracefulShutdownHandler( TaskManager sqlTaskManager, ServerConfig serverConfig, ShutdownAction shutdownAction, LifeCycleManager lifeCycleManager) { this.sqlTaskManager = requireNonNull(sqlTaskManager, "sqlTaskManager is null"); this.shutdownAction = requireNonNull(shutdownAction, "shutdownAction is null"); this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.isCoordinator = requireNonNull(serverConfig, "serverConfig is null").isCoordinator(); this.gracePeriod = serverConfig.getGracePeriod(); }
Example #27
Source File: RaptorConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public RaptorConnector( LifeCycleManager lifeCycleManager, NodeManager nodeManager, RaptorMetadataFactory metadataFactory, RaptorSplitManager splitManager, RaptorPageSourceProvider pageSourceProvider, RaptorPageSinkProvider pageSinkProvider, RaptorNodePartitioningProvider nodePartitioningProvider, RaptorSessionProperties sessionProperties, RaptorTableProperties tableProperties, Set<SystemTable> systemTables, ConnectorAccessControl accessControl, @ForMetadata IDBI dbi) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadataFactory = requireNonNull(metadataFactory, "metadataFactory is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null"); this.nodePartitioningProvider = requireNonNull(nodePartitioningProvider, "nodePartitioningProvider is null"); this.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").getSessionProperties(); this.tableProperties = requireNonNull(tableProperties, "tableProperties is null").getTableProperties(); this.systemTables = requireNonNull(systemTables, "systemTables is null"); this.accessControl = requireNonNull(accessControl, "accessControl is null"); this.dao = onDemandDao(dbi, MetadataDao.class); this.coordinator = nodeManager.getCurrentNode().isCoordinator(); }
Example #28
Source File: TestHttpBackupStore.java From presto with Apache License 2.0 | 5 votes |
@BeforeMethod public void setup() { temporary = createTempDir(); Map<String, String> properties = ImmutableMap.<String, String>builder() .put("backup.http.uri", "http://localhost:8080") .build(); Bootstrap app = new Bootstrap( new TestingNodeModule(), new TestingHttpServerModule(), new JsonModule(), new JaxrsModule(), binder -> jaxrsBinder(binder).bind(TestingHttpBackupResource.class), binder -> binder.bind(NodeManager.class).toInstance(new TestingNodeManager()), override(new HttpBackupModule()).with(new TestingModule())); Injector injector = app .strictConfig() .setRequiredConfigurationProperties(properties) .doNotInitializeLogging() .quiet() .initialize(); lifeCycleManager = injector.getInstance(LifeCycleManager.class); store = injector.getInstance(BackupStore.class); }
Example #29
Source File: TestRaptorConnector.java From presto with Apache License 2.0 | 5 votes |
@BeforeMethod public void setup() { TypeManager typeManager = new InternalTypeManager(createTestMetadataManager()); DBI dbi = new DBI("jdbc:h2:mem:test" + System.nanoTime() + ThreadLocalRandom.current().nextLong()); dbi.registerMapper(new TableColumn.Mapper(typeManager)); dummyHandle = dbi.open(); metadataDao = dbi.onDemand(MetadataDao.class); createTablesWithRetry(dbi); dataDir = Files.createTempDir(); RaptorConnectorId connectorId = new RaptorConnectorId("test"); NodeManager nodeManager = new TestingNodeManager(); NodeSupplier nodeSupplier = nodeManager::getWorkerNodes; ShardManager shardManager = createShardManager(dbi); StorageManager storageManager = createOrcStorageManager(dbi, dataDir); StorageManagerConfig config = new StorageManagerConfig(); connector = new RaptorConnector( new LifeCycleManager(ImmutableList.of(), null), new TestingNodeManager(), new RaptorMetadataFactory(dbi, shardManager), new RaptorSplitManager(connectorId, nodeSupplier, shardManager, false), new RaptorPageSourceProvider(storageManager), new RaptorPageSinkProvider(storageManager, new PagesIndexPageSorter(new PagesIndex.TestingFactory(false)), new TemporalFunction(DateTimeZone.forID("America/Los_Angeles")), config), new RaptorNodePartitioningProvider(nodeSupplier), new RaptorSessionProperties(config), new RaptorTableProperties(typeManager), ImmutableSet.of(), new AllowAllAccessControl(), dbi); }
Example #30
Source File: ElasticsearchConnector.java From presto with Apache License 2.0 | 5 votes |
@Inject public ElasticsearchConnector( LifeCycleManager lifeCycleManager, ElasticsearchMetadata metadata, ElasticsearchSplitManager splitManager, ElasticsearchPageSourceProvider pageSourceProvider, NodesSystemTable nodesSystemTable) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.metadata = requireNonNull(metadata, "metadata is null"); this.splitManager = requireNonNull(splitManager, "splitManager is null"); this.pageSourceProvider = requireNonNull(pageSourceProvider, "pageSourceProvider is null"); this.nodesSystemTable = requireNonNull(nodesSystemTable, "nodesSystemTable is null"); }