Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F54117BBE for ; Wed, 11 Feb 2015 18:08:50 +0000 (UTC) Received: (qmail 75577 invoked by uid 500); 11 Feb 2015 18:08:50 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 75402 invoked by uid 500); 11 Feb 2015 18:08:50 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 75383 invoked by uid 99); 11 Feb 2015 18:08:50 -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, 11 Feb 2015 18:08:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D9891E05E3; Wed, 11 Feb 2015 18:08:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: shv@apache.org To: common-commits@hadoop.apache.org Date: Wed, 11 Feb 2015 18:08:50 -0000 Message-Id: <65a099283acd434c93dafe3d4644fdf6@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] hadoop git commit: HDFS-7760. Document truncate for WebHDFS. Contributed by Konstantin Shvachko. HDFS-7760. Document truncate for WebHDFS. Contributed by Konstantin Shvachko. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/04789db7 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/04789db7 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/04789db7 Branch: refs/heads/branch-2 Commit: 04789db74cb09c68e037f299dcfb8d2a2de9f72d Parents: ada7791 Author: Konstantin V Shvachko Authored: Wed Feb 11 10:05:53 2015 -0800 Committer: Konstantin V Shvachko Committed: Wed Feb 11 10:05:53 2015 -0800 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 + .../hadoop-hdfs/src/site/apt/WebHDFS.apt.vm | 46 ++++++++++++++++++++ 2 files changed, 48 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/04789db7/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index a7c178d..f31c63a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -312,6 +312,8 @@ Release 2.7.0 - UNRELEASED HDFS-7058. Tests for truncate CLI. (Dasha Boudnik via shv) + HDFS-7760. Document truncate for WebHDFS. (shv) + OPTIMIZATIONS HDFS-7454. Reduce memory footprint for AclEntries in NameNode. http://git-wip-us.apache.org/repos/asf/hadoop/blob/04789db7/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/WebHDFS.apt.vm ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/WebHDFS.apt.vm b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/WebHDFS.apt.vm index 662f8b8..3668286 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/WebHDFS.apt.vm +++ b/hadoop-hdfs-project/hadoop-hdfs/src/site/apt/WebHDFS.apt.vm @@ -137,6 +137,9 @@ WebHDFS REST API * {{{Concat File(s)}<<>>}} (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.concat) + * {{{Truncate a File}<<>>}} + (see {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.truncate) + * HTTP DELETE * {{{Delete a File/Directory}<<>>}} @@ -492,6 +495,31 @@ Transfer-Encoding: chunked {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.delete +** {Truncate a File} + + * Submit a HTTP POST request. + ++--------------------------------- +curl -i -X POST "http://:/webhdfs/v1/?op=TRUNCATE&newlength=" ++--------------------------------- + + The client receives a response with a {{{Boolean JSON Schema}<<>> JSON object}}: + ++--------------------------------- +HTTP/1.1 200 OK +Content-Type: application/json +Transfer-Encoding: chunked + +{"boolean": true} ++--------------------------------- + + [] + + See also: + {{{New Length}<<>>}}, + {{{../../api/org/apache/hadoop/fs/FileSystem.html}FileSystem}}.truncate + + ** {Status of a File/Directory} * Submit a HTTP GET request. @@ -2274,6 +2302,24 @@ var tokenProperties = {{{Set Access or Modification Time}<<>>}} +** {New Length} + +*----------------+-------------------------------------------------------------------+ +|| Name | <<>> | +*----------------+-------------------------------------------------------------------+ +|| Description | The size the file is to be truncated to. | +*----------------+-------------------------------------------------------------------+ +|| Type | long | +*----------------+-------------------------------------------------------------------+ +|| Valid Values | \>= 0 | +*----------------+-------------------------------------------------------------------+ +|| Syntax | Any long. | +*----------------+-------------------------------------------------------------------+ + + See also: + {{{Truncate a File}<<>>}} + + ** {Offset} *----------------+-------------------------------------------------------------------+