hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rang...@apache.org
Subject svn commit: r787380 - in /hadoop/common/branches/branch-0.20: ./ src/docs/src/documentation/content/xdocs/ src/hdfs/org/apache/hadoop/hdfs/ src/hdfs/org/apache/hadoop/hdfs/protocol/ src/hdfs/org/apache/hadoop/hdfs/server/namenode/ src/hdfs/org/apache/h...
Date Mon, 22 Jun 2009 20:22:08 GMT
Author: rangadi
Date: Mon Jun 22 20:22:08 2009
New Revision: 787380

URL: http://svn.apache.org/viewvc?rev=787380&view=rev
Log:
HDFS-26. Better error message to users when commands fail because of
lack of quota. Allow quota to be set even if the limit is lower than
current consumption. (Boris Shkolnik via rangadi)

Added:
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java
Modified:
    hadoop/common/branches/branch-0.20/CHANGES.txt
    hadoop/common/branches/branch-0.20/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
    hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java
    hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/cli/testConf.xml
    hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/TestQuota.java

Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Mon Jun 22 20:22:08 2009
@@ -138,6 +138,10 @@
     HADOOP-5920. Fixes a testcase failure for TestJobHistory. 
     (Amar Kamat via ddas)
 
+    HDFS-26. Better error message to users when commands fail because of
+    lack of quota. Allow quota to be set even if the limit is lower than
+    current consumption. (Boris Shkolnik via rangadi)
+
 Release 0.20.0 - 2009-04-15
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.20/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
(original)
+++ hadoop/common/branches/branch-0.20/src/docs/src/documentation/content/xdocs/hdfs_quota_admin_guide.xml
Mon Jun 22 20:22:08 2009
@@ -27,7 +27,7 @@
 
  <p> The name quota is a hard limit on the number of file and directory names in the
tree rooted at that directory. File and
 directory creations fail if the quota would be exceeded. Quotas stick with renamed directories;
the rename operation fails if
-operation would result in a quota violation. The attempt to set a quota fails if the directory
would be in violation of the new
+operation would result in a quota violation. The attempt to set a quota will still succeed
even if the directory would be in violation of the new
 quota. A newly created directory has no associated quota. The largest quota is <code>Long.Max_Value</code>.
A quota of one
 forces a directory to remain empty. (Yes, a directory counts against its own quota!) </p>
 
@@ -39,8 +39,7 @@
 
  <p> The space quota is a hard limit on the number of bytes used by files in the tree
rooted at that directory. Block
 allocations fail if the quota would not allow a full block to be written. Each replica of
a block counts against the quota. Quotas
-stick with renamed directories; the rename operation fails if the operation would result
in a quota violation. The attempt to
-set a quota fails if the directory would be in violation of the new quota. A newly created
directory has no associated quota.
+stick with renamed directories; the rename operation fails if the operation would result
in a quota violation. A newly created directory has no associated quota.
 The largest quota is <code>Long.Max_Value</code>. A quota of zero still permits
files to be created, but no blocks can be added to the files.
 Directories don't use host file system space and don't count against the space quota. The
host file system space used to save
 the file meta data is not counted against the quota. Quotas are charged at the intended replication
factor for the file;

Modified: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java (original)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/DFSClient.java Mon
Jun 22 20:22:08 2009
@@ -488,7 +488,8 @@
     } catch(RemoteException re) {
       throw re.unwrapRemoteException(FileNotFoundException.class,
                                      AccessControlException.class,
-                                     QuotaExceededException.class);
+                                     NSQuotaExceededException.class,
+                                     DSQuotaExceededException.class);
     }
     OutputStream result = new DFSOutputStream(src, buffersize, progress,
         lastBlock, stat, conf.getInt("io.bytes.per.checksum", 512));
@@ -511,7 +512,8 @@
       return namenode.setReplication(src, replication);
     } catch(RemoteException re) {
       throw re.unwrapRemoteException(AccessControlException.class,
-                                     QuotaExceededException.class);
+                                     NSQuotaExceededException.class,
+                                     DSQuotaExceededException.class);
     }
   }
 
@@ -525,7 +527,8 @@
       return namenode.rename(src, dst);
     } catch(RemoteException re) {
       throw re.unwrapRemoteException(AccessControlException.class,
-                                     QuotaExceededException.class);
+                                     NSQuotaExceededException.class,
+                                     DSQuotaExceededException.class);
     }
   }
 
@@ -880,7 +883,8 @@
       return namenode.mkdirs(src, masked);
     } catch(RemoteException re) {
       throw re.unwrapRemoteException(AccessControlException.class,
-                                     QuotaExceededException.class);
+                                     NSQuotaExceededException.class,
+                                     DSQuotaExceededException.class);
     }
   }
 
@@ -915,7 +919,8 @@
     } catch(RemoteException re) {
       throw re.unwrapRemoteException(AccessControlException.class,
                                      FileNotFoundException.class,
-                                     QuotaExceededException.class);
+                                     NSQuotaExceededException.class,
+                                     DSQuotaExceededException.class);
     }
   }
 
@@ -2645,7 +2650,8 @@
             src, masked, clientName, overwrite, replication, blockSize);
       } catch(RemoteException re) {
         throw re.unwrapRemoteException(AccessControlException.class,
-                                       QuotaExceededException.class);
+                                       NSQuotaExceededException.class,
+                                       DSQuotaExceededException.class);
       }
       streamer.start();
     }
@@ -2875,7 +2881,8 @@
             IOException ue = 
               e.unwrapRemoteException(FileNotFoundException.class,
                                       AccessControlException.class,
-                                      QuotaExceededException.class);
+                                      NSQuotaExceededException.class,
+                                      DSQuotaExceededException.class);
             if (ue != e) { 
               throw ue; // no need to retry these exceptions
             }

Added: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java?rev=787380&view=auto
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java
(added)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/DSQuotaExceededException.java
Mon Jun 22 20:22:08 2009
@@ -0,0 +1,43 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdfs.protocol;
+
+import org.apache.hadoop.util.StringUtils;
+
+public class DSQuotaExceededException extends QuotaExceededException {
+  protected static final long serialVersionUID = 1L;
+
+  public DSQuotaExceededException(String msg) {
+    super(msg);
+  }
+
+  public DSQuotaExceededException(long quota, long count) {
+    super(quota, count);
+  }
+
+  public String getMessage() {
+    String msg = super.getMessage();
+    if (msg == null) {
+      return "The DiskSpace quota" + (pathName==null?"":(" of " + pathName)) + 
+          " is exceeded: quota=" + quota + " diskspace consumed=" + StringUtils.humanReadableInt(count);
+    } else {
+      return msg;
+    }
+  }
+}

Added: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java?rev=787380&view=auto
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java
(added)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/NSQuotaExceededException.java
Mon Jun 22 20:22:08 2009
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.hdfs.protocol;
+
+public final class NSQuotaExceededException extends QuotaExceededException {
+  protected static final long serialVersionUID = 1L;
+  
+  public NSQuotaExceededException(String msg) {
+    super(msg);
+  }
+  
+  public NSQuotaExceededException(long quota, long count) {
+    super(quota, count);
+  }
+
+  public String getMessage() {
+    String msg = super.getMessage();
+    if (msg == null) {
+      return "The NameSpace quota (directories and files)" + 
+      (pathName==null?"":(" of directory " + pathName)) + 
+          " is exceeded: quota=" + quota + " file count=" + count; 
+    } else {
+      return msg;
+    }
+  }
+}

Modified: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java
(original)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/protocol/QuotaExceededException.java
Mon Jun 22 20:22:08 2009
@@ -27,26 +27,24 @@
  * taken by all the file under the directory tree). <br> <br>
  * 
  * The message for the exception specifies the directory where the quota
- * was violated and actual quotas.
+ * was violated and actual quotas. Specific message is generated in the 
+ * corresponding Exception class: 
+ *  DSQuotaExceededException or
+ *  NSQuotaExceededException
  */
-public final class QuotaExceededException extends IOException {
-  private static final long serialVersionUID = 1L;
-  private String pathName;
-  private long nsQuota;
-  private long nsCount;
-  private long dsQuota;
-  private long diskspace;
+public class QuotaExceededException extends IOException {
+  protected static final long serialVersionUID = 1L;
+  protected String pathName=null;
+  protected long quota; // quota
+  protected long count; // actual value
   
-  public QuotaExceededException(String msg) {
+  protected QuotaExceededException(String msg) {
     super(msg);
   }
   
-  public QuotaExceededException(long nsQuota, long nsCount,
-                                long dsQuota, long diskspace) {
-    this.nsQuota = nsQuota;
-    this.nsCount = nsCount;
-    this.dsQuota = dsQuota;
-    this.diskspace = diskspace;
+  protected QuotaExceededException(long quota, long count) {
+    this.quota = quota;
+    this.count = count;
   }
   
   public void setPathName(String path) {
@@ -54,14 +52,6 @@
   }
   
   public String getMessage() {
-    String msg = super.getMessage();
-    if (msg == null) {
-      return "The quota" + (pathName==null?"":(" of " + pathName)) + 
-          " is exceeded: namespace quota=" + nsQuota + " file count=" + 
-          nsCount + ", diskspace quota=" + dsQuota + 
-          " diskspace=" + diskspace; 
-    } else {
-      return msg;
-    }
+    return super.getMessage();
   }
 }

Modified: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
(original)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java
Mon Jun 22 20:22:08 2009
@@ -1114,7 +1114,7 @@
           path.append(n.getLocalName());
         }
         
-        NameNode.LOG.warn("Unexpected quota violation in image for " + path + 
+        NameNode.LOG.warn("Quota violation in image for " + path + 
                           " (Namespace quota : " + dir.getNsQuota() +
                           " consumed : " + counts.nsCount + ")" +
                           " (Diskspace quota : " + dir.getDsQuota() +

Modified: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
(original)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/server/namenode/INodeDirectoryWithQuota.java
Mon Jun 22 20:22:08 2009
@@ -18,6 +18,8 @@
 package org.apache.hadoop.hdfs.server.namenode;
 
 import org.apache.hadoop.fs.permission.PermissionStatus;
+import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException;
+import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
 import org.apache.hadoop.hdfs.protocol.QuotaExceededException;
 
 /**
@@ -84,18 +86,9 @@
    * 
    * @param nsQuota Namespace quota to be set
    * @param dsQuota diskspace quota to be set
-   * @throws QuotaExceededException if quota is modified and the modified quota
-   *         is too low.
    *                                
    */
   void setQuota(long newNsQuota, long newDsQuota) throws QuotaExceededException {
-    // if a quota is not chaged, ignore that in verification.
-    if ((newNsQuota >=0 && newNsQuota != nsQuota && newNsQuota < nsCount)
 ||
-        (newDsQuota >=0 && newDsQuota != dsQuota && newDsQuota < diskspace))
{
-      throw new QuotaExceededException(newNsQuota, nsCount, 
-                                       newDsQuota, diskspace);
-    }
-
     nsQuota = newNsQuota;
     dsQuota = newDsQuota;
   }
@@ -156,9 +149,11 @@
   private static void verifyQuota(long nsQuota, long nsCount, 
                                   long dsQuota, long diskspace)
                                   throws QuotaExceededException {
-    if ((nsQuota >= 0 && nsQuota < nsCount) || 
-        (dsQuota >= 0 && dsQuota < diskspace)) {
-      throw new QuotaExceededException(nsQuota, nsCount, dsQuota, diskspace);
+    if (nsQuota >= 0 && nsQuota < nsCount) {
+      throw new NSQuotaExceededException(nsQuota, nsCount);
+    }
+    if (dsQuota >= 0 && dsQuota < diskspace) {
+      throw new DSQuotaExceededException(dsQuota, diskspace);
     }
   }
 }

Modified: hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java
(original)
+++ hadoop/common/branches/branch-0.20/src/hdfs/org/apache/hadoop/hdfs/tools/DFSAdmin.java
Mon Jun 22 20:22:08 2009
@@ -117,9 +117,8 @@
       "\t\tBest effort for the directory, with faults reported if\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t2. user is not an administrator, or\n" +
-      "\t\t3. the directory does not exist or is a file, or\n" +
-      "\t\t4. the directory would immediately exceed the new quota.";
-    
+      "\t\t3. the directory does not exist or is a file, or\n";
+
     private final long quota; // the quota to be set
     
     /** Constructor */
@@ -204,9 +203,8 @@
       "\t\tBest effort for the directory, with faults reported if\n" +
       "\t\t1. N is not a positive integer, or\n" +
       "\t\t2. user is not an administrator, or\n" +
-      "\t\t3. the directory does not exist or is a file, or\n" +
-      "\t\t4. the directory would immediately exceed the new space quota.";
-    
+      "\t\t3. the directory does not exist or is a file, or\n";
+
     private long quota; // the quota to be set
     
     /** Constructor */

Modified: hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/cli/testConf.xml
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/cli/testConf.xml?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/cli/testConf.xml (original)
+++ hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/cli/testConf.xml Mon Jun
22 20:22:08 2009
@@ -3214,7 +3214,7 @@
       <comparators>
         <comparator>
           <type>SubstringComparator</type>
-          <expected-output>The quota of /test is exceeded</expected-output>
+          <expected-output>The NameSpace quota (directories and files) of directory
/test is exceeded</expected-output>
         </comparator>
       </comparators>
     </test>

Modified: hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/TestQuota.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/TestQuota.java?rev=787380&r1=787379&r2=787380&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/TestQuota.java (original)
+++ hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/hdfs/TestQuota.java Mon
Jun 22 20:22:08 2009
@@ -28,6 +28,8 @@
 import org.apache.hadoop.hdfs.tools.DFSAdmin;
 import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.security.UnixUserGroupInformation;
+import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
+import org.apache.hadoop.hdfs.protocol.DSQuotaExceededException;
 
 import junit.framework.TestCase;
 
@@ -112,7 +114,7 @@
       boolean hasException = false;
       try {
         assertFalse(dfs.mkdirs(childDir1));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -124,7 +126,7 @@
       hasException = false;
       try {
         fout = dfs.create(childFile1);
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -148,7 +150,7 @@
       try {
         fout.write(new byte[fileLen]);
         fout.close();
-      } catch (QuotaExceededException e) {
+      } catch (DSQuotaExceededException e) {
         hasException = true;
         IOUtils.closeStream(fout);
       }
@@ -167,9 +169,10 @@
       DFSTestUtil.createFile(dfs, childFile1, fileLen, replication, 0);
       
       // 11: set the quota of /test to be 1
+      // HADOOP-5872 - we can set quota even if it is immediately violated
       args = new String[]{"-setQuota", "1", parent.toString()};
-      runCommand(admin, args, true);
-      runCommand(admin, true, "-setSpaceQuota",  // for space quota
+      runCommand(admin, args, false);
+      runCommand(admin, false, "-setSpaceQuota",  // for space quota
                  Integer.toString(fileLen), args[2]);
       
       // 12: set the quota of /test/data0 to be 1
@@ -180,7 +183,7 @@
       hasException = false;
       try {
         assertFalse(dfs.mkdirs(new Path(childDir0, "in")));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -303,7 +306,7 @@
       boolean hasException = false;
       try {
         assertFalse(dfs.mkdirs(tempPath));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -326,7 +329,7 @@
       hasException = false;
       try {
         assertFalse(dfs.mkdirs(tempPath));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -345,7 +348,7 @@
       hasException = false;
       try {
         assertFalse(dfs.rename(tempPath, quotaDir3));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -356,7 +359,7 @@
       hasException = false;
       try {
         assertFalse(dfs.rename(tempPath, new Path(quotaDir3, "nqdir32")));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -379,7 +382,7 @@
       hasException = false;
       try {
         assertFalse(dfs.rename(new Path("/nqdir0/nqdir30"), tempPath));
-      } catch (QuotaExceededException e) {
+      } catch (NSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -480,7 +483,7 @@
       try {
         DFSTestUtil.createFile(dfs, new Path(quotaDir21, "nqdir33/file2"), 
                                2*fileLen, replication, 0);
-      } catch (QuotaExceededException e) {
+      } catch (DSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -523,7 +526,7 @@
       hasException = false;
       try {
         assertFalse(dfs.rename(dstPath, srcPath));
-      } catch (QuotaExceededException e) {
+      } catch (DSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);
@@ -569,7 +572,7 @@
         out.write(new byte[fileLen + 1024]);
         out.flush();
         out.close();
-      } catch (QuotaExceededException e) {
+      } catch (DSQuotaExceededException e) {
         hasException = true;
         IOUtils.closeStream(out);
       }
@@ -594,7 +597,7 @@
       hasException = false;
       try {
         dfs.setReplication(file2, (short)(replication+1));
-      } catch (QuotaExceededException e) {
+      } catch (DSQuotaExceededException e) {
         hasException = true;
       }
       assertTrue(hasException);



Mime
View raw message