You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/11/12 22:23:08 UTC

[GitHub] [beam] hostirosti edited a comment on pull request #4080: [BEAM-2500] Add S3 FileSystem to Java SDK

hostirosti edited a comment on pull request #4080:
URL: https://github.com/apache/beam/pull/4080#issuecomment-726375395


   @jack749 Do you know how writing to multiple buckets in different regions can be configured? Details about the issue I'm running into: https://issues.apache.org/jira/browse/BEAM-11257#
   
   What I'd like to do is something like this:
   ```
   public void processElement(ProcessContext c) {
   
   AwsOptions options = c.getPipelineOptions().as(AwsOptions.class);
   
   ... 
   
   options.setAwsCredentialsProvider(<bucket01_auth>);
   
   options.setAwsRegion(<bucket01_region>);
   
   ...
   
   ResourceId resourceId = FileSystems.matchNewResource(<bucket01_filename>, false);
   try (WritableByteChannel out = FileSystems.create(resourceId, MimeTypes.TEXT))
   
   { out.write(contents); }
   ...
   
   options.setAwsCredentialsProvider(<bucket02_auth>);
   
   options.setAwsRegion(<bucket02_region>);
   resourceId = FileSystems.matchNewResource(<bucket02_filename>, false);
   try (WritableByteChannel out = FileSystems.create(resourceId, MimeTypes.TEXT)) { out.write(contents); }
   
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org