accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch master updated: Clean up warnings from #531
Date Wed, 20 Jun 2018 22:10:01 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new f25af95  Clean up warnings from #531
f25af95 is described below

commit f25af95031756c2ab8a335001ea5ab5298c1fc81
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Wed Jun 20 18:09:05 2018 -0400

    Clean up warnings from #531
    
    Use FileStatus object directly to check if a path is a directory or file
---
 .../src/main/java/org/apache/accumulo/server/fs/VolumeManager.java   | 3 ---
 .../main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java   | 5 -----
 .../base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java | 4 ++--
 .../src/main/java/org/apache/accumulo/tserver/logger/LogReader.java  | 2 +-
 .../java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java  | 5 -----
 5 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
index 76cc6f3..1b23699 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManager.java
@@ -146,9 +146,6 @@ public interface VolumeManager {
   // forward to the appropriate FileSystem object
   short getDefaultReplication(Path logPath);
 
-  // forward to the appropriate FileSystem object
-  boolean isFile(Path path) throws IOException;
-
   // all volume are ready to provide service (not in SafeMode, for example)
   boolean isReady() throws IOException;
 
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
index 05df085..4a73dac 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeManagerImpl.java
@@ -334,11 +334,6 @@ public class VolumeManagerImpl implements VolumeManager {
     return v.getFileSystem().getDefaultReplication(path);
   }
 
-  @Override
-  public boolean isFile(Path path) throws IOException {
-    return getVolumeByPath(path).getFileSystem().isFile(path);
-  }
-
   public static VolumeManager get() throws IOException {
     AccumuloConfiguration conf = SiteConfiguration.getInstance();
     return get(conf);
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
index d0f17b3..79c67a1 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/VolumeUtil.java
@@ -337,10 +337,10 @@ public class VolumeUtil {
 
     if (fs1.exists(dir) && fs2.exists(newDir)) {
 
-      if (!fs1.isDirectory(dir))
+      if (!fs1.getFileStatus(dir).isDirectory())
         throw new IllegalArgumentException("expected " + dir + " to be a directory");
 
-      if (!fs2.isDirectory(newDir))
+      if (!fs2.getFileStatus(newDir).isDirectory())
         throw new IllegalArgumentException("expected " + newDir + " to be a directory");
 
       HashSet<String> names1 = getFileNames(fs1.listStatus(dir));
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
index fe537d5..e17c45d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/logger/LogReader.java
@@ -103,7 +103,7 @@ public class LogReader {
       LogFileKey key = new LogFileKey();
       LogFileValue value = new LogFileValue();
 
-      if (fs.isFile(path)) {
+      if (fs.getFileStatus(path).isFile()) {
         try (final FSDataInputStream fsinput = fs.open(path)) {
           // read log entries from a simple hdfs file
           DFSLoggerInputStreams streams;
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
index dd0ebf9..4495504 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerSyncCheckTest.java
@@ -173,11 +173,6 @@ public class TabletServerSyncCheckTest {
     }
 
     @Override
-    public boolean isFile(Path path) throws IOException {
-      return false;
-    }
-
-    @Override
     public boolean isReady() throws IOException {
       return false;
     }


Mime
View raw message