From 63392376c9edcd161dfa3cbdd1be5a18bbbfa0d0 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Tue, 18 May 2021 19:49:00 -0700 Subject: [PATCH] HDFS-16027. Replace abstract methods with default methods in JournalNodeMXBean. (#3018) Reviewed-by: Ayush Saxena --- .../hdfs/qjournal/server/JournalNodeMXBean.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeMXBean.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeMXBean.java index f265c31a34..813a9e0a1f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeMXBean.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeMXBean.java @@ -20,6 +20,7 @@ import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; +import java.util.Collections; import java.util.List; /** @@ -41,7 +42,9 @@ public interface JournalNodeMXBean { * * @return colon separated host and port. */ - String getHostAndPort(); + default String getHostAndPort() { + return ""; + } /** * Get list of the clusters of JournalNode's journals @@ -49,12 +52,16 @@ public interface JournalNodeMXBean { * * @return list of clusters. */ - List getClusterIds(); + default List getClusterIds() { + return Collections.emptyList() ; + } /** * Gets the version of Hadoop. * * @return the version of Hadoop. */ - String getVersion(); + default String getVersion() { + return ""; + } }