Search in sources :

Example 46 with BasicAWSCredentials

use of com.amazonaws.auth.BasicAWSCredentials in project ignite by apache.

the class S3SessionCheckpointSelfTest method testS3Checkpoint.

/**
 * @throws Exception If failed.
 */
@IgniteIgnore("https://issues.apache.org/jira/browse/IGNITE-2420")
public void testS3Checkpoint() throws Exception {
    IgniteConfiguration cfg = getConfiguration();
    S3CheckpointSpi spi = new S3CheckpointSpi();
    AWSCredentials cred = new BasicAWSCredentials(IgniteS3TestSuite.getAccessKey(), IgniteS3TestSuite.getSecretKey());
    spi.setAwsCredentials(cred);
    spi.setBucketNameSuffix(S3CheckpointSpiSelfTest.getBucketNameSuffix());
    cfg.setCheckpointSpi(spi);
    GridSessionCheckpointSelfTest.spi = spi;
    checkCheckpoints(cfg);
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) IgniteIgnore(org.apache.ignite.testsuites.IgniteIgnore)

Example 47 with BasicAWSCredentials

use of com.amazonaws.auth.BasicAWSCredentials in project ignite by apache.

the class S3CheckpointManagerSelfTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    assertTrue("Unexpected Ignite instance name: " + igniteInstanceName, igniteInstanceName.contains("s3"));
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    S3CheckpointSpi spi = new S3CheckpointSpi();
    AWSCredentials cred = new BasicAWSCredentials(IgniteS3TestSuite.getAccessKey(), IgniteS3TestSuite.getSecretKey());
    spi.setAwsCredentials(cred);
    spi.setBucketNameSuffix(S3CheckpointSpiSelfTest.getBucketNameSuffix());
    cfg.setCheckpointSpi(spi);
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) AWSCredentials(com.amazonaws.auth.AWSCredentials) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Example 48 with BasicAWSCredentials

use of com.amazonaws.auth.BasicAWSCredentials in project apex-malhar by apache.

the class S3RecordReaderModuleAppTest method setup.

@Before
public void setup() throws Exception {
    client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));
    client.createBucket(testMeta.bucketKey);
    inputDir = testMeta.baseDirectory + File.separator + "input";
    File file1 = new File(inputDir + File.separator + FILE_1);
    File file2 = new File(inputDir + File.separator + FILE_2);
    FileUtils.writeStringToFile(file1, FILE_1_DATA);
    FileUtils.writeStringToFile(file2, FILE_2_DATA);
    client.putObject(new PutObjectRequest(testMeta.bucketKey, "input/" + FILE_1, file1));
    client.putObject(new PutObjectRequest(testMeta.bucketKey, "input/" + FILE_2, file2));
    files = SCHEME + "://" + accessKey + ":" + secretKey + "@" + testMeta.bucketKey + "/input";
}
Also used : AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) File(java.io.File) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials) PutObjectRequest(com.amazonaws.services.s3.model.PutObjectRequest) Before(org.junit.Before)

Example 49 with BasicAWSCredentials

use of com.amazonaws.auth.BasicAWSCredentials in project apex-malhar by apache.

the class S3BlockReader method setup.

@Override
public void setup(Context.OperatorContext context) {
    super.setup(context);
    s3Client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretAccessKey));
    ((S3BlockReaderContext) readerContext).setBucketName(bucketName);
    ((S3BlockReaderContext) readerContext).setS3Client(s3Client);
}
Also used : AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Example 50 with BasicAWSCredentials

use of com.amazonaws.auth.BasicAWSCredentials in project apex-malhar by apache.

the class S3Reconciler method setup.

@Override
public void setup(Context.OperatorContext context) {
    s3client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey));
    if (region != null) {
        s3client.setRegion(Region.getRegion(Regions.fromName(region)));
    }
    filePath = context.getValue(DAG.APPLICATION_PATH);
    try {
        fs = FileSystem.newInstance(new Path(filePath).toUri(), new Configuration());
    } catch (IOException e) {
        logger.error("Unable to create FileSystem: {}", e.getMessage());
    }
    super.setup(context);
}
Also used : Path(org.apache.hadoop.fs.Path) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) Configuration(org.apache.hadoop.conf.Configuration) IOException(java.io.IOException) BasicAWSCredentials(com.amazonaws.auth.BasicAWSCredentials)

Aggregations

BasicAWSCredentials (com.amazonaws.auth.BasicAWSCredentials)51 AWSCredentials (com.amazonaws.auth.AWSCredentials)26 ClientConfiguration (com.amazonaws.ClientConfiguration)17 AmazonS3Client (com.amazonaws.services.s3.AmazonS3Client)15 AmazonClientException (com.amazonaws.AmazonClientException)6 InstanceProfileCredentialsProvider (com.amazonaws.auth.InstanceProfileCredentialsProvider)5 AWSStaticCredentialsProvider (com.amazonaws.auth.AWSStaticCredentialsProvider)4 AWSCredentialsProvider (com.amazonaws.auth.AWSCredentialsProvider)3 DefaultAWSCredentialsProviderChain (com.amazonaws.auth.DefaultAWSCredentialsProviderChain)3 ProfileCredentialsProvider (com.amazonaws.auth.profile.ProfileCredentialsProvider)3 AmazonEC2Client (com.amazonaws.services.ec2.AmazonEC2Client)3 File (java.io.File)3 IOException (java.io.IOException)3 AmazonServiceException (com.amazonaws.AmazonServiceException)2 EnvironmentVariableCredentialsProvider (com.amazonaws.auth.EnvironmentVariableCredentialsProvider)2 SystemPropertiesCredentialsProvider (com.amazonaws.auth.SystemPropertiesCredentialsProvider)2 StaticCredentialsProvider (com.amazonaws.internal.StaticCredentialsProvider)2 Region (com.amazonaws.regions.Region)2 AmazonCloudWatchClient (com.amazonaws.services.cloudwatch.AmazonCloudWatchClient)2 AmazonDynamoDB (com.amazonaws.services.dynamodbv2.AmazonDynamoDB)2