hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [15/50] [abbrv] hadoop git commit: HDFS-10242. Cannot create space quota of zero. Contributed by Takashi Ohnishi.
Date Thu, 19 May 2016 19:47:04 GMT
HDFS-10242. Cannot create space quota of zero. Contributed by Takashi Ohnishi.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/9fe5828f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/9fe5828f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/9fe5828f

Branch: refs/heads/HDFS-7240
Commit: 9fe5828f05accc6746cb08a43916f7557dac533a
Parents: ccc93e7
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue May 17 15:53:09 2016 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue May 17 15:53:09 2016 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/fs/QuotaUsage.java           | 4 ++--
 .../src/main/java/org/apache/hadoop/hdfs/DFSClient.java          | 2 +-
 .../src/test/java/org/apache/hadoop/hdfs/TestQuota.java          | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe5828f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java
index 9ffab2f..9ad6a28 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/QuotaUsage.java
@@ -296,7 +296,7 @@ public class QuotaUsage {
       quotaStr = formatSize(quota, hOption);
       quotaRem = formatSize(quota-fileAndDirectoryCount, hOption);
     }
-    if (spaceQuota > 0) {
+    if (spaceQuota >= 0) {
       spaceQuotaStr = formatSize(spaceQuota, hOption);
       spaceQuotaRem = formatSize(spaceQuota - spaceConsumed, hOption);
     }
@@ -314,7 +314,7 @@ public class QuotaUsage {
       String quotaStr = QUOTA_NONE;
       String quotaRem = QUOTA_INF;
 
-      if (typeQuota > 0) {
+      if (typeQuota >= 0) {
         quotaStr = formatSize(typeQuota, hOption);
         quotaRem = formatSize(typeQuota - typeConsumed, hOption);
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe5828f/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
index d4e3187..aa48f7e 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DFSClient.java
@@ -2368,7 +2368,7 @@ public class DFSClient implements java.io.Closeable, RemotePeerFactory,
     if ((namespaceQuota <= 0 &&
           namespaceQuota != HdfsConstants.QUOTA_DONT_SET &&
           namespaceQuota != HdfsConstants.QUOTA_RESET) ||
-        (storagespaceQuota <= 0 &&
+        (storagespaceQuota < 0 &&
             storagespaceQuota != HdfsConstants.QUOTA_DONT_SET &&
             storagespaceQuota != HdfsConstants.QUOTA_RESET)) {
       throw new IllegalArgumentException("Invalid values for quota : " +

http://git-wip-us.apache.org/repos/asf/hadoop/blob/9fe5828f/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
index 2c55156..c3bed00 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestQuota.java
@@ -63,7 +63,7 @@ public class TestQuota {
   throws Exception {
     int val = admin.run(args);
     if (expectEror) {
-      assertEquals(val, -1);
+      assertEquals(-1, val);
     } else {
       assertTrue(val>=0);
     }
@@ -263,7 +263,7 @@ public class TestQuota {
       // 16a: set the quota of /test to be 0
       args = new String[]{"-setQuota", "0", parent.toString()};
       runCommand(admin, args, true);
-      runCommand(admin, true, "-setSpaceQuota", "0", args[2]);
+      runCommand(admin, false, "-setSpaceQuota", "0", args[2]);
       
       // 16b: set the quota of /test to be -1
       args[1] = "-1";


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message