Search in sources :

Example 11 with S3Options

use of org.apache.beam.sdk.io.aws2.options.S3Options in project beam by apache.

the class S3TestUtils method s3OptionsWithMultipleSSEOptions.

static S3Options s3OptionsWithMultipleSSEOptions() {
    S3Options options = s3OptionsWithSSEKMSKeyId();
    options.setSSECustomerKey(SSECustomerKey.builder().key("86glyTlCNZgccSxW8JxMa6ZdjdK3N141glAysPUZ3AA=").algorithm("AES256").build());
    return options;
}
Also used : S3Options(org.apache.beam.sdk.io.aws2.options.S3Options)

Example 12 with S3Options

use of org.apache.beam.sdk.io.aws2.options.S3Options in project beam by apache.

the class S3TestUtils method s3OptionsWithSSEKMSKeyId.

static S3Options s3OptionsWithSSEKMSKeyId() {
    S3Options options = s3Options();
    String ssekmsKeyId = "arn:aws:kms:eu-west-1:123456789012:key/dc123456-7890-ABCD-EF01-234567890ABC";
    options.setSSEKMSKeyId(ssekmsKeyId);
    options.setSSEAlgorithm("aws:kms");
    options.setBucketKeyEnabled(true);
    return options;
}
Also used : S3Options(org.apache.beam.sdk.io.aws2.options.S3Options)

Example 13 with S3Options

use of org.apache.beam.sdk.io.aws2.options.S3Options in project beam by apache.

the class S3TestUtils method s3Options.

static S3Options s3Options() {
    S3Options options = PipelineOptionsFactory.as(S3Options.class);
    options.setAwsRegion(Region.US_WEST_1);
    options.setS3UploadBufferSizeBytes(MINIMUM_UPLOAD_BUFFER_SIZE_BYTES);
    return options;
}
Also used : S3Options(org.apache.beam.sdk.io.aws2.options.S3Options)

Example 14 with S3Options

use of org.apache.beam.sdk.io.aws2.options.S3Options in project beam by apache.

the class S3OptionsTest method testSetSSECustomerKey.

@Test
public void testSetSSECustomerKey() {
    S3Options options = create("--SSECustomerKey={\"key\": \"key\", \"algorithm\": \"algo\"}");
    SSECustomerKey expected = SSECustomerKey.builder().key("key").algorithm("algo").build();
    assertThat(options.getSSECustomerKey()).isEqualToComparingFieldByField(expected);
    assertThat(serializeDeserialize(options).getSSECustomerKey()).isEqualToComparingFieldByField(expected);
}
Also used : SSECustomerKey(org.apache.beam.sdk.io.aws2.s3.SSECustomerKey) Test(org.junit.Test)

Example 15 with S3Options

use of org.apache.beam.sdk.io.aws2.options.S3Options in project beam by apache.

the class S3FileSystemTest method testGetSchemeWithS3Options.

@Test
public void testGetSchemeWithS3Options() {
    S3FileSystem s3FileSystem = new S3FileSystem(s3Options());
    assertEquals("s3", s3FileSystem.getScheme());
}
Also used : S3TestUtils.buildMockedS3FileSystem(org.apache.beam.sdk.io.aws2.s3.S3TestUtils.buildMockedS3FileSystem) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)9 S3Options (org.apache.beam.sdk.io.aws2.options.S3Options)8 S3TestUtils.buildMockedS3FileSystem (org.apache.beam.sdk.io.aws2.s3.S3TestUtils.buildMockedS3FileSystem)7 MatchResult (org.apache.beam.sdk.io.fs.MatchResult)4 HeadObjectResponse (software.amazon.awssdk.services.s3.model.HeadObjectResponse)3 SdkServiceException (software.amazon.awssdk.core.exception.SdkServiceException)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 SSECustomerKey (org.apache.beam.sdk.io.aws2.s3.SSECustomerKey)1 DeleteObjectsRequest (software.amazon.awssdk.services.s3.model.DeleteObjectsRequest)1