From 208da340c34f3b50d2d70b9ed4ea12ff1ea942f6 Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Wed, 8 Aug 2012 02:54:59 +0000 Subject: [PATCH] HDFS-3760. primitiveCreate is a write, not a read. Contributed by Andy Isaacson. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1370650 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 6ab29d18a76..37d0b735bef 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -412,6 +412,8 @@ Release 2.0.1-alpha - UNRELEASED HDFS-3754. BlockSender doesn't shutdown ReadaheadPool threads. (eli) + HDFS-3760. primitiveCreate is a write, not a read. (Andy Isaacson via atm) + BREAKDOWN OF HDFS-3042 SUBTASKS HDFS-2185. HDFS portion of ZK-based FailoverController (todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java index d3fbf741b4f..2814fdb01a2 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java @@ -247,7 +247,7 @@ public class DistributedFileSystem extends FileSystem { FsPermission absolutePermission, EnumSet flag, int bufferSize, short replication, long blockSize, Progressable progress, int bytesPerChecksum) throws IOException { - statistics.incrementReadOps(1); + statistics.incrementWriteOps(1); return new HdfsDataOutputStream(dfs.primitiveCreate(getPathName(f), absolutePermission, flag, true, replication, blockSize, progress, bufferSize, bytesPerChecksum),statistics);