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);
}
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;
}
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";
}
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);
}
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);
}
Aggregations