当前位置: 首页>>代码示例>>Java>>正文


Java LifeCycleManager类代码示例

本文整理汇总了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();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:17,代码来源:ExampleHttpServer.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:21,代码来源:RaptorConnector.java

示例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);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:18,代码来源:BackupModule.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:22,代码来源:HiveConnector.java

示例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) {
            }
        }
    }
}
 
开发者ID:airlift,项目名称:drift,代码行数:35,代码来源:TestSimpleAddressSelectorBinder.java

示例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");
    }
 
开发者ID:dbiir,项目名称:paraflow,代码行数:14,代码来源:HDFSConnector.java

示例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");
}
 
开发者ID:xiaoyao1991,项目名称:presto-ethereum,代码行数:13,代码来源:EthereumConnector.java

示例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.");
}
 
开发者ID:ampool,项目名称:monarch,代码行数:14,代码来源:AmpoolConnector.java

示例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");
}
 
开发者ID:trackingio,项目名称:presto-kudu,代码行数:13,代码来源:KuduConnector.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:13,代码来源:KafkaConnector.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:13,代码来源:ExampleConnector.java

示例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);
}
 
开发者ID:y-lan,项目名称:presto,代码行数:31,代码来源:TestingDiscoveryServer.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:15,代码来源:JdbcConnector.java

示例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();
}
 
开发者ID:y-lan,项目名称:presto,代码行数:14,代码来源:GracefulShutdownHandler.java

示例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");
}
 
开发者ID:y-lan,项目名称:presto,代码行数:15,代码来源:CassandraConnector.java


注:本文中的io.airlift.bootstrap.LifeCycleManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。