Search in sources :

Example 1 with BlockEncoding

use of io.prestosql.spi.block.BlockEncoding 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 2 with BlockEncoding

use of io.prestosql.spi.block.BlockEncoding in project hetu-core by openlookeng.

the class ExternalBlockEncodingSerde method readBlock.

@Override
public Block readBlock(SliceInput input) {
    // read the encoding name
    String encodingName = readLengthPrefixedString(input);
    // look up the encoding factory
    BlockEncoding blockEncoding = blockEncodings.get(encodingName);
    // load read the encoding factory from the output stream
    return blockEncoding.readBlock(this, input);
}
Also used : IntArrayBlockEncoding(io.prestosql.spi.block.IntArrayBlockEncoding) ByteArrayBlockEncoding(io.prestosql.spi.block.ByteArrayBlockEncoding) SingleMapBlockEncoding(io.prestosql.spi.block.SingleMapBlockEncoding) LongArrayBlockEncoding(io.prestosql.spi.block.LongArrayBlockEncoding) BlockEncoding(io.prestosql.spi.block.BlockEncoding) DictionaryBlockEncoding(io.prestosql.spi.block.DictionaryBlockEncoding) RowBlockEncoding(io.prestosql.spi.block.RowBlockEncoding) ArrayBlockEncoding(io.prestosql.spi.block.ArrayBlockEncoding) SingleRowBlockEncoding(io.prestosql.spi.block.SingleRowBlockEncoding) RunLengthBlockEncoding(io.prestosql.spi.block.RunLengthBlockEncoding) VariableWidthBlockEncoding(io.prestosql.spi.block.VariableWidthBlockEncoding) Int128ArrayBlockEncoding(io.prestosql.spi.block.Int128ArrayBlockEncoding) MapBlockEncoding(io.prestosql.spi.block.MapBlockEncoding) LazyBlockEncoding(io.prestosql.spi.block.LazyBlockEncoding) ShortArrayBlockEncoding(io.prestosql.spi.block.ShortArrayBlockEncoding)

Example 3 with BlockEncoding

use of io.prestosql.spi.block.BlockEncoding in project hetu-core by openlookeng.

the class FunctionAndTypeManager method addBlockEncoding.

public void addBlockEncoding(BlockEncoding blockEncoding) {
    requireNonNull(blockEncoding, "blockEncoding is null");
    BlockEncoding existingEntry = blockEncodings.putIfAbsent(blockEncoding.getName(), blockEncoding);
    checkArgument(existingEntry == null, "Encoding already registered: %s", blockEncoding.getName());
}
Also used : ByteArrayBlockEncoding(io.prestosql.spi.block.ByteArrayBlockEncoding) Int128ArrayBlockEncoding(io.prestosql.spi.block.Int128ArrayBlockEncoding) IntArrayBlockEncoding(io.prestosql.spi.block.IntArrayBlockEncoding) LongArrayBlockEncoding(io.prestosql.spi.block.LongArrayBlockEncoding) SingleRowBlockEncoding(io.prestosql.spi.block.SingleRowBlockEncoding) LazyBlockEncoding(io.prestosql.spi.block.LazyBlockEncoding) SingleMapBlockEncoding(io.prestosql.spi.block.SingleMapBlockEncoding) RowBlockEncoding(io.prestosql.spi.block.RowBlockEncoding) ArrayBlockEncoding(io.prestosql.spi.block.ArrayBlockEncoding) RunLengthBlockEncoding(io.prestosql.spi.block.RunLengthBlockEncoding) VariableWidthBlockEncoding(io.prestosql.spi.block.VariableWidthBlockEncoding) ShortArrayBlockEncoding(io.prestosql.spi.block.ShortArrayBlockEncoding) BlockEncoding(io.prestosql.spi.block.BlockEncoding) DictionaryBlockEncoding(io.prestosql.spi.block.DictionaryBlockEncoding) MapBlockEncoding(io.prestosql.spi.block.MapBlockEncoding)

Example 4 with BlockEncoding

use of io.prestosql.spi.block.BlockEncoding in project hetu-core by openlookeng.

the class FunctionAndTypeManager method getBlockEncoding.

public BlockEncoding getBlockEncoding(String encodingName) {
    BlockEncoding blockEncoding = blockEncodings.get(encodingName);
    checkArgument(blockEncoding != null, "Unknown block encoding: %s", encodingName);
    return blockEncoding;
}
Also used : ByteArrayBlockEncoding(io.prestosql.spi.block.ByteArrayBlockEncoding) Int128ArrayBlockEncoding(io.prestosql.spi.block.Int128ArrayBlockEncoding) IntArrayBlockEncoding(io.prestosql.spi.block.IntArrayBlockEncoding) LongArrayBlockEncoding(io.prestosql.spi.block.LongArrayBlockEncoding) SingleRowBlockEncoding(io.prestosql.spi.block.SingleRowBlockEncoding) LazyBlockEncoding(io.prestosql.spi.block.LazyBlockEncoding) SingleMapBlockEncoding(io.prestosql.spi.block.SingleMapBlockEncoding) RowBlockEncoding(io.prestosql.spi.block.RowBlockEncoding) ArrayBlockEncoding(io.prestosql.spi.block.ArrayBlockEncoding) RunLengthBlockEncoding(io.prestosql.spi.block.RunLengthBlockEncoding) VariableWidthBlockEncoding(io.prestosql.spi.block.VariableWidthBlockEncoding) ShortArrayBlockEncoding(io.prestosql.spi.block.ShortArrayBlockEncoding) BlockEncoding(io.prestosql.spi.block.BlockEncoding) DictionaryBlockEncoding(io.prestosql.spi.block.DictionaryBlockEncoding) MapBlockEncoding(io.prestosql.spi.block.MapBlockEncoding)

Example 5 with BlockEncoding

use of io.prestosql.spi.block.BlockEncoding in project hetu-core by openlookeng.

the class KryoBlockEncodingSerde method readBlock.

/**
 * Read a block encoding from the input.
 *
 * @param inputStream
 */
@Override
public Block readBlock(InputStream inputStream) {
    if (!(inputStream instanceof Input)) {
        throw new PrestoException(StandardErrorCode.GENERIC_INTERNAL_ERROR, "This interface should not be called in this flow");
    }
    Input input = (Input) inputStream;
    String encodingName;
    // read the encoding name
    encodingName = readLengthPrefixedString((Input) input);
    // look up the encoding factory
    BlockEncoding blockEncoding = functionAndTypeManager.getBlockEncoding(encodingName);
    Serializer<?> serializer = getSerializerFromBlockEncoding(blockEncoding);
    if (serializer == null) {
        return (Block) blockEncoding.readBlock(this, inputStream);
    }
    return (Block) serializer.read(kryo, input, null);
}
Also used : Input(com.esotericsoftware.kryo.io.Input) Block(io.prestosql.spi.block.Block) PrestoException(io.prestosql.spi.PrestoException) AbstractBlockEncoding(io.prestosql.spi.block.AbstractBlockEncoding) BlockEncoding(io.prestosql.spi.block.BlockEncoding)

Aggregations

BlockEncoding (io.prestosql.spi.block.BlockEncoding)9 ArrayBlockEncoding (io.prestosql.spi.block.ArrayBlockEncoding)4 Block (io.prestosql.spi.block.Block)4 ByteArrayBlockEncoding (io.prestosql.spi.block.ByteArrayBlockEncoding)4 DictionaryBlockEncoding (io.prestosql.spi.block.DictionaryBlockEncoding)4 Int128ArrayBlockEncoding (io.prestosql.spi.block.Int128ArrayBlockEncoding)4 IntArrayBlockEncoding (io.prestosql.spi.block.IntArrayBlockEncoding)4 LazyBlockEncoding (io.prestosql.spi.block.LazyBlockEncoding)4 LongArrayBlockEncoding (io.prestosql.spi.block.LongArrayBlockEncoding)4 MapBlockEncoding (io.prestosql.spi.block.MapBlockEncoding)4 RowBlockEncoding (io.prestosql.spi.block.RowBlockEncoding)4 RunLengthBlockEncoding (io.prestosql.spi.block.RunLengthBlockEncoding)4 ShortArrayBlockEncoding (io.prestosql.spi.block.ShortArrayBlockEncoding)4 SingleMapBlockEncoding (io.prestosql.spi.block.SingleMapBlockEncoding)4 SingleRowBlockEncoding (io.prestosql.spi.block.SingleRowBlockEncoding)4 VariableWidthBlockEncoding (io.prestosql.spi.block.VariableWidthBlockEncoding)4 PrestoException (io.prestosql.spi.PrestoException)2 AbstractBlockEncoding (io.prestosql.spi.block.AbstractBlockEncoding)2 Input (com.esotericsoftware.kryo.io.Input)1 Output (com.esotericsoftware.kryo.io.Output)1