private int compareKeyStrength(EncryptionZone zone1, EncryptionZone zone2) throws IOException {

      // zone1, zone2 should already have been checked for nulls.
      assert zone1 != null && zone2 != null : "Neither EncryptionZone under comparison can be null.";

      CipherSuite suite1 = zone1.getSuite();
      CipherSuite suite2 = zone2.getSuite();

      if (suite1 == null && suite2 == null) {
        return 0;
      } else if (suite1 == null) {
        return -1;
      } else if (suite2 == null) {
        return 1;
      }

      return Integer.compare(suite1.getAlgorithmBlockSize(), suite2.getAlgorithmBlockSize());
    }
Compares two encryption key strengths.

@param zone1 First  EncryptionZone to compare
@param zone2 Second EncryptionZone to compare
@return 1 if zone1 is stronger; 0 if zones are equal; -1 if zone1 is weaker.
@throws IOException If an error occurred attempting to get key metadata
shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java