Skip to content

Commit

Permalink
HBASE-25288 Make MasterRpcServices not extends RSRpcServices and also…
Browse files Browse the repository at this point in the history
… HMaster not extends HRegionServer (#3612)

Signed-off-by: Yulin Niu <niuyulin@apache.org>
  • Loading branch information
Apache9 authored Sep 13, 2021
1 parent 04c3888 commit d26bcaa
Show file tree
Hide file tree
Showing 41 changed files with 2,071 additions and 1,961 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ public interface Server extends Abortable, Stoppable {
* Important note: this method returns a reference to Connection which is managed
* by Server itself, so callers must NOT attempt to close connection obtained.
*/
Connection getConnection();
default Connection getConnection() {
return getAsyncConnection().toConnection();
}

Connection createConnection(Configuration conf) throws IOException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.hadoop.hbase.HBaseRpcServicesBase;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.regionserver.RSRpcServices;
import org.apache.hadoop.hbase.security.User;
import org.apache.yetus.audience.InterfaceAudience;

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

protected final Map<String, Integer> annotatedQos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.concurrent.CountDownLatch;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseInterfaceAudience;
import org.apache.hadoop.hbase.HBaseServerBase;
import org.apache.hadoop.hbase.Server;
import org.apache.hadoop.hbase.regionserver.HRegionServer;
import org.apache.hadoop.hbase.security.HBasePolicyProvider;
Expand Down Expand Up @@ -79,7 +80,7 @@ public NettyRpcServer(Server server, String name, List<BlockingServiceAndInterfa
EventLoopGroup eventLoopGroup;
Class<? extends ServerChannel> channelClass;
if (server instanceof HRegionServer) {
NettyEventLoopGroupConfig config = ((HRegionServer) server).getEventLoopGroupConfig();
NettyEventLoopGroupConfig config = ((HBaseServerBase) server).getEventLoopGroupConfig();
eventLoopGroup = config.group();
channelClass = config.serverChannelClass();
} else {
Expand Down
Loading

0 comments on commit d26bcaa

Please sign in to comment.