public interface DecryptionPropertiesFactory
Its customized implementations produce decryption properties for each Parquet file, using the input information available in Parquet file readers: file path and Hadoop configuration properties that can pass custom parameters required by a crypto factory. A factory implementation can use or ignore any of these inputs.
The example usage could be as below. 1. Write a class to implement DecryptionPropertiesFactory. 2. Set configuration of "parquet.crypto.factory.class" with the fully qualified name of this class. For example, we can set the configuration in SparkSession as below. SparkSession spark = SparkSession .config("parquet.crypto.factory.class", "xxx.xxx.DecryptionPropertiesClassLoaderImpl")
The implementation of this interface will be instantiated by loadFactory(Configuration).
| Modifier and Type | Field and Description |
|---|---|
static String |
CRYPTO_FACTORY_CLASS_PROPERTY_NAME |
static org.slf4j.Logger |
LOG |
| Modifier and Type | Method and Description |
|---|---|
FileDecryptionProperties |
getFileDecryptionProperties(org.apache.hadoop.conf.Configuration hadoopConfig,
org.apache.hadoop.fs.Path filePath)
Get FileDecryptionProperties object which is created by the implementation of this interface.
|
static DecryptionPropertiesFactory |
loadFactory(org.apache.hadoop.conf.Configuration conf)
Load DecryptionPropertiesFactory class specified by CRYPTO_FACTORY_CLASS_PROPERTY_NAME as the path in the configuration
|
static final org.slf4j.Logger LOG
static final String CRYPTO_FACTORY_CLASS_PROPERTY_NAME
static DecryptionPropertiesFactory loadFactory(org.apache.hadoop.conf.Configuration conf)
conf - Configuration where user specifies the class pathBadConfigurationException - if the instantiation of the configured class failsFileDecryptionProperties getFileDecryptionProperties(org.apache.hadoop.conf.Configuration hadoopConfig, org.apache.hadoop.fs.Path filePath) throws ParquetCryptoRuntimeException
hadoopConfig - Configuration that is used to pass the needed information, e.g. KMS urifilePath - File path of the parquet file
Can be used for AAD prefix verification, part of key metadata etcParquetCryptoRuntimeException - if there is an exception while creating the objectCopyright © 2023 The Apache Software Foundation. All rights reserved.