Parcourir la source

HDFS-15234. Add a default method body for the INodeAttributeProvider#checkPermissionWithContext API. (#1909)

Wei-Chiu Chuang il y a 5 ans
Parent
commit
0fa7bf47df

+ 6 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/INodeAttributeProvider.java

@@ -399,8 +399,12 @@ public abstract class INodeAttributeProvider {
      *                     operation.
      * @throws AccessControlException
      */
-    void checkPermissionWithContext(AuthorizationContext authzContext)
-        throws AccessControlException;
+    default void checkPermissionWithContext(AuthorizationContext authzContext)
+        throws AccessControlException {
+      throw new AccessControlException("The authorization provider does not "
+          + "implement the checkPermissionWithContext(AuthorizationContext) "
+          + "API.");
+    }
   }
   /**
    * Initialize the provider. This method is called at NameNode startup