Class HadoopFSKeyMaterialStore
- java.lang.Object
-
- org.apache.parquet.crypto.keytools.HadoopFSKeyMaterialStore
-
- All Implemented Interfaces:
FileKeyMaterialStore
public class HadoopFSKeyMaterialStore extends Object implements FileKeyMaterialStore
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_MATERIAL_FILE_PREFIXstatic StringKEY_MATERIAL_FILE_SUFFFIXstatic StringTEMP_FILE_PREFIX
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKeyMaterial(String keyIDInFile, String keyMaterial)Add key material for one encryption key.Set<String>getKeyIDSet()StringgetKeyMaterial(String keyIDInFile)Get key materialvoidinitialize(org.apache.hadoop.fs.Path parquetFilePath, org.apache.hadoop.conf.Configuration hadoopConfig, boolean tempStore)Initializes key material store for a parquet file.voidmoveMaterialTo(FileKeyMaterialStore keyMaterialStore)Move key material to another store.voidremoveMaterial()Remove key material from persistent store.voidsaveMaterial()After key material was added for all keys in the given Parquet file, save material in persistent store.
-
-
-
Field Detail
-
KEY_MATERIAL_FILE_PREFIX
public static final String KEY_MATERIAL_FILE_PREFIX
- See Also:
- Constant Field Values
-
TEMP_FILE_PREFIX
public static final String TEMP_FILE_PREFIX
- See Also:
- Constant Field Values
-
KEY_MATERIAL_FILE_SUFFFIX
public static final String KEY_MATERIAL_FILE_SUFFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(org.apache.hadoop.fs.Path parquetFilePath, org.apache.hadoop.conf.Configuration hadoopConfig, boolean tempStore)Description copied from interface:FileKeyMaterialStoreInitializes key material store for a parquet file.- Specified by:
initializein interfaceFileKeyMaterialStore- Parameters:
parquetFilePath- Parquet file pathhadoopConfig- Hadoop configurationtempStore- set true if this is a temporary store, used in key rotation
-
addKeyMaterial
public void addKeyMaterial(String keyIDInFile, String keyMaterial) throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStoreAdd key material for one encryption key.- Specified by:
addKeyMaterialin interfaceFileKeyMaterialStore- Parameters:
keyIDInFile- ID of the key in Parquet filekeyMaterial- key material- Throws:
ParquetCryptoRuntimeException
-
getKeyMaterial
public String getKeyMaterial(String keyIDInFile) throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStoreGet key material- Specified by:
getKeyMaterialin interfaceFileKeyMaterialStore- Parameters:
keyIDInFile- ID of a key in Parquet file- Returns:
- key material
- Throws:
ParquetCryptoRuntimeException
-
saveMaterial
public void saveMaterial() throws ParquetCryptoRuntimeExceptionDescription copied from interface:FileKeyMaterialStoreAfter key material was added for all keys in the given Parquet file, save material in persistent store.- Specified by:
saveMaterialin interfaceFileKeyMaterialStore- Throws:
ParquetCryptoRuntimeException
-
getKeyIDSet
public Set<String> getKeyIDSet() throws ParquetCryptoRuntimeException
- Specified by:
getKeyIDSetin interfaceFileKeyMaterialStore- Returns:
- Set of all key IDs in this store (for the given Parquet file)
- Throws:
ParquetCryptoRuntimeException
-
removeMaterial
public void removeMaterial() throws ParquetCryptoRuntimeExceptionDescription copied from interface:FileKeyMaterialStoreRemove key material from persistent store. Used in key rotation.- Specified by:
removeMaterialin interfaceFileKeyMaterialStore- Throws:
ParquetCryptoRuntimeException
-
moveMaterialTo
public void moveMaterialTo(FileKeyMaterialStore keyMaterialStore) throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStoreMove key material to another store. Used in key rotation.- Specified by:
moveMaterialToin interfaceFileKeyMaterialStore- Parameters:
keyMaterialStore- target store- Throws:
ParquetCryptoRuntimeException
-
-