Java 类org.apache.hadoop.hdfs.UnknownCryptoProtocolVersionException 实例源码

项目:hadoop    文件:FSNamesystem.java   
/**
 * If the file is within an encryption zone, select the appropriate 
 * CryptoProtocolVersion from the list provided by the client. Since the
 * client may be newer, we need to handle unknown versions.
 *
 * @param zone EncryptionZone of the file
 * @param supportedVersions List of supported protocol versions
 * @return chosen protocol version
 * @throws IOException
 */
private CryptoProtocolVersion chooseProtocolVersion(EncryptionZone zone,
    CryptoProtocolVersion[] supportedVersions)
    throws UnknownCryptoProtocolVersionException, UnresolvedLinkException,
      SnapshotAccessControlException {
  Preconditions.checkNotNull(zone);
  Preconditions.checkNotNull(supportedVersions);
  // Right now, we only support a single protocol version,
  // so simply look for it in the list of provided options
  final CryptoProtocolVersion required = zone.getVersion();

  for (CryptoProtocolVersion c : supportedVersions) {
    if (c.equals(CryptoProtocolVersion.UNKNOWN)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " +
            "client: " + c.getUnknownValue());
      }
      continue;
    }
    if (c.equals(required)) {
      return c;
    }
  }
  throw new UnknownCryptoProtocolVersionException(
      "No crypto protocol versions provided by the client are supported."
          + " Client provided: " + Arrays.toString(supportedVersions)
          + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion
          .values()));
}
项目:aliyun-oss-hadoop-fs    文件:FSNamesystem.java   
/**
 * If the file is within an encryption zone, select the appropriate 
 * CryptoProtocolVersion from the list provided by the client. Since the
 * client may be newer, we need to handle unknown versions.
 *
 * @param zone EncryptionZone of the file
 * @param supportedVersions List of supported protocol versions
 * @return chosen protocol version
 * @throws IOException
 */
CryptoProtocolVersion chooseProtocolVersion(
    EncryptionZone zone, CryptoProtocolVersion[] supportedVersions)
    throws UnknownCryptoProtocolVersionException, UnresolvedLinkException,
      SnapshotAccessControlException {
  Preconditions.checkNotNull(zone);
  Preconditions.checkNotNull(supportedVersions);
  // Right now, we only support a single protocol version,
  // so simply look for it in the list of provided options
  final CryptoProtocolVersion required = zone.getVersion();

  for (CryptoProtocolVersion c : supportedVersions) {
    if (c.equals(CryptoProtocolVersion.UNKNOWN)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " +
            "client: " + c.getUnknownValue());
      }
      continue;
    }
    if (c.equals(required)) {
      return c;
    }
  }
  throw new UnknownCryptoProtocolVersionException(
      "No crypto protocol versions provided by the client are supported."
          + " Client provided: " + Arrays.toString(supportedVersions)
          + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion
          .values()));
}
项目:big-c    文件:FSNamesystem.java   
/**
 * If the file is within an encryption zone, select the appropriate 
 * CryptoProtocolVersion from the list provided by the client. Since the
 * client may be newer, we need to handle unknown versions.
 *
 * @param zone EncryptionZone of the file
 * @param supportedVersions List of supported protocol versions
 * @return chosen protocol version
 * @throws IOException
 */
private CryptoProtocolVersion chooseProtocolVersion(EncryptionZone zone,
    CryptoProtocolVersion[] supportedVersions)
    throws UnknownCryptoProtocolVersionException, UnresolvedLinkException,
      SnapshotAccessControlException {
  Preconditions.checkNotNull(zone);
  Preconditions.checkNotNull(supportedVersions);
  // Right now, we only support a single protocol version,
  // so simply look for it in the list of provided options
  final CryptoProtocolVersion required = zone.getVersion();

  for (CryptoProtocolVersion c : supportedVersions) {
    if (c.equals(CryptoProtocolVersion.UNKNOWN)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " +
            "client: " + c.getUnknownValue());
      }
      continue;
    }
    if (c.equals(required)) {
      return c;
    }
  }
  throw new UnknownCryptoProtocolVersionException(
      "No crypto protocol versions provided by the client are supported."
          + " Client provided: " + Arrays.toString(supportedVersions)
          + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion
          .values()));
}
项目:hadoop-2.6.0-cdh5.4.3    文件:FSNamesystem.java   
/**
 * If the file is within an encryption zone, select the appropriate 
 * CryptoProtocolVersion from the list provided by the client. Since the
 * client may be newer, we need to handle unknown versions.
 *
 * @param zone EncryptionZone of the file
 * @param supportedVersions List of supported protocol versions
 * @return chosen protocol version
 * @throws IOException
 */
private CryptoProtocolVersion chooseProtocolVersion(EncryptionZone zone,
    CryptoProtocolVersion[] supportedVersions)
    throws UnknownCryptoProtocolVersionException, UnresolvedLinkException,
      SnapshotAccessControlException {
  Preconditions.checkNotNull(zone);
  Preconditions.checkNotNull(supportedVersions);
  // Right now, we only support a single protocol version,
  // so simply look for it in the list of provided options
  final CryptoProtocolVersion required = zone.getVersion();

  for (CryptoProtocolVersion c : supportedVersions) {
    if (c.equals(CryptoProtocolVersion.UNKNOWN)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " +
            "client: " + c.getUnknownValue());
      }
      continue;
    }
    if (c.equals(required)) {
      return c;
    }
  }
  throw new UnknownCryptoProtocolVersionException(
      "No crypto protocol versions provided by the client are supported."
          + " Client provided: " + Arrays.toString(supportedVersions)
          + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion
          .values()));
}
项目:FlexMap    文件:FSNamesystem.java   
/**
 * If the file is within an encryption zone, select the appropriate 
 * CryptoProtocolVersion from the list provided by the client. Since the
 * client may be newer, we need to handle unknown versions.
 *
 * @param zone EncryptionZone of the file
 * @param supportedVersions List of supported protocol versions
 * @return chosen protocol version
 * @throws IOException
 */
private CryptoProtocolVersion chooseProtocolVersion(EncryptionZone zone,
    CryptoProtocolVersion[] supportedVersions)
    throws UnknownCryptoProtocolVersionException, UnresolvedLinkException,
      SnapshotAccessControlException {
  Preconditions.checkNotNull(zone);
  Preconditions.checkNotNull(supportedVersions);
  // Right now, we only support a single protocol version,
  // so simply look for it in the list of provided options
  final CryptoProtocolVersion required = zone.getVersion();

  for (CryptoProtocolVersion c : supportedVersions) {
    if (c.equals(CryptoProtocolVersion.UNKNOWN)) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Ignoring unknown CryptoProtocolVersion provided by " +
            "client: " + c.getUnknownValue());
      }
      continue;
    }
    if (c.equals(required)) {
      return c;
    }
  }
  throw new UnknownCryptoProtocolVersionException(
      "No crypto protocol versions provided by the client are supported."
          + " Client provided: " + Arrays.toString(supportedVersions)
          + " NameNode supports: " + Arrays.toString(CryptoProtocolVersion
          .values()));
}