From d338de4aa57d30349cb7bb1fa32c1d93dfc851e0 Mon Sep 17 00:00:00 2001 From: Jian Zhang <1361320460@qq.com> Date: Sat, 2 Sep 2023 12:44:26 +0800 Subject: [PATCH] add log and javadoc add log and javadoc --- .../federation/resolver/MembershipNamenodeResolver.java | 2 +- .../hdfs/server/federation/router/RouterRpcClient.java | 1 + .../hadoop/hdfs/server/federation/MiniRouterDFSCluster.java | 5 +++++ .../apache/hadoop/hdfs/server/federation/MockResolver.java | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MembershipNamenodeResolver.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MembershipNamenodeResolver.java index 3c5c8eae7fd4d..b17a165175c39 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MembershipNamenodeResolver.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/MembershipNamenodeResolver.java @@ -489,7 +489,7 @@ public void setRouterId(String router) { */ @Override public synchronized void rotateCache( - String nsId, FederationNamenodeContext namenode, boolean listObserversFirst) { + String nsId, FederationNamenodeContext namenode, boolean listObserversFirst) { cacheNS.compute(Pair.of(nsId, listObserversFirst), (ns, namenodeContexts) -> { if (namenodeContexts == null || namenodeContexts.size() <= 1) { return namenodeContexts; diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java index 436f624ddc6b1..9a0e1bc2c68f0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java @@ -601,6 +601,7 @@ public Object invokeMethod( nsId, rpcAddress, ioe.getMessage()); if (this.namenodeResolver != null) { this.namenodeResolver.rotateCache(nsId, namenode, shouldUseObserver); + LOG.info("Rotate cache of pair: ", nsId, shouldUseObserver); } // Throw RetriableException so that client can retry throw new RetriableException(ioe); diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MiniRouterDFSCluster.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MiniRouterDFSCluster.java index 61205128e8b46..bf22cf01148a3 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MiniRouterDFSCluster.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MiniRouterDFSCluster.java @@ -1203,6 +1203,11 @@ public void waitClusterUp() throws IOException { } } + /** + * Get cache flush interval in milliseconds. + * + * @return Cache flush interval in milliseconds. + */ public long getCacheFlushInterval() { return cacheFlushInterval; } diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java index 6d11c057e01cd..554879856ac1b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MockResolver.java @@ -399,7 +399,7 @@ public void setRouterId(String router) { @Override public void rotateCache( - String nsId, FederationNamenodeContext namenode, boolean listObserversFirst) { + String nsId, FederationNamenodeContext namenode, boolean listObserversFirst) { } /**