StephanEwen commented on a change in pull request #8326: [FLINK-12378][docs] Consolidate FileSystem Documentation URL: https://github.com/apache/flink/pull/8326#discussion_r280686923
########## File path: docs/ops/filesystems/s3.md ########## @@ -0,0 +1,134 @@ +--- +title: "Amazon S3" +nav-title: Amazon S3 +nav-parent_id: filesystems +nav-pos: 1 +--- +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +[Amazon Simple Storage Service](http://aws.amazon.com/s3/) (Amazon S3) provides cloud object storage for a variety of use cases. You can use S3 with Flink for **reading** and **writing data** as well in conjunction with the [streaming **state backends**]({{ site.baseurl}}/ops/state/state_backends.html). + +* This will be replaced by the TOC +{:toc} + +You can use S3 objects like regular files by specifying paths in the following format: + +{% highlight plain %} +s3://<your-bucket>/<endpoint> +{% endhighlight %} + +The endpoint can either be a single file or a directory, for example: + +{% highlight java %} +// Read from S3 bucket +env.readTextFile("s3://<bucket>/<endpoint>"); + +// Write to S3 bucket +stream.writeAsText("s3://<bucket>/<endpoint>"); + +// Use S3 as FsStatebackend +env.setStateBackend(new FsStateBackend("s3://<your-bucket>/<endpoint>")); +{% endhighlight %} + +Note that these examples are *not* exhaustive and you can use S3 in other places as well, including your [high availability setup](../jobmanager_high_availability.html) or the [RocksDBStateBackend]({{ site.baseurl }}/ops/state/state_backends.html#the-rocksdbstatebackend); everywhere that Flink expects a FileSystem URI. + +For most use cases, you may use one of our shaded `flink-s3-fs-hadoop` and `flink-s3-fs-presto` S3filesystem wrappers which are self-contained and easy to set up. Review comment: S3 filesystem ---------------------------------------------------------------- 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: [email protected] With regards, Apache Git Services
