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 97AA618920 for ; Wed, 11 Nov 2015 00:51:30 +0000 (UTC) Received: (qmail 58488 invoked by uid 500); 11 Nov 2015 00:51:25 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 58429 invoked by uid 500); 11 Nov 2015 00:51:25 -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 58420 invoked by uid 99); 11 Nov 2015 00:51:25 -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 Nov 2015 00:51:25 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 33429E048E; Wed, 11 Nov 2015 00:51:25 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: xyao@apache.org To: common-commits@hadoop.apache.org Message-Id: <2ae361201ea344509b2a98eead0a7942@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: HDFS-9245. Fix findbugs warnings in hdfs-nfs/WriteCtx. Contributed by Mingliang Liu. Date: Wed, 11 Nov 2015 00:51:25 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/branch-2 48a494cdc -> f3a075e05 HDFS-9245. Fix findbugs warnings in hdfs-nfs/WriteCtx. Contributed by Mingliang Liu. (cherry picked from commit 6e4562b844dfbbbdc0074323900eb69ee2a3e9c2) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f3a075e0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f3a075e0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f3a075e0 Branch: refs/heads/branch-2 Commit: f3a075e053bdb8a183fd1cd888fd8ff9d6497ea9 Parents: 48a494c Author: Xiaoyu Yao Authored: Tue Nov 10 16:35:06 2015 -0800 Committer: Xiaoyu Yao Committed: Tue Nov 10 16:51:01 2015 -0800 ---------------------------------------------------------------------- .../apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java | 22 +++++++++++++------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ 2 files changed, 18 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/f3a075e0/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java index 8c2c7ee..f4c32f6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java +++ b/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/WriteCtx.java @@ -98,7 +98,7 @@ class WriteCtx { */ private int trimDelta; - public int getOriginalCount() { + public synchronized int getOriginalCount() { return originalCount; } @@ -158,7 +158,7 @@ class WriteCtx { } // Resized write should not allow dump - Preconditions.checkState(originalCount == INVALID_ORIGINAL_COUNT); + Preconditions.checkState(getOriginalCount() == INVALID_ORIGINAL_COUNT); this.raf = raf; dumpFileOffset = dumpOut.getChannel().position(); @@ -193,6 +193,13 @@ class WriteCtx { } } + /** + * @return the offset field + */ + private synchronized long getPlainOffset() { + return offset; + } + int getCount() { synchronized(this) { // See comment "Overlapping Write Request Handling" above @@ -253,8 +260,8 @@ class WriteCtx { try { dataBuffer = getData(); } catch (Exception e1) { - LOG.error("Failed to get request data offset:" + offset + " count:" - + count + " error:" + e1); + LOG.error("Failed to get request data offset:" + getPlainOffset() + " " + + "count:" + count + " error:" + e1); throw new IOException("Can't get WriteCtx.data"); } @@ -311,8 +318,9 @@ class WriteCtx { @Override public String toString() { - return "Id:" + handle.getFileId() + " offset:" + offset + " count:" + count - + " originalCount:" + originalCount + " stableHow:" + stableHow - + " replied:" + replied + " dataState:" + dataState + " xid:" + xid; + return "Id:" + handle.getFileId() + " offset:" + getPlainOffset() + " " + + "count:" + count + " originalCount:" + getOriginalCount() + + " stableHow:" + stableHow + " replied:" + replied + " dataState:" + + dataState + " xid:" + xid; } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/hadoop/blob/f3a075e0/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 613f03e..87585d8 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1441,6 +1441,9 @@ Release 2.8.0 - UNRELEASED HDFS-9234. WebHdfs: getContentSummary() should give quota for storage types. (Surendra Singh Lilhore via xyao) + HDFS-9245. Fix findbugs warnings in hdfs-nfs/WriteCtx. + (Mingliang Liu via xyao) + Release 2.7.3 - UNRELEASED INCOMPATIBLE CHANGES