infraio commented on a change in pull request #163: HBASE-21995 Add a 
coprocessor to set HDFS ACL for hbase granted user
URL: https://github.com/apache/hbase/pull/163#discussion_r292718826
 
 

 ##########
 File path: hbase-server/src/main/java/org/apache/hadoop/hbase/io/FileLink.java
 ##########
 @@ -312,14 +314,35 @@ private FSDataInputStream tryOpen() throws IOException {
           }
           currentPath = path;
           return(in);
-        } catch (FileNotFoundException e) {
-          // Try another file location
-        } catch (RemoteException re) {
-          IOException ioe = 
re.unwrapRemoteException(FileNotFoundException.class);
-          if (!(ioe instanceof FileNotFoundException)) throw re;
+        } catch (FileNotFoundException | AccessControlException | 
RemoteException e) {
+          exception = handleTryOpenException(e, exception);
+        }
+      }
+      throw exception;
+    }
+
+    private IOException handleTryOpenException(IOException newException,
+        IOException previousException) throws IOException {
+      if (newException instanceof FileNotFoundException) {
+        // Try another file location
+        if (previousException == null) {
+          previousException = new FileNotFoundException("Unable to open link: 
" + fileLink);
+        }
+      } else if (newException instanceof AccessControlException) {
+        // Try another file location
+        previousException = newException;
+      } else if (newException instanceof RemoteException) {
+        IOException ioe =
+            ((RemoteException) 
newException).unwrapRemoteException(FileNotFoundException.class);
+        if (ioe instanceof AccessControlException) {
+          previousException = ioe;
+        } else if (!(ioe instanceof FileNotFoundException)) {
+          throw newException;
+        } else {
+          throw newException;
 
 Review comment:
   same with the second if? Why?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to