hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1588979 - in /hbase/trunk: hbase-common/src/main/java/org/apache/hadoop/hbase/util/ hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/ hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/ hbase-server/src/main/java/...
Date Mon, 21 Apr 2014 20:46:53 GMT
Author: tedyu
Date: Mon Apr 21 20:46:52 2014
New Revision: 1588979

URL: http://svn.apache.org/r1588979
Log:
HBASE-11032 Replace deprecated methods in FileSystem with their replacements (Gustavo)


Modified:
    hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
    hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HLogInputFormat.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSRegionScanner.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestUpgradeTo96.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/HFileReadWriteTest.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java

Modified: hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
(original)
+++ hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/CoprocessorClassLoader.java
Mon Apr 21 20:46:52 2014
@@ -155,7 +155,7 @@ public class CoprocessorClassLoader exte
         FileSystem fs = FileSystem.getLocal(conf);
         fs.delete(parentDir, true); // it's ok if the dir doesn't exist now
         parentDirLockSet.add(parentDirStr);
-        if (!fs.mkdirs(parentDir) && !fs.getFileStatus(parentDir).isDir()) {
+        if (!fs.mkdirs(parentDir) && !fs.getFileStatus(parentDir).isDirectory())
{
           throw new RuntimeException("Failed to create local dir " + parentDirStr
             + ", CoprocessorClassLoader failed to init");
         }

Modified: hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
(original)
+++ hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/util/DynamicClassLoader.java
Mon Apr 21 20:46:52 2014
@@ -185,7 +185,7 @@ public class DynamicClassLoader extends 
     }
 
     for (FileStatus status: statuses) {
-      if (status.isDir()) continue; // No recursive lookup
+      if (status.isDirectory()) continue; // No recursive lookup
       Path path = status.getPath();
       String fileName = path.getName();
       if (!fileName.endsWith(".jar")) {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/backup/example/LongTermArchivingHFileCleaner.java
Mon Apr 21 20:46:52 2014
@@ -51,7 +51,7 @@ public class LongTermArchivingHFileClean
   public boolean isFileDeletable(FileStatus fStat) {
     try {
       // if its a directory, then it can be deleted
-      if (fStat.isDir()) return true;
+      if (fStat.isDirectory()) return true;
       
       Path file = fStat.getPath();
       // check to see if

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java Mon
Apr 21 20:46:52 2014
@@ -879,7 +879,7 @@ public class HFile {
     for(FileStatus dir : familyDirs) {
       FileStatus[] files = fs.listStatus(dir.getPath());
       for (FileStatus file : files) {
-        if (!file.isDir()) {
+        if (!file.isDirectory()) {
           res.add(file.getPath());
         }
       }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HLogInputFormat.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HLogInputFormat.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HLogInputFormat.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/HLogInputFormat.java
Mon Apr 21 20:46:52 2014
@@ -237,7 +237,7 @@ public class HLogInputFormat extends Inp
     FileStatus[] files = fs.listStatus(dir);
     if (files == null) return Collections.emptyList();
     for (FileStatus file : files) {
-      if (file.isDir()) {
+      if (file.isDirectory()) {
         // recurse into sub directories
         result.addAll(getFiles(fs, file.getPath(), startTime, endTime));
       } else {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
Mon Apr 21 20:46:52 2014
@@ -181,7 +181,7 @@ public class LoadIncrementalHFiles exten
     }
 
     for (FileStatus stat : familyDirStatuses) {
-      if (!stat.isDir()) {
+      if (!stat.isDirectory()) {
         LOG.warn("Skipping non-directory " + stat.getPath());
         continue;
       }
@@ -823,7 +823,7 @@ public class LoadIncrementalHFiles exten
     TreeMap<byte[], Integer> map = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR);
 
     for (FileStatus stat : familyDirStatuses) {
-      if (!stat.isDir()) {
+      if (!stat.isDirectory()) {
         LOG.warn("Skipping non-directory " + stat.getPath());
         continue;
       }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
Mon Apr 21 20:46:52 2014
@@ -144,7 +144,7 @@ public abstract class CleanerChore<T ext
     List<FileStatus> files = Lists.newArrayListWithCapacity(entries.length);
     for (FileStatus child : entries) {
       Path path = child.getPath();
-      if (child.isDir()) {
+      if (child.isDirectory()) {
         // for each subdirectory delete it and all entries if possible
         if (!checkAndDeleteDirectory(path)) {
           allEntriesDeleted = false;

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactionTool.java
Mon Apr 21 20:46:52 2014
@@ -408,7 +408,7 @@ public class CompactionTool extends Conf
         } else if (!opt.startsWith("-")) {
           Path path = new Path(opt);
           FileStatus status = fs.getFileStatus(path);
-          if (!status.isDir()) {
+          if (!status.isDirectory()) {
             printUsage("Specified path is not a directory. path=" + path);
             return 1;
           }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
Mon Apr 21 20:46:52 2014
@@ -632,7 +632,7 @@ public class StoreFile {
    */
   public static Path getUniqueFile(final FileSystem fs, final Path dir)
       throws IOException {
-    if (!fs.getFileStatus(dir).isDir()) {
+    if (!fs.getFileStatus(dir).isDirectory()) {
       throw new IOException("Expecting " + dir.toString() +
         " to be a directory");
     }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFileInfo.java
Mon Apr 21 20:46:52 2014
@@ -344,7 +344,7 @@ public class StoreFileInfo {
       throws IOException {
     final Path p = fileStatus.getPath();
 
-    if (fileStatus.isDir())
+    if (fileStatus.isDirectory())
       return false;
 
     // Check for empty hfile. Should never be the case but can happen

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java
Mon Apr 21 20:46:52 2014
@@ -1613,7 +1613,7 @@ class FSHLog implements HLog, Syncable {
     if (!fs.exists(p)) {
       throw new FileNotFoundException(p.toString());
     }
-    if (!fs.getFileStatus(p).isDir()) {
+    if (!fs.getFileStatus(p).isDirectory()) {
       throw new IOException(p + " is not a directory");
     }
 

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/security/access/SecureBulkLoadEndpoint.java
Mon Apr 21 20:46:52 2014
@@ -382,7 +382,7 @@ public class SecureBulkLoadEndpoint exte
      */
     private boolean isFile(Path p) throws IOException {
       FileStatus status = srcFs.getFileStatus(p);
-      boolean isFile = !status.isDir();
+      boolean isFile = !status.isDirectory();
       try {
         isFile = isFile && !(Boolean)Methods.call(FileStatus.class, status, "isSymlink",
null, null);
       } catch (Exception e) {

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/ExportSnapshot.java
Mon Apr 21 20:46:52 2014
@@ -145,7 +145,7 @@ public final class ExportSnapshot extend
       }
 
       // Use the default block size of the outputFs if bigger
-      int defaultBlockSize = Math.max((int) outputFs.getDefaultBlockSize(), BUFFER_SIZE);
+      int defaultBlockSize = Math.max((int) outputFs.getDefaultBlockSize(outputRoot), BUFFER_SIZE);
       bufferSize = conf.getInt(CONF_BUFFER_SIZE, defaultBlockSize);
       LOG.info("Using bufferSize=" + StringUtils.humanReadableInt(bufferSize));
     }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSRegionScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSRegionScanner.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSRegionScanner.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSRegionScanner.java
Mon Apr 21 20:46:52 2014
@@ -86,7 +86,7 @@ class FSRegionScanner implements Runnabl
 
       // for each cf, get all the blocks information
       for (FileStatus cfStatus : cfList) {
-        if (!cfStatus.isDir()) {
+        if (!cfStatus.isDirectory()) {
           // skip because this is not a CF directory
           continue;
         }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSUtils.java Mon Apr
21 20:46:52 2014
@@ -204,7 +204,7 @@ public abstract class FSUtils {
       m = null; // could happen on setAccessible()
     }
     if (m == null) {
-      return fs.getDefaultBlockSize();
+      return fs.getDefaultBlockSize(path);
     } else {
       try {
         Object ret = m.invoke(fs, path);
@@ -238,7 +238,7 @@ public abstract class FSUtils {
       m = null; // could happen on setAccessible()
     }
     if (m == null) {
-      return fs.getDefaultReplication();
+      return fs.getDefaultReplication(path);
     } else {
       try {
         Object ret = m.invoke(fs, path);
@@ -1220,7 +1220,7 @@ public abstract class FSUtils {
         if (blacklist.contains(p.getName().toString())) {
           isValid = false;
         } else {
-          isValid = fs.getFileStatus(p).isDir();
+          isValid = fs.getFileStatus(p).isDirectory();
         }
       } catch (IOException e) {
         LOG.warn("An error occurred while verifying if [" + p.toString()
@@ -1364,7 +1364,7 @@ public abstract class FSUtils {
       }
 
       try {
-        return fs.getFileStatus(rd).isDir();
+        return fs.getFileStatus(rd).isDirectory();
       } catch (IOException ioe) {
         // Maybe the file was moved or the fs was disconnected.
         LOG.warn("Skipping file " + rd +" due to IOException", ioe);
@@ -1414,7 +1414,7 @@ public abstract class FSUtils {
       }
 
       try {
-        return fs.getFileStatus(rd).isDir();
+        return fs.getFileStatus(rd).isDirectory();
       } catch (IOException ioe) {
         // Maybe the file was moved or the fs was disconnected.
         LOG.warn("Skipping file " + rd +" due to IOException", ioe);
@@ -1463,7 +1463,7 @@ public abstract class FSUtils {
 
       try {
         // only files
-        return !fs.getFileStatus(rd).isDir();
+        return !fs.getFileStatus(rd).isDirectory();
       } catch (IOException ioe) {
         // Maybe the file was moved or the fs was disconnected.
         LOG.warn("Skipping file " + rd +" due to IOException", ioe);
@@ -1686,7 +1686,7 @@ public abstract class FSUtils {
     if (files == null) return;
 
     for (FileStatus file : files) {
-      if (file.isDir()) {
+      if (file.isDirectory()) {
         LOG.debug(prefix + file.getPath().getName() + "/");
         logFSTree(LOG, fs, file.getPath(), prefix + "---");
       } else {
@@ -1836,7 +1836,7 @@ public abstract class FSUtils {
           continue;
         }
 
-        if (!regionStatus.isDir()) {
+        if (!regionStatus.isDirectory()) {
           continue;
         }
 

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java Mon
Apr 21 20:46:52 2014
@@ -4109,7 +4109,7 @@ public class HBaseFsck extends Configure
       return;
     }
 
-    if (fs.getFileStatus(p).isDir()) {
+    if (fs.getFileStatus(p).isDirectory()) {
       FileStatus[] fss= fs.listStatus(p);
       for (FileStatus status : fss) {
         debugLsr(conf, status.getPath(), errors);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
Mon Apr 21 20:46:52 2014
@@ -1972,7 +1972,7 @@ public class HBaseTestingUtility extends
     Path tableDir = new Path(getDefaultRootDirPath().toString()
         + System.getProperty("file.separator") + htd.getTableName()
         + System.getProperty("file.separator") + regionToDeleteInFS);
-    FileSystem.get(c).delete(tableDir);
+    FileSystem.get(c).delete(tableDir, true);
     // flush cache of regions
     HConnection conn = table.getConnection();
     conn.clearRegionCache();

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/TestHFileArchiving.java
Mon Apr 21 20:46:52 2014
@@ -422,7 +422,7 @@ public class TestHFileArchiving {
     if (files == null || files.length == 0) return fileNames;
 
     for (FileStatus file : files) {
-      if (file.isDir()) {
+      if (file.isDirectory()) {
         recurseOnFiles(fs, FSUtils.listStatus(fs, file.getPath(), null), fileNames);
       } else fileNames.add(file.getPath().getName());
     }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/backup/example/TestZooKeeperTableArchiveClient.java
Mon Apr 21 20:46:52 2014
@@ -362,7 +362,7 @@ public class TestZooKeeperTableArchiveCl
 
     List<Path> allFiles = new ArrayList<Path>();
     for (FileStatus file : files) {
-      if (file.isDir()) {
+      if (file.isDirectory()) {
         List<Path> subFiles = getAllFiles(fs, file.getPath());
         if (subFiles != null) allFiles.addAll(subFiles);
         continue;
@@ -414,4 +414,4 @@ public class TestZooKeeperTableArchiveCl
     // stop the cleaner
     stop.stop("");
   }
-}
\ No newline at end of file
+}

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java Mon
Apr 21 20:46:52 2014
@@ -128,8 +128,8 @@ public class TestFileLink {
       assertEquals(256 << 20, size);
     } finally {
       in.close();
-      if (fs.exists(originalPath)) fs.delete(originalPath);
-      if (fs.exists(archivedPath)) fs.delete(archivedPath);
+      if (fs.exists(originalPath)) fs.delete(originalPath, true);
+      if (fs.exists(archivedPath)) fs.delete(archivedPath, true);
     }
   }
 
@@ -173,19 +173,19 @@ public class TestFileLink {
         // Switch to file 1
         n = in.read(data);
         dataVerify(data, n, (byte)0);
-        fs.delete(files.get(0));
+        fs.delete(files.get(0), true);
         skipBuffer(in, (byte)0);
 
         // Switch to file 2
         n = in.read(data);
         dataVerify(data, n, (byte)1);
-        fs.delete(files.get(1));
+        fs.delete(files.get(1), true);
         skipBuffer(in, (byte)1);
 
         // Switch to file 3
         n = in.read(data);
         dataVerify(data, n, (byte)2);
-        fs.delete(files.get(2));
+        fs.delete(files.get(2), true);
         skipBuffer(in, (byte)2);
 
         // No more files available

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/master/handler/TestTableDeleteFamilyHandler.java
Mon Apr 21 20:46:52 2014
@@ -120,11 +120,11 @@ public class TestTableDeleteFamilyHandle
     // 4 - Check if all the 3 column families exist in FS
     FileStatus[] fileStatus = fs.listStatus(tableDir);
     for (int i = 0; i < fileStatus.length; i++) {
-      if (fileStatus[i].isDir() == true) {
+      if (fileStatus[i].isDirectory() == true) {
         FileStatus[] cf = fs.listStatus(fileStatus[i].getPath());
         int k = 1;
         for (int j = 0; j < cf.length; j++) {
-          if (cf[j].isDir() == true
+          if (cf[j].isDirectory() == true
               && cf[j].getPath().getName().startsWith(".") == false) {
             assertEquals(cf[j].getPath().getName(), "cf" + k);
             k++;
@@ -147,10 +147,10 @@ public class TestTableDeleteFamilyHandle
     // 6 - Check if the second column family is gone from the FS
     fileStatus = fs.listStatus(tableDir);
     for (int i = 0; i < fileStatus.length; i++) {
-      if (fileStatus[i].isDir() == true) {
+      if (fileStatus[i].isDirectory() == true) {
         FileStatus[] cf = fs.listStatus(fileStatus[i].getPath());
         for (int j = 0; j < cf.length; j++) {
-          if (cf[j].isDir() == true) {
+          if (cf[j].isDirectory() == true) {
             assertFalse(cf[j].getPath().getName().equals("cf2"));
           }
         }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestUpgradeTo96.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestUpgradeTo96.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestUpgradeTo96.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/migration/TestUpgradeTo96.java
Mon Apr 21 20:46:52 2014
@@ -174,7 +174,7 @@ public class TestUpgradeTo96 {
     }
     FileStatus[] cfs = fs.listStatus(targetRegion);
     for (FileStatus f : cfs) {
-      if (f.isDir()) {
+      if (f.isDirectory()) {
         columnFamilyDir = f.getPath();
         break;
       }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/HFileReadWriteTest.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/HFileReadWriteTest.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/HFileReadWriteTest.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/HFileReadWriteTest.java
Mon Apr 21 20:46:52 2014
@@ -295,14 +295,14 @@ public class HFileReadWriteTest {
         return false;
       }
 
-      if (fs.getFileStatus(path).isDir()) {
+      if (fs.getFileStatus(path).isDirectory()) {
         LOG.error(inputFileName + " is a directory");
         return false;
       }
     }
 
     if (outputDir != null &&
-        (!fs.exists(outputDir) || !fs.getFileStatus(outputDir).isDir())) {
+        (!fs.exists(outputDir) || !fs.getFileStatus(outputDir).isDirectory())) {
       LOG.error(outputDir.toString() + " does not exist or is not a " +
           "directory");
       return false;

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Mon Apr 21 20:46:52 2014
@@ -3858,7 +3858,7 @@ public class TestHRegion {
         fs.exists(regionInfoFile));
 
     // Remove the .regioninfo file and verify is recreated on region open
-    fs.delete(regionInfoFile);
+    fs.delete(regionInfoFile, true);
     assertFalse(HRegionFileSystem.REGION_INFO_FILE + " should be removed from the region
dir",
         fs.exists(regionInfoFile));
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestLogRolling.java
Mon Apr 21 20:46:52 2014
@@ -323,8 +323,9 @@ public class TestLogRolling  {
   public void testLogRollOnDatanodeDeath() throws Exception {
     TEST_UTIL.ensureSomeRegionServersAvailable(2);
     assertTrue("This test requires HLog file replication set to 2.",
-      fs.getDefaultReplication() == 2);
-    LOG.info("Replication=" + fs.getDefaultReplication());
+      fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()) == 2);
+    LOG.info("Replication=" + 
+      fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()));
 
     this.server = cluster.getRegionServer(0);
     this.log = server.getWAL();
@@ -362,8 +363,10 @@ public class TestLogRolling  {
     }
 
     assertTrue("DataNodes " + dfsCluster.getDataNodes().size() +
-        " default replication " + fs.getDefaultReplication(),
-    dfsCluster.getDataNodes().size() >= fs.getDefaultReplication() + 1);
+        " default replication " + 
+        fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()),
+    dfsCluster.getDataNodes().size() >= 
+      fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()) + 1);
 
     writeData(table, 2);
 
@@ -375,7 +378,8 @@ public class TestLogRolling  {
     assertTrue("The log shouldn't have rolled yet",
       oldFilenum == ((FSHLog) log).getFilenum());
     final DatanodeInfo[] pipeline = getPipeline(log);
-    assertTrue(pipeline.length == fs.getDefaultReplication());
+    assertTrue(pipeline.length == 
+        fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()));
 
     // kill a datanode in the pipeline to force a log roll on the next sync()
     // This function is synchronous, when it returns the node is killed.
@@ -410,7 +414,8 @@ public class TestLogRolling  {
     batchWriteAndWait(table, 13, true, 10000);
     assertTrue("New log file should have the default replication instead of " +
       ((FSHLog) log).getLogReplication(),
-      ((FSHLog) log).getLogReplication() == fs.getDefaultReplication());
+      ((FSHLog) log).getLogReplication() == 
+        fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()));
     assertTrue("LowReplication Roller should've been enabled",
         log.isLowReplicationRollEnabled());
   }
@@ -424,8 +429,9 @@ public class TestLogRolling  {
   public void testLogRollOnPipelineRestart() throws Exception {
     LOG.info("Starting testLogRollOnPipelineRestart");
     assertTrue("This test requires HLog file replication.",
-      fs.getDefaultReplication() > 1);
-    LOG.info("Replication=" + fs.getDefaultReplication());
+      fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()) > 1);
+    LOG.info("Replication=" + 
+      fs.getDefaultReplication(TEST_UTIL.getDataTestDirOnTestFS()));
     // When the hbase:meta table can be opened, the region servers are running
     new HTable(TEST_UTIL.getConfiguration(), TableName.META_TABLE_NAME);
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/PerformanceEvaluation.java
Mon Apr 21 20:46:52 2014
@@ -338,7 +338,7 @@ public class PerformanceEvaluation exten
       List<InputSplit> splitList = new ArrayList<InputSplit>();
 
       for (FileStatus file: listStatus(job)) {
-        if (file.isDir()) {
+        if (file.isDirectory()) {
           continue;
         }
         Path path = file.getPath();

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/security/access/TestAccessController.java
Mon Apr 21 20:46:52 2014
@@ -900,7 +900,7 @@ public class TestAccessController extend
     }
 
     public void setPermission(Path dir, FsPermission perm) throws IOException {
-      if(!fs.getFileStatus(dir).isDir()) {
+      if(!fs.getFileStatus(dir).isDirectory()) {
         fs.setPermission(dir,perm);
       }
       else {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/SnapshotTestingUtils.java
Mon Apr 21 20:46:52 2014
@@ -419,7 +419,7 @@ public class SnapshotTestingUtils {
           throws IOException {
         HFileLink link = HFileLink.create(util.getConfiguration(), table, region, family,
hfile);
         if (corruptedFiles.size() % 2 == 0) {
-          fs.delete(link.getAvailablePath(fs));
+          fs.delete(link.getAvailablePath(fs), true);
           corruptedFiles.add(hfile);
         }
       }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/snapshot/TestExportSnapshot.java
Mon Apr 21 20:46:52 2014
@@ -274,7 +274,7 @@ public class TestExportSnapshot {
     assertEquals(filesExpected, rootFiles.length);
     for (FileStatus fileStatus: rootFiles) {
       String name = fileStatus.getPath().getName();
-      assertTrue(fileStatus.isDir());
+      assertTrue(fileStatus.isDirectory());
       assertTrue(name.equals(HConstants.SNAPSHOT_DIR_NAME) ||
                  name.equals(HConstants.HFILE_ARCHIVE_DIRECTORY));
     }
@@ -381,7 +381,7 @@ public class TestExportSnapshot {
     if (list != null) {
       for (FileStatus fstat: list) {
         LOG.debug(fstat.getPath());
-        if (fstat.isDir()) {
+        if (fstat.isDirectory()) {
           files.addAll(listFiles(fs, root, fstat.getPath()));
         } else {
           files.add(fstat.getPath().toString().substring(rootPrefix));

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/HFileArchiveTestingUtil.java
Mon Apr 21 20:46:52 2014
@@ -158,7 +158,7 @@ public class HFileArchiveTestingUtil {
         Path parent = f.getPath().getParent();
         String shortName = name.split("[.]")[0];
         Path modPath = new Path(parent, shortName);
-        FileStatus file = new FileStatus(f.getLen(), f.isDir(), f.getReplication(),
+        FileStatus file = new FileStatus(f.getLen(), f.isDirectory(), f.getReplication(),
             f.getBlockSize(), f.getModificationTime(), modPath);
         backedupFiles.add(file);
       } else {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSVisitor.java
Mon Apr 21 20:46:52 2014
@@ -84,7 +84,7 @@ public class TestFSVisitor {
 
   @After
   public void tearDown() throws Exception {
-    fs.delete(rootDir);
+    fs.delete(rootDir, true);
   }
 
   @Test

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java?rev=1588979&r1=1588978&r2=1588979&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestHBaseFsck.java
Mon Apr 21 20:46:52 2014
@@ -1717,7 +1717,7 @@ public class TestHBaseFsck {
         continue;
       }
       for (FileStatus hfs : hfFss) {
-        if (!hfs.isDir()) {
+        if (!hfs.isDirectory()) {
           return hfs.getPath();
         }
       }



Mime
View raw message