Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E8B8C20049D for ; Wed, 9 Aug 2017 19:36:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E737D169A9D; Wed, 9 Aug 2017 17:36:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 38D26169A95 for ; Wed, 9 Aug 2017 19:36:43 +0200 (CEST) Received: (qmail 26450 invoked by uid 500); 9 Aug 2017 17:36:25 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 24135 invoked by uid 99); 9 Aug 2017 17:36:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 17:36:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BBDA9F555D; Wed, 9 Aug 2017 17:36:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: stevel@apache.org To: common-commits@hadoop.apache.org Date: Wed, 09 Aug 2017 17:36:37 -0000 Message-Id: <62c77a12344647b9a245cc0fdfef3e6f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [17/51] [abbrv] hadoop git commit: HDFS-12251. Add document for StreamCapabilities. (Lei (Eddy) Xu) archived-at: Wed, 09 Aug 2017 17:36:44 -0000 HDFS-12251. Add document for StreamCapabilities. (Lei (Eddy) Xu) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/fe334178 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/fe334178 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/fe334178 Branch: refs/heads/HADOOP-13345 Commit: fe3341786a0d61f404127bf21d1afc85b2f21d38 Parents: a6fdeb8 Author: Lei Xu Authored: Fri Aug 4 11:21:58 2017 -0700 Committer: Lei Xu Committed: Fri Aug 4 11:21:58 2017 -0700 ---------------------------------------------------------------------- .../src/site/markdown/filesystem/filesystem.md | 24 ++++++++++++++++++++ .../src/site/markdown/HDFSErasureCoding.md | 19 ++++++++++++++++ 2 files changed, 43 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/fe334178/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md index b56666c..d7e57ce 100644 --- a/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md +++ b/hadoop-common-project/hadoop-common/src/site/markdown/filesystem/filesystem.md @@ -1210,3 +1210,27 @@ try { It is notable that this is *not* done in the Hadoop codebase. This does not imply that robust loops are not recommended —more that the concurrency problems were not considered during the implementation of these loops. + + +## interface `StreamCapabilities` + +The `StreamCapabilities` provides a way to programmatically query the +capabilities that an `OutputStream` supports. + +```java +public interface StreamCapabilities { + boolean hasCapability(String capability); +} +``` + +### `boolean hasCapability(capability)` + +Return true if the `OutputStream` has the desired capability. + +The caller can query the capabilities of a stream using a string value. +It currently supports to query: + + * `StreamCapabilties.HFLUSH` ("*hflush*"): the capability to flush out the data + in client's buffer. + * `StreamCapabilities.HSYNC` ("*hsync*"): capability to flush out the data in + client's buffer and the disk device. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/fe334178/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md index 1c0a2de..88293ba 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/markdown/HDFSErasureCoding.md @@ -199,3 +199,22 @@ Below are the details about each command. * `[-disablePolicy -policy ]` Disable an erasure coding policy. + +Limitations +----------- + +Certain HDFS file write operations, i.e., `hflush`, `hsync` and `append`, +are not supported on erasure coded files due to substantial technical +challenges. + +* `append()` on an erasure coded file will throw `IOException`. +* `hflush()` and `hsync()` on `DFSStripedOutputStream` are no-op. Thus calling +`hflush()` or `hsync()` on an erasure coded file can not guarantee data +being persistent. + +A client can use [`StreamCapabilities`](../hadoop-common/filesystem/filesystem.html#interface_StreamCapabilities) +API to query whether a `OutputStream` supports `hflush()` and `hsync()`. +If the client desires data persistence via `hflush()` and `hsync()`, the current +remedy is creating such files as regular 3x replication files in a +non-erasure-coded directory, or using `FSDataOutputStreamBuilder#replicate()` +API to create 3x replication files in an erasure-coded directory. --------------------------------------------------------------------- To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-commits-help@hadoop.apache.org