/** * Compares to path key encryption strenghts. * * @param p1 Path to an HDFS file system * @param p2 Path to an HDFS file system * @return -1 if strength is weak; 0 if is equals; 1 if it is stronger * @throws HiveException If an error occurs while comparing key strengths. */ private int comparePathKeyStrength(Path p1, Path p2) throws HiveException { HadoopShims.HdfsEncryptionShim hdfsEncryptionShim; hdfsEncryptionShim = SessionState.get().getHdfsEncryptionShim(); if (hdfsEncryptionShim != null) { try { return hdfsEncryptionShim.comparePathKeyStrength(p1, p2); } catch (Exception e) { throw new HiveException("Unable to compare key strength for " + p1 + " and " + p2 + " : " + e, e); } } return 0; // Non-encrypted path (or equals strength) }
/** * Compares to path key encryption strenghts. * * @param p1 Path to an HDFS file system * @param p2 Path to an HDFS file system * @return -1 if strength is weak; 0 if is equals; 1 if it is stronger * @throws HiveException If an error occurs while comparing key strengths. */ private int comparePathKeyStrength(Path p1, Path p2) throws HiveException { HadoopShims.HdfsEncryptionShim hdfsEncryptionShim; hdfsEncryptionShim = SessionState.get().getHdfsEncryptionShim(); if (hdfsEncryptionShim != null) { try { return hdfsEncryptionShim.comparePathKeyStrength(p1, p2); } catch (Exception e) { throw new HiveException("Unable to compare key strength for " + p1 + " and " + p2 + " : " + e, e); } } return 0; // Non-encrypted path (or equals strength) }
/** * Compares to path key encryption strenghts. * * @param p1 Path to an HDFS file system * @param p2 Path to an HDFS file system * @return -1 if strength is weak; 0 if is equals; 1 if it is stronger * @throws HiveException If an error occurs while comparing key strengths. */ private int comparePathKeyStrength(Path p1, Path p2) throws HiveException { HadoopShims.HdfsEncryptionShim hdfsEncryptionShim; hdfsEncryptionShim = SessionState.get().getHdfsEncryptionShim(); if (hdfsEncryptionShim != null) { try { return hdfsEncryptionShim.comparePathKeyStrength(p1, p2); } catch (Exception e) { throw new HiveException("Unable to compare key strength for " + p1 + " and " + p2 + " : " + e, e); } } return 0; // Non-encrypted path (or equals strength) }