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

ayushsaxena pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new e07e445326ac HDFS-17215. RBF: Fix some method annotations about 
@throws . (#6136). Contributed by xiaojunxiang.
e07e445326ac is described below

commit e07e445326ace76a0237692a8b28fdc481e3def7
Author: xiaojunxiang <xiaojunxi...@kingsoft.com>
AuthorDate: Tue Dec 26 03:07:58 2023 +0800

    HDFS-17215. RBF: Fix some method annotations about @throws . (#6136). 
Contributed by xiaojunxiang.
---
 .../java/org/apache/hadoop/hdfs/server/federation/router/Quota.java   | 2 +-
 .../apache/hadoop/hdfs/server/federation/store/StateStoreService.java | 4 +---
 .../hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java | 4 ++--
 .../store/protocol/impl/pb/FederationProtocolPBTranslator.java        | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java
 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java
index 8e984d65c33e..e19e51b5733a 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Quota.java
@@ -75,7 +75,7 @@ public class Quota {
    * @param storagespaceQuota Storage space quota.
    * @param type StorageType that the space quota is intended to be set on.
    * @param checkMountEntry whether to check the path is a mount entry.
-   * @throws AccessControlException If the quota system is disabled or if
+   * @throws IOException If the quota system is disabled or if
    * checkMountEntry is true and the path is a mount entry.
    */
   public void setQuota(String path, long namespaceQuota, long 
storagespaceQuota,
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/StateStoreService.java
 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/StateStoreService.java
index ff0ea486e216..74997e86be3d 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/StateStoreService.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/StateStoreService.java
@@ -138,7 +138,7 @@ public class StateStoreService extends CompositeService {
    * Initialize the State Store and the connection to the back-end.
    *
    * @param config Configuration for the State Store.
-   * @throws IOException Cannot create driver for the State Store.
+   * @throws Exception Cannot create driver for the State Store.
    */
   @Override
   protected void serviceInit(Configuration config) throws Exception {
@@ -239,7 +239,6 @@ public class StateStoreService extends CompositeService {
    *
    * @param <T> Type of the records stored.
    * @param clazz Class of the record store to track.
-   * @return New record store.
    * @throws ReflectiveOperationException
    */
   private <T extends RecordStore<?>> void addRecordStore(
@@ -428,7 +427,6 @@ public class StateStoreService extends CompositeService {
           result = cachedStore.loadCache(force);
         } catch (IOException e) {
           LOG.error("Error updating cache for {}", cacheName, e);
-          result = false;
         }
         if (!result) {
           success = false;
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java
 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java
index a46410a27416..3ace406e49a3 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/impl/MountTableStoreImpl.java
@@ -70,7 +70,7 @@ public class MountTableStoreImpl extends MountTableStore {
    *
    * @param src mount entry being accessed
    * @param action type of action being performed on the mount entry
-   * @throws AccessControlException if mount table cannot be accessed
+   * @throws IOException if mount table cannot be accessed
    */
   private void checkMountTableEntryPermission(String src, FsAction action)
       throws IOException {
@@ -90,7 +90,7 @@ public class MountTableStoreImpl extends MountTableStore {
    * Check parent path permission recursively. It needs WRITE permission
    * of the nearest parent entry and other EXECUTE permission.
    * @param src mount entry being checked
-   * @throws AccessControlException if mount table cannot be accessed
+   * @throws IOException if mount table cannot be accessed
    */
   private void checkMountTablePermission(final String src) throws IOException {
     String parent = src.substring(0, src.lastIndexOf(Path.SEPARATOR));
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/protocol/impl/pb/FederationProtocolPBTranslator.java
 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/protocol/impl/pb/FederationProtocolPBTranslator.java
index 003bcfaddb69..b50b516c6155 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/protocol/impl/pb/FederationProtocolPBTranslator.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/store/protocol/impl/pb/FederationProtocolPBTranslator.java
@@ -54,7 +54,7 @@ public class FederationProtocolPBTranslator<P extends 
GeneratedMessageV3,
    * the proto handler this translator holds.
    */
   @SuppressWarnings("unchecked")
-  public void setProto(Message p) {
+  public void setProto(Message p) throws IllegalArgumentException {
     if (protoClass.isInstance(p)) {
       if (this.builder != null) {
         // Merge with builder


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

Reply via email to