This is an automated email from the ASF dual-hosted git repository.

aengineer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 629ab5d  HDDS-2380. OMFileRequest should use the isExist API while 
checking for pre-existing files in the directory path.
629ab5d is described below

commit 629ab5da83f872e1d310ebaede734e56de52bd3d
Author: Aravindan Vijayan <avija...@cloudera.com>
AuthorDate: Tue Oct 29 13:56:54 2019 -0700

    HDDS-2380. OMFileRequest should use the isExist API while checking for 
pre-existing files in the directory path.
    
    Signed-off-by: Anu Engineer <aengin...@apache.org>
---
 .../java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java   | 4 ++--
 .../hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
index dbe056c..3a095d2 100644
--- 
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
+++ 
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileRequest.java
@@ -60,7 +60,7 @@ public final class OMFileRequest {
       String dbDirKeyName = omMetadataManager.getOzoneDirKey(volumeName,
           bucketName, pathName);
 
-      if (omMetadataManager.getKeyTable().get(dbKeyName) != null) {
+      if (omMetadataManager.getKeyTable().isExist(dbKeyName)) {
         // Found a file in the given path.
         // Check if this is actual file or a file in the given path
         if (dbKeyName.equals(fileNameFromDetails)) {
@@ -68,7 +68,7 @@ public final class OMFileRequest {
         } else {
           return OMDirectoryResult.FILE_EXISTS_IN_GIVENPATH;
         }
-      } else if (omMetadataManager.getKeyTable().get(dbDirKeyName) != null) {
+      } else if (omMetadataManager.getKeyTable().isExist(dbDirKeyName)) {
         // Found a directory in the given path.
         // Check if this is actual directory or a directory in the given path
         if (dbDirKeyName.equals(dirNameFromDetails)) {
diff --git 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
index 85edb7e..6f1aa8f 100644
--- 
a/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
+++ 
b/hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/spi/impl/ContainerDBServiceProviderImpl.java
@@ -185,7 +185,7 @@ public class ContainerDBServiceProviderImpl
    */
   @Override
   public boolean doesContainerExists(Long containerID) throws IOException {
-    return containerKeyCountTable.get(containerID) != null;
+    return containerKeyCountTable.isExist(containerID);
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-commits-h...@hadoop.apache.org

Reply via email to