本文整理汇总了Java中io.airlift.bootstrap.LifeCycleManager类的典型用法代码示例。如果您正苦于以下问题:Java LifeCycleManager类的具体用法?Java LifeCycleManager怎么用?Java LifeCycleManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LifeCycleManager类属于io.airlift.bootstrap包,在下文中一共展示了LifeCycleManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExampleHttpServer
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
public ExampleHttpServer()
throws Exception
{
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();
}
示例2: RaptorConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public RaptorConnector(
LifeCycleManager lifeCycleManager,
RaptorMetadataFactory metadataFactory,
RaptorSplitManager splitManager,
RaptorPageSourceProvider pageSourceProvider,
RaptorPageSinkProvider pageSinkProvider,
RaptorSessionProperties sessionProperties,
RaptorTableProperties tableProperties,
Set<SystemTable> systemTables)
{
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.sessionProperties = requireNonNull(sessionProperties, "sessionProperties is null").getSessionProperties();
this.tableProperties = requireNonNull(tableProperties, "tableProperties is null").getTableProperties();
this.systemTables = requireNonNull(systemTables, "systemTables is null");
}
示例3: createBackupStore
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Provides
@Singleton
private static Optional<BackupStore> createBackupStore(
@Nullable BackupStore store,
LifeCycleManager lifeCycleManager,
RaptorConnectorId connectorId,
BackupConfig config)
throws Exception
{
if (store == null) {
return Optional.empty();
}
BackupStore proxy = new TimeoutBackupStore(store, connectorId.toString(), config.getTimeout());
lifeCycleManager.addInstance(proxy);
return Optional.of(proxy);
}
示例4: HiveConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
public HiveConnector(
LifeCycleManager lifeCycleManager,
ConnectorMetadata metadata,
ConnectorSplitManager splitManager,
ConnectorPageSourceProvider pageSourceProvider,
ConnectorPageSinkProvider pageSinkProvider,
Set<SystemTable> systemTables,
List<PropertyMetadata<?>> sessionProperties,
List<PropertyMetadata<?>> tableProperties,
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.pageSinkProvider = requireNonNull(pageSinkProvider, "pageSinkProvider is null");
this.systemTables = ImmutableSet.copyOf(requireNonNull(systemTables, "systemTables is null"));
this.sessionProperties = ImmutableList.copyOf(requireNonNull(sessionProperties, "sessionProperties is null"));
this.tableProperties = ImmutableList.copyOf(requireNonNull(tableProperties, "tableProperties is null"));
this.accessControl = requireNonNull(accessControl, "accessControl is null");
}
示例5: testAddressSelector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
private static void testAddressSelector(
AddressSelectorBinder addressSelectorBinder,
Map<String, String> configurationProperties,
List<HostAndPort> expected)
throws Exception
{
Bootstrap app = new Bootstrap(
new ThriftCodecModule(),
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) {
}
}
}
}
示例6: HDFSConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public HDFSConnector(
LifeCycleManager lifeCycleManager,
HDFSMetadataFactory hdfsMetadataFactory,
HDFSSplitManager hdfsSplitManager,
HDFSPageSourceProvider hdfsPageSourceProvider)
{
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.hdfsMetadataFactory = requireNonNull(hdfsMetadataFactory, "hdfsMetadataFactory is null");
this.hdfsSplitManager = requireNonNull(hdfsSplitManager, "hdfsSplitManager is null");
this.hdfsPageSourceProvider = requireNonNull(hdfsPageSourceProvider, "hdfsPageSourceProvider is null");
// this.nodePartitioningProvider = requireNonNull(nodePartitioningProvider, "nodePartitioningProvider is null");
}
示例7: EthereumConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@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");
}
示例8: AmpoolConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public AmpoolConnector(
LifeCycleManager lifeCycleManager,
AmpoolMetadata metadata,
AmpoolSplitManager splitManager,
AmpoolRecordSetProvider 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");
log.info("INFORMATION: AmpoolConnector created.");
}
示例9: KuduConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public KuduConnector(
LifeCycleManager lifeCycleManager,
KuduMetadata metadata,
KuduSplitManager splitManager,
KuduRecordSetProvider recordSetProvider)
{
this.recordSetProvider = recordSetProvider;
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.metadata = requireNonNull(metadata, "metadata is null");
this.splitManager = requireNonNull(splitManager, "splitManager is null");
}
示例10: KafkaConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public KafkaConnector(
LifeCycleManager lifeCycleManager,
KafkaMetadata metadata,
KafkaSplitManager splitManager,
KafkaRecordSetProvider 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");
}
示例11: ExampleConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@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");
}
示例12: TestingDiscoveryServer
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
public TestingDiscoveryServer(String environment)
throws Exception
{
tempDir = Files.createTempDir();
Map<String, String> serverProperties = ImmutableMap.<String, String>builder()
.put("static.db.location", tempDir.getAbsolutePath())
.put("discovery.store-cache-ttl", "0ms")
.build();
Bootstrap app = new Bootstrap(
new MBeanModule(),
new TestingNodeModule(environment),
new TestingHttpServerModule(),
new JsonModule(),
new JaxrsModule(true),
new DiscoveryServerModule(),
new DiscoveryModule(),
new TestingJmxModule());
Injector injector = app
.strictConfig()
.doNotInitializeLogging()
.setRequiredConfigurationProperties(serverProperties)
.initialize();
lifeCycleManager = injector.getInstance(LifeCycleManager.class);
server = injector.getInstance(TestingHttpServer.class);
}
示例13: JdbcConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public JdbcConnector(
LifeCycleManager lifeCycleManager,
JdbcMetadata jdbcMetadata,
JdbcSplitManager jdbcSplitManager,
JdbcRecordSetProvider jdbcRecordSetProvider,
JdbcRecordSinkProvider jdbcRecordSinkProvider)
{
this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null");
this.jdbcMetadata = requireNonNull(jdbcMetadata, "jdbcMetadata is null");
this.jdbcSplitManager = requireNonNull(jdbcSplitManager, "jdbcSplitManager is null");
this.jdbcRecordSetProvider = requireNonNull(jdbcRecordSetProvider, "jdbcRecordSetProvider is null");
this.jdbcRecordSinkProvider = requireNonNull(jdbcRecordSinkProvider, "jdbcRecordSinkProvider is null");
}
示例14: GracefulShutdownHandler
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@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();
}
示例15: CassandraConnector
import io.airlift.bootstrap.LifeCycleManager; //导入依赖的package包/类
@Inject
public CassandraConnector(
LifeCycleManager lifeCycleManager,
CassandraMetadata metadata,
CassandraSplitManager splitManager,
CassandraRecordSetProvider recordSetProvider,
CassandraConnectorRecordSinkProvider recordSinkProvider)
{
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.recordSinkProvider = requireNonNull(recordSinkProvider, "recordSinkProvider is null");
}