public class Hadoop23Shims.HdfsEncryptionShim extends Object implements HadoopShims.HdfsEncryptionShim
Constructor and Description |
---|
Hadoop23Shims.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.
|
int |
comparePathKeyStrength(org.apache.hadoop.fs.Path path1,
org.apache.hadoop.fs.Path path2)
Compares two encrypted path 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 Hadoop23Shims.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 int comparePathKeyStrength(org.apache.hadoop.fs.Path path1, org.apache.hadoop.fs.Path path2) throws IOException
HadoopShims.HdfsEncryptionShim
comparePathKeyStrength
in interface HadoopShims.HdfsEncryptionShim
path1
- HDFS path to compare.path2
- HDFS path to compare.IOException
- If an error occurred attempting to get encryption/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 © 2017 The Apache Software Foundation. All rights reserved.