Skip to content

Commit 6aa2e87

Browse files
Apache9Duo Zhang
authored andcommitted
HBASE-25288 Make MasterRpcServices not extends RSRpcServices and also HMaster not extends HRegionServer
1 parent 29b65bc commit 6aa2e87

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2067
-1954
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseRpcServicesBase.java

Lines changed: 386 additions & 0 deletions
Large diffs are not rendered by default.

hbase-server/src/main/java/org/apache/hadoop/hbase/HBaseServerBase.java

Lines changed: 600 additions & 0 deletions
Large diffs are not rendered by default.

hbase-server/src/main/java/org/apache/hadoop/hbase/Server.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public interface Server extends Abortable, Stoppable {
4949
* Important note: this method returns a reference to Connection which is managed
5050
* by Server itself, so callers must NOT attempt to close connection obtained.
5151
*/
52-
Connection getConnection();
52+
default Connection getConnection() {
53+
return getAsyncConnection().toConnection();
54+
}
5355

5456
Connection createConnection(Configuration conf) throws IOException;
5557

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/AnnotationReadingPriorityFunction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
import java.util.HashMap;
2222
import java.util.Map;
2323
import org.apache.commons.lang3.StringUtils;
24+
import org.apache.hadoop.hbase.HBaseRpcServicesBase;
2425
import org.apache.hadoop.hbase.HConstants;
25-
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
2626
import org.apache.hadoop.hbase.security.User;
2727
import org.apache.yetus.audience.InterfaceAudience;
2828

@@ -52,7 +52,7 @@
5252
// RegionSpecifier object. Methods can be invoked on the returned object
5353
// to figure out whether it is a meta region or not.
5454
@InterfaceAudience.Private
55-
public abstract class AnnotationReadingPriorityFunction<T extends RSRpcServices>
55+
public abstract class AnnotationReadingPriorityFunction<T extends HBaseRpcServicesBase<?>>
5656
implements PriorityFunction {
5757

5858
protected final Map<String, Integer> annotatedQos;

hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcServer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import java.util.concurrent.CountDownLatch;
2525
import org.apache.hadoop.conf.Configuration;
2626
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
27+
import org.apache.hadoop.hbase.HBaseServerBase;
2728
import org.apache.hadoop.hbase.Server;
2829
import org.apache.hadoop.hbase.regionserver.HRegionServer;
2930
import org.apache.hadoop.hbase.security.HBasePolicyProvider;
@@ -79,7 +80,7 @@ public NettyRpcServer(Server server, String name, List<BlockingServiceAndInterfa
7980
EventLoopGroup eventLoopGroup;
8081
Class<? extends ServerChannel> channelClass;
8182
if (server instanceof HRegionServer) {
82-
NettyEventLoopGroupConfig config = ((HRegionServer) server).getEventLoopGroupConfig();
83+
NettyEventLoopGroupConfig config = ((HBaseServerBase) server).getEventLoopGroupConfig();
8384
eventLoopGroup = config.group();
8485
channelClass = config.serverChannelClass();
8586
} else {

0 commit comments

Comments
 (0)