Interface DecryptionPropertiesFactory

All Known Implementing Classes:
PropertiesDrivenCryptoFactory

public interface DecryptionPropertiesFactory
DecryptionPropertiesFactory interface enables transparent activation of Parquet decryption.

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).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final org.slf4j.Logger
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    loadFactory(org.apache.hadoop.conf.Configuration conf)
    Load DecryptionPropertiesFactory class specified by CRYPTO_FACTORY_CLASS_PROPERTY_NAME as the path in the configuration
  • Field Details

    • LOG

      static final org.slf4j.Logger LOG
    • CRYPTO_FACTORY_CLASS_PROPERTY_NAME

      static final String CRYPTO_FACTORY_CLASS_PROPERTY_NAME
      See Also:
  • Method Details

    • loadFactory

      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
      Parameters:
      conf - Configuration where user specifies the class path
      Returns:
      object with class DecryptionPropertiesFactory if user specified the class path and invoking of the class succeeds. Null if user doesn't specify the class path (no decryption factory then - not required for plaintext files. Or for plaintext columns in encrypted files with plaintext footer).
      Throws:
      BadConfigurationException - if the instantiation of the configured class fails
    • getFileDecryptionProperties

      FileDecryptionProperties getFileDecryptionProperties(org.apache.hadoop.conf.Configuration hadoopConfig, org.apache.hadoop.fs.Path filePath) throws ParquetCryptoRuntimeException
      Get FileDecryptionProperties object which is created by the implementation of this interface. Please see the unit test SampleDecryptionPropertiesFactory for example
      Parameters:
      hadoopConfig - Configuration that is used to pass the needed information, e.g. KMS uri
      filePath - File path of the parquet file Can be used for AAD prefix verification, part of key metadata etc
      Returns:
      object with class of FileDecryptionProperties. Null return value means no decryption properties are available for the file (not required for plaintext files. Or for plaintext columns in encrypted files with plaintext footer).
      Throws:
      ParquetCryptoRuntimeException - if there is an exception while creating the object