Search in sources :

Example 1 with InvalidArnException

use of com.amazonaws.services.kms.model.InvalidArnException in project ozone by apache.

the class DBDefinitionFactory method getDefinition.

public static DBDefinition getDefinition(Path dbPath) {
    Preconditions.checkNotNull(dbPath, "Path is required to identify the used db scheme");
    final Path fileName = dbPath.getFileName();
    if (fileName == null) {
        throw new InvalidArnException("Path is required to identify the used db scheme");
    }
    String dbName = fileName.toString();
    if (dbName.endsWith("-container.db")) {
        switch(dnDBSchemaVersion) {
            case "V1":
                return new DatanodeSchemaOneDBDefinition(dbPath.toAbsolutePath().toString());
            default:
                return new DatanodeSchemaTwoDBDefinition(dbPath.toAbsolutePath().toString());
        }
    }
    return getDefinition(dbName);
}
Also used : Path(java.nio.file.Path) DatanodeSchemaTwoDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition) DatanodeSchemaOneDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition) InvalidArnException(com.amazonaws.services.kms.model.InvalidArnException)

Example 2 with InvalidArnException

use of com.amazonaws.services.kms.model.InvalidArnException in project aws-sdk-android by aws-amplify.

the class InvalidArnExceptionUnmarshaller method unmarshall.

@Override
public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception {
    InvalidArnException e = (InvalidArnException) super.unmarshall(error);
    e.setErrorCode("InvalidArnException");
    return e;
}
Also used : InvalidArnException(com.amazonaws.services.kms.model.InvalidArnException)

Example 3 with InvalidArnException

use of com.amazonaws.services.kms.model.InvalidArnException in project ozone by apache.

the class DBDefinitionFactory method getDefinition.

public static DBDefinition getDefinition(Path dbPath, ConfigurationSource config) {
    Preconditions.checkNotNull(dbPath, "Path is required to identify the used db scheme");
    final Path fileName = dbPath.getFileName();
    if (fileName == null) {
        throw new InvalidArnException("Path is required to identify the used db scheme");
    }
    String dbName = fileName.toString();
    if (dbName.endsWith("container.db")) {
        switch(dnDBSchemaVersion) {
            case "V1":
                return new DatanodeSchemaOneDBDefinition(dbPath.toAbsolutePath().toString(), config);
            case "V3":
                return new DatanodeSchemaThreeDBDefinition(dbPath.toAbsolutePath().toString(), config);
            default:
                return new DatanodeSchemaTwoDBDefinition(dbPath.toAbsolutePath().toString(), config);
        }
    }
    return getDefinition(dbName);
}
Also used : Path(java.nio.file.Path) DatanodeSchemaTwoDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition) DatanodeSchemaOneDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition) InvalidArnException(com.amazonaws.services.kms.model.InvalidArnException) DatanodeSchemaThreeDBDefinition(org.apache.hadoop.ozone.container.metadata.DatanodeSchemaThreeDBDefinition)

Aggregations

InvalidArnException (com.amazonaws.services.kms.model.InvalidArnException)3 Path (java.nio.file.Path)2 DatanodeSchemaOneDBDefinition (org.apache.hadoop.ozone.container.metadata.DatanodeSchemaOneDBDefinition)2 DatanodeSchemaTwoDBDefinition (org.apache.hadoop.ozone.container.metadata.DatanodeSchemaTwoDBDefinition)2 DatanodeSchemaThreeDBDefinition (org.apache.hadoop.ozone.container.metadata.DatanodeSchemaThreeDBDefinition)1