Search in sources :

Example 1 with StateStoreBootstrapper

use of io.prestosql.spi.statestore.StateStoreBootstrapper in project hetu-core by openlookeng.

the class TestStateStoreLauncherAndProvider method setupSecondInstance.

// A second instance is setup using bootstrapper directly to manually configure port
// Using launcher to launch will cause it to read from config file (same port as first member)
private StateStore setupSecondInstance() {
    Map<String, String> config = new HashMap<>();
    config.put("hazelcast.discovery.mode", "tcp-ip");
    config.put("state-store.cluster", "test-cluster");
    config.put(DISCOVERY_PORT_CONFIG_NAME, PORT2);
    StateStoreBootstrapper bootstrapper = new HazelcastStateStoreBootstrapper();
    return bootstrapper.bootstrap(ImmutableSet.of(LOCALHOST + ":" + PORT1, LOCALHOST + ":" + PORT2), config);
}
Also used : HashMap(java.util.HashMap) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) StateStoreBootstrapper(io.prestosql.spi.statestore.StateStoreBootstrapper)

Example 2 with StateStoreBootstrapper

use of io.prestosql.spi.statestore.StateStoreBootstrapper in project hetu-core by openlookeng.

the class TestStateStoreLauncherAndProvider method createStateStoreCluster.

private StateStore createStateStoreCluster(String port) {
    Map<String, String> config = new HashMap<>();
    config.put("hazelcast.discovery.mode", "tcp-ip");
    config.put("state-store.cluster", "test-cluster");
    config.put(DISCOVERY_PORT_CONFIG_NAME, port);
    StateStoreBootstrapper bootstrapper = new HazelcastStateStoreBootstrapper();
    return bootstrapper.bootstrap(ImmutableSet.of(LOCALHOST + ":" + port), config);
}
Also used : HashMap(java.util.HashMap) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) StateStoreBootstrapper(io.prestosql.spi.statestore.StateStoreBootstrapper)

Example 3 with StateStoreBootstrapper

use of io.prestosql.spi.statestore.StateStoreBootstrapper in project hetu-core by openlookeng.

the class PluginManager method installPlugin.

public void installPlugin(Plugin plugin) {
    for (BlockEncoding blockEncoding : plugin.getBlockEncodings()) {
        log.info("Registering block encoding %s", blockEncoding.getName());
        metadataManager.getFunctionAndTypeManager().addBlockEncoding(blockEncoding);
    }
    for (Type type : plugin.getTypes()) {
        log.info("Registering type %s", type.getTypeSignature());
        metadataManager.getFunctionAndTypeManager().addType(type);
    }
    for (ParametricType parametricType : plugin.getParametricTypes()) {
        log.info("Registering parametric type %s", parametricType.getName());
        metadataManager.getFunctionAndTypeManager().addParametricType(parametricType);
    }
    for (ConnectorFactory connectorFactory : plugin.getConnectorFactories()) {
        log.info("Registering connector %s", connectorFactory.getName());
        connectorManager.addConnectorFactory(connectorFactory);
        ConnectorCache.addCatalogConfig(plugin, connectorFactory.getName());
    }
    for (SessionPropertyConfigurationManagerFactory sessionConfigFactory : plugin.getSessionPropertyConfigurationManagerFactories()) {
        log.info("Registering session property configuration manager %s", sessionConfigFactory.getName());
        sessionPropertyDefaults.addConfigurationManagerFactory(sessionConfigFactory);
    }
    for (FunctionNamespaceManagerFactory functionNamespaceManagerFactory : plugin.getFunctionNamespaceManagerFactories()) {
        log.info("Registering function namespace manager %s", functionNamespaceManagerFactory.getName());
        metadataManager.getFunctionAndTypeManager().addFunctionNamespaceFactory(functionNamespaceManagerFactory);
    }
    for (ResourceGroupConfigurationManagerFactory configurationManagerFactory : plugin.getResourceGroupConfigurationManagerFactories()) {
        log.info("Registering resource group configuration manager %s", configurationManagerFactory.getName());
        resourceGroupManager.addConfigurationManagerFactory(configurationManagerFactory);
    }
    for (SystemAccessControlFactory accessControlFactory : plugin.getSystemAccessControlFactories()) {
        log.info("Registering system access control %s", accessControlFactory.getName());
        accessControlManager.addSystemAccessControlFactory(accessControlFactory);
    }
    for (PasswordAuthenticatorFactory authenticatorFactory : plugin.getPasswordAuthenticatorFactories()) {
        log.info("Registering password authenticator %s", authenticatorFactory.getName());
        passwordAuthenticatorManager.addPasswordAuthenticatorFactory(authenticatorFactory);
    }
    for (EventListenerFactory eventListenerFactory : plugin.getEventListenerFactories()) {
        log.info("Registering event listener %s", eventListenerFactory.getName());
        eventListenerManager.addEventListenerFactory(eventListenerFactory);
    }
    for (GroupProviderFactory groupProviderFactory : plugin.getGroupProviderFactories()) {
        log.info("Registering group provider %s", groupProviderFactory.getName());
        groupProviderManager.addGroupProviderFactory(groupProviderFactory);
    }
    // Install StateStorePlugin
    for (StateStoreBootstrapper bootstrapper : plugin.getStateStoreBootstrappers()) {
        log.info("Registering  state store bootstrapper");
        stateStoreLauncher.addStateStoreBootstrapper(bootstrapper);
    }
    for (StateStoreFactory stateStoreFactory : plugin.getStateStoreFactories()) {
        log.info("Registering state store %s", stateStoreFactory.getName());
        localStateStoreProvider.addStateStoreFactory(stateStoreFactory);
    }
    for (SeedStoreFactory seedStoreFactory : plugin.getSeedStoreFactories()) {
        log.info("Registering seed store %s", seedStoreFactory.getName());
        seedStoreManager.addSeedStoreFactory(seedStoreFactory);
    }
    for (CubeProvider cubeProvider : plugin.getCubeProviders()) {
        log.info("Registering cube provider %s", cubeProvider.getName());
        cubeManager.addCubeProvider(cubeProvider);
    }
    for (HetuFileSystemClientFactory fileSystemClientFactory : plugin.getFileSystemClientFactory()) {
        log.info("Registering file system provider %s", fileSystemClientFactory.getName());
        fileSystemClientManager.addFileSystemClientFactories(fileSystemClientFactory);
    }
    for (HetuMetaStoreFactory hetuMetaStoreFactory : plugin.getHetuMetaStoreFactories()) {
        log.info("Registering hetu metastore %s", hetuMetaStoreFactory.getName());
        hetuMetaStoreManager.addHetuMetaStoreFactory(hetuMetaStoreFactory);
    }
    for (IndexFactory indexFactory : plugin.getIndexFactories()) {
        log.info("Loading index factory");
        heuristicIndexerManager.loadIndexFactories(indexFactory);
    }
    installFunctionsPlugin(plugin);
}
Also used : ResourceGroupConfigurationManagerFactory(io.prestosql.spi.resourcegroups.ResourceGroupConfigurationManagerFactory) EventListenerFactory(io.prestosql.spi.eventlistener.EventListenerFactory) HetuFileSystemClientFactory(io.prestosql.spi.filesystem.HetuFileSystemClientFactory) SeedStoreFactory(io.prestosql.spi.seedstore.SeedStoreFactory) SystemAccessControlFactory(io.prestosql.spi.security.SystemAccessControlFactory) ParametricType(io.prestosql.spi.type.ParametricType) Type(io.prestosql.spi.type.Type) PasswordAuthenticatorFactory(io.prestosql.spi.security.PasswordAuthenticatorFactory) ConnectorFactory(io.prestosql.spi.connector.ConnectorFactory) IndexFactory(io.prestosql.spi.heuristicindex.IndexFactory) HetuMetaStoreFactory(io.prestosql.spi.metastore.HetuMetaStoreFactory) ParametricType(io.prestosql.spi.type.ParametricType) CubeProvider(io.prestosql.spi.cube.CubeProvider) FunctionNamespaceManagerFactory(io.prestosql.spi.function.FunctionNamespaceManagerFactory) SessionPropertyConfigurationManagerFactory(io.prestosql.spi.session.SessionPropertyConfigurationManagerFactory) BlockEncoding(io.prestosql.spi.block.BlockEncoding) GroupProviderFactory(io.prestosql.spi.security.GroupProviderFactory) StateStoreBootstrapper(io.prestosql.spi.statestore.StateStoreBootstrapper) StateStoreFactory(io.prestosql.spi.statestore.StateStoreFactory)

Example 4 with StateStoreBootstrapper

use of io.prestosql.spi.statestore.StateStoreBootstrapper in project hetu-core by openlookeng.

the class TestDynamicFilterSourceOperator method createStateStoreCluster.

private StateStore createStateStoreCluster(String port) {
    Map<String, String> config = new HashMap<>();
    config.put("hazelcast.discovery.mode", "tcp-ip");
    config.put("state-store.cluster", "test-cluster");
    config.put(DISCOVERY_PORT_CONFIG_NAME, port);
    StateStoreBootstrapper bootstrapper = new HazelcastStateStoreBootstrapper();
    return bootstrapper.bootstrap(ImmutableSet.of("127.0.0.1:" + port), config);
}
Also used : HashMap(java.util.HashMap) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) HazelcastStateStoreBootstrapper(io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper) StateStoreBootstrapper(io.prestosql.spi.statestore.StateStoreBootstrapper)

Example 5 with StateStoreBootstrapper

use of io.prestosql.spi.statestore.StateStoreBootstrapper in project hetu-core by openlookeng.

the class TestHazelcastClusterLifecycleListener method createStateStoreCluster.

private StateStore createStateStoreCluster(String port) {
    Map<String, String> config = new HashMap<>(0);
    config.put("hazelcast.discovery.mode", "tcp-ip");
    config.put("state-store.cluster", TEST_CLUSTER_NAME);
    config.put(DISCOVERY_PORT_CONFIG_NAME, port);
    StateStoreBootstrapper bootstrapper = new HazelcastStateStoreBootstrapper();
    return bootstrapper.bootstrap(ImmutableSet.of(MEMBER_1_ADDRESS, MEMBER_2_ADDRESS), config);
}
Also used : HashMap(java.util.HashMap) StateStoreBootstrapper(io.prestosql.spi.statestore.StateStoreBootstrapper)

Aggregations

StateStoreBootstrapper (io.prestosql.spi.statestore.StateStoreBootstrapper)13 HashMap (java.util.HashMap)11 HazelcastStateStoreBootstrapper (io.hetu.core.statestore.hazelcast.HazelcastStateStoreBootstrapper)5 Test (org.testng.annotations.Test)5 StateStore (io.prestosql.spi.statestore.StateStore)4 SeedStoreFactory (io.prestosql.spi.seedstore.SeedStoreFactory)2 HttpServerInfo (io.airlift.http.server.HttpServerInfo)1 HetuLocalFileSystemClient (io.hetu.core.filesystem.HetuLocalFileSystemClient)1 LocalConfig (io.hetu.core.filesystem.LocalConfig)1 FileBasedSeedStoreFactory (io.hetu.core.seedstore.filebased.FileBasedSeedStoreFactory)1 HazelcastStateStore (io.hetu.core.statestore.hazelcast.HazelcastStateStore)1 SeedStoreManager (io.prestosql.seedstore.SeedStoreManager)1 InternalCommunicationConfig (io.prestosql.server.InternalCommunicationConfig)1 BlockEncoding (io.prestosql.spi.block.BlockEncoding)1 ConnectorFactory (io.prestosql.spi.connector.ConnectorFactory)1 CubeProvider (io.prestosql.spi.cube.CubeProvider)1 EventListenerFactory (io.prestosql.spi.eventlistener.EventListenerFactory)1 HetuFileSystemClientFactory (io.prestosql.spi.filesystem.HetuFileSystemClientFactory)1 FunctionNamespaceManagerFactory (io.prestosql.spi.function.FunctionNamespaceManagerFactory)1 IndexFactory (io.prestosql.spi.heuristicindex.IndexFactory)1