public interface EncryptionPropertiesFactory
Its customized implementations produce encryption properties for each Parquet file, using the input information available in Parquet file writers: file path, file extended schema - and also 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 EncryptionPropertiesFactory. 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.EncryptionPropertiesClassLoaderImpl")
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 |
|---|---|
FileEncryptionProperties |
getFileEncryptionProperties(org.apache.hadoop.conf.Configuration fileHadoopConfig,
org.apache.hadoop.fs.Path tempFilePath,
WriteSupport.WriteContext fileWriteContext)
Get FileEncryptionProperties object which is created by the implementation of this interface.
|
static EncryptionPropertiesFactory |
loadFactory(org.apache.hadoop.conf.Configuration conf)
Load EncryptionPropertiesFactory 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 EncryptionPropertiesFactory loadFactory(org.apache.hadoop.conf.Configuration conf)
conf - Configuration where user specifies the class pathBadConfigurationException - if the instantiation of the configured class failsFileEncryptionProperties getFileEncryptionProperties(org.apache.hadoop.conf.Configuration fileHadoopConfig, org.apache.hadoop.fs.Path tempFilePath, WriteSupport.WriteContext fileWriteContext) throws ParquetCryptoRuntimeException
fileHadoopConfig - Configuration that is used to pass the needed information, e.g. KMS uritempFilePath - File path of the parquet file being written.
Can be used for AAD prefix creation, key material management, etc.
Implementations must not presume the path is permanent,
as the file can be moved or renamed laterfileWriteContext - WriteContext to provide information like schema to build the FileEncryptionPropertiesParquetCryptoRuntimeException - if there is an exception while creating the objectCopyright © 2023 The Apache Software Foundation. All rights reserved.