Package org.apache.hadoop.fs.s3

Examples of org.apache.hadoop.fs.s3.S3Credentials


        return key;
    }

    private static AWSCredentials getAwsCredentials(URI uri, Configuration conf)
    {
        S3Credentials credentials = new S3Credentials();
        credentials.initialize(uri, conf);
        return new BasicAWSCredentials(credentials.getAccessKey(), credentials.getSecretAccessKey());
    }
View Full Code Here


 
  private S3Service s3Service;
  private S3Bucket bucket;
 
  public void initialize(URI uri, Configuration conf) throws IOException {
    S3Credentials s3Credentials = new S3Credentials();
    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      handleServiceException(e);
    }
    bucket = new S3Bucket(uri.getHost());
View Full Code Here

        return key;
    }

    private static AWSCredentials getAwsCredentials(URI uri, Configuration conf)
    {
        S3Credentials credentials = new S3Credentials();
        credentials.initialize(uri, conf);
        return new BasicAWSCredentials(credentials.getAccessKey(), credentials.getSecretAccessKey());
    }
View Full Code Here

        return key;
    }

    private static AWSCredentials getAwsCredentials(URI uri, Configuration conf)
    {
        S3Credentials credentials = new S3Credentials();
        credentials.initialize(uri, conf);
        return new BasicAWSCredentials(credentials.getAccessKey(), credentials.getSecretAccessKey());
    }
View Full Code Here

        return key;
    }

    private static AWSCredentials getAwsCredentials(URI uri, Configuration conf)
    {
        S3Credentials credentials = new S3Credentials();
        credentials.initialize(uri, conf);
        return new BasicAWSCredentials(credentials.getAccessKey(), credentials.getSecretAccessKey());
    }
View Full Code Here

  private S3Service s3Service;
  private S3Bucket bucket;
 
  @Override
  public void initialize(URI uri, Configuration conf) throws IOException {
    S3Credentials s3Credentials = new S3Credentials();
    s3Credentials.initialize(uri, conf);
    try {
      AWSCredentials awsCredentials =
        new AWSCredentials(s3Credentials.getAccessKey(),
            s3Credentials.getSecretAccessKey());
      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      handleServiceException(e);
    }
    bucket = new S3Bucket(uri.getHost());
View Full Code Here

          "S3ServiceException: {}: {} : {}",
          se.getS3ErrorCode(), se.getS3ErrorMessage(), se, se);
      if ("InvalidRange".equals(se.getS3ErrorCode())) {
        result = new EOFException(FSExceptionMessages.CANNOT_SEEK_PAST_EOF);
      } else {
        result = new S3Exception(se);
      }
    } else if (thrown instanceof ServiceException) {
      ServiceException se = (ServiceException) thrown;
      LOG.debug("S3ServiceException: {}: {} : {}",
          se.getErrorCode(), se.toString(), se, se);
      result = new S3Exception(se);
    } else if (thrown instanceof IOException) {
      result = (IOException) thrown;
    } else {
      // here there is no exception derived yet.
      // this means no inner cause, and no translation made yet.
      // convert the original to an IOException -rather than just the
      // exception at the base of the tree
      result = new S3Exception(original);
    }

    return result;
  }
View Full Code Here

      this.s3Service = new RestS3Service(awsCredentials);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
    bucket = new S3Bucket(uri.getHost());

    createBucket(bucket.getName());
View Full Code Here

      s3Service.createBucket(bucketName);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    }
  }
View Full Code Here

      s3Service.putObject(bucket, object);
    } catch (S3ServiceException e) {
      if (e.getCause() instanceof IOException) {
        throw (IOException) e.getCause();
      }
      throw new S3Exception(e);
    } finally {
      if (in != null) {
        try {
          in.close();
        } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.apache.hadoop.fs.s3.S3Credentials

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.