public class Hadoop23Shims.HdfsEncryptionShim extends Object implements HadoopShims.HdfsEncryptionShim
Constructor and Description |
---|
HdfsEncryptionShim(URI uri,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
boolean |
arePathsOnSameEncryptionZone(org.apache.hadoop.fs.Path path1,
org.apache.hadoop.fs.Path path2)
Checks if two HDFS paths are on the same encrypted or unencrypted zone.
|
boolean |
arePathsOnSameEncryptionZone(org.apache.hadoop.fs.Path path1,
org.apache.hadoop.fs.Path path2,
HadoopShims.HdfsEncryptionShim encryptionShim2)
Checks if two HDFS paths are on the same encrypted or unencrypted zone.
|
int |
comparePathKeyStrength(org.apache.hadoop.fs.Path path1,
org.apache.hadoop.fs.Path path2)
Compares two encryption key strengths.
|
void |
createEncryptionZone(org.apache.hadoop.fs.Path path,
String keyName)
create encryption zone by path and keyname
|
void |
createKey(String keyName,
int bitLength)
Creates an encryption key.
|
void |
deleteKey(String keyName) |
List<String> |
getKeys() |
boolean |
isPathEncrypted(org.apache.hadoop.fs.Path path)
Checks if a given HDFS path is encrypted.
|
public HdfsEncryptionShim(URI uri, org.apache.hadoop.conf.Configuration conf) throws IOException
IOException
public boolean isPathEncrypted(org.apache.hadoop.fs.Path path) throws IOException
HadoopShims.HdfsEncryptionShim
isPathEncrypted
in interface HadoopShims.HdfsEncryptionShim
path
- Path to HDFS file systemIOException
- If an error occurred attempting to get encryption informationpublic boolean arePathsOnSameEncryptionZone(org.apache.hadoop.fs.Path path1, org.apache.hadoop.fs.Path path2) throws IOException
HadoopShims.HdfsEncryptionShim
arePathsOnSameEncryptionZone
in interface HadoopShims.HdfsEncryptionShim
path1
- Path to HDFS file systempath2
- Path to HDFS file systemIOException
- If an error occurred attempting to get encryption informationpublic boolean arePathsOnSameEncryptionZone(org.apache.hadoop.fs.Path path1, org.apache.hadoop.fs.Path path2, HadoopShims.HdfsEncryptionShim encryptionShim2) throws IOException
HadoopShims.HdfsEncryptionShim
arePathsOnSameEncryptionZone
in interface HadoopShims.HdfsEncryptionShim
path1
- Path to HDFS file systempath2
- Path to HDFS file systemencryptionShim2
- The encryption-shim corresponding to path2.IOException
- If an error occurred attempting to get encryption informationpublic int comparePathKeyStrength(org.apache.hadoop.fs.Path path1, org.apache.hadoop.fs.Path path2) throws IOException
comparePathKeyStrength
in interface HadoopShims.HdfsEncryptionShim
path1
- First path to comparepath2
- Second path to compareIOException
- If an error occurred attempting to get key metadatapublic void createEncryptionZone(org.apache.hadoop.fs.Path path, String keyName) throws IOException
HadoopShims.HdfsEncryptionShim
createEncryptionZone
in interface HadoopShims.HdfsEncryptionShim
path
- HDFS path to create encryption zonekeyName
- keynameIOException
public void createKey(String keyName, int bitLength) throws IOException, NoSuchAlgorithmException
HadoopShims.HdfsEncryptionShim
createKey
in interface HadoopShims.HdfsEncryptionShim
keyName
- Name of the keybitLength
- Key encryption length in bits (128 or 256).IOException
- If an error occurs while creating the encryption keyNoSuchAlgorithmException
- If cipher algorithm is invalid.public void deleteKey(String keyName) throws IOException
deleteKey
in interface HadoopShims.HdfsEncryptionShim
IOException
public List<String> getKeys() throws IOException
getKeys
in interface HadoopShims.HdfsEncryptionShim
IOException
Copyright © 2019 The Apache Software Foundation. All rights reserved.