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 String
KEY_MATERIAL_FILE_PREFIX
static String
KEY_MATERIAL_FILE_SUFFFIX
static String
TEMP_FILE_PREFIX
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyMaterial(String keyIDInFile, String keyMaterial)
Add key material for one encryption key.Set<String>
getKeyIDSet()
String
getKeyMaterial(String keyIDInFile)
Get key materialvoid
initialize(org.apache.hadoop.fs.Path parquetFilePath, org.apache.hadoop.conf.Configuration hadoopConfig, boolean tempStore)
Initializes key material store for a parquet file.void
moveMaterialTo(FileKeyMaterialStore keyMaterialStore)
Move key material to another store.void
removeMaterial()
Remove key material from persistent store.void
saveMaterial()
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:FileKeyMaterialStore
Initializes key material store for a parquet file.- Specified by:
initialize
in 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:FileKeyMaterialStore
Add key material for one encryption key.- Specified by:
addKeyMaterial
in 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:FileKeyMaterialStore
Get key material- Specified by:
getKeyMaterial
in interfaceFileKeyMaterialStore
- Parameters:
keyIDInFile
- ID of a key in Parquet file- Returns:
- key material
- Throws:
ParquetCryptoRuntimeException
-
saveMaterial
public void saveMaterial() throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStore
After key material was added for all keys in the given Parquet file, save material in persistent store.- Specified by:
saveMaterial
in interfaceFileKeyMaterialStore
- Throws:
ParquetCryptoRuntimeException
-
getKeyIDSet
public Set<String> getKeyIDSet() throws ParquetCryptoRuntimeException
- Specified by:
getKeyIDSet
in interfaceFileKeyMaterialStore
- Returns:
- Set of all key IDs in this store (for the given Parquet file)
- Throws:
ParquetCryptoRuntimeException
-
removeMaterial
public void removeMaterial() throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStore
Remove key material from persistent store. Used in key rotation.- Specified by:
removeMaterial
in interfaceFileKeyMaterialStore
- Throws:
ParquetCryptoRuntimeException
-
moveMaterialTo
public void moveMaterialTo(FileKeyMaterialStore keyMaterialStore) throws ParquetCryptoRuntimeException
Description copied from interface:FileKeyMaterialStore
Move key material to another store. Used in key rotation.- Specified by:
moveMaterialTo
in interfaceFileKeyMaterialStore
- Parameters:
keyMaterialStore
- target store- Throws:
ParquetCryptoRuntimeException
-
-