001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018package org.apache.hadoop.hbase.ipc;
019
020import org.apache.hadoop.hbase.HBaseInterfaceAudience;
021import org.apache.yetus.audience.InterfaceAudience;
022import org.apache.yetus.audience.InterfaceStability;
023
024/**
025 * Users of the hbase.region.server.rpc.scheduler.factory.class customization config can return an
026 * implementation which extends this class in order to minimize impact of breaking interface
027 * changes.
028 */
029@InterfaceAudience.LimitedPrivate({ HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX })
030@InterfaceStability.Evolving
031public class DelegatingRpcScheduler extends RpcScheduler {
032  protected RpcScheduler delegate;
033
034  public DelegatingRpcScheduler(RpcScheduler delegate) {
035    this.delegate = delegate;
036  }
037
038  @Override
039  public void stop() {
040    delegate.stop();
041  }
042
043  @Override
044  public void start() {
045    delegate.start();
046  }
047
048  @Override
049  public void init(Context context) {
050    delegate.init(context);
051  }
052
053  @Override
054  public int getReplicationQueueLength() {
055    return delegate.getReplicationQueueLength();
056  }
057
058  @Override
059  public int getBulkLoadQueueLength() {
060    return delegate.getBulkLoadQueueLength();
061  }
062
063  @Override
064  public int getPriorityQueueLength() {
065    return delegate.getPriorityQueueLength();
066  }
067
068  @Override
069  public int getGeneralQueueLength() {
070    return delegate.getGeneralQueueLength();
071  }
072
073  @Override
074  public int getActiveRpcHandlerCount() {
075    return delegate.getActiveRpcHandlerCount();
076  }
077
078  @Override
079  public int getActiveGeneralRpcHandlerCount() {
080    return delegate.getActiveGeneralRpcHandlerCount();
081  }
082
083  @Override
084  public int getActivePriorityRpcHandlerCount() {
085    return delegate.getActivePriorityRpcHandlerCount();
086  }
087
088  @Override
089  public int getActiveReplicationRpcHandlerCount() {
090    return delegate.getActiveReplicationRpcHandlerCount();
091  }
092
093  @Override
094  public int getActiveBulkLoadRpcHandlerCount() {
095    return delegate.getActiveBulkLoadRpcHandlerCount();
096  }
097
098  @Override
099  public boolean dispatch(CallRunner task) {
100    return delegate.dispatch(task);
101  }
102
103  @Override
104  public int getActiveMetaPriorityRpcHandlerCount() {
105    return delegate.getActiveMetaPriorityRpcHandlerCount();
106  }
107
108  @Override
109  public int getMetaPriorityQueueLength() {
110    return delegate.getMetaPriorityQueueLength();
111  }
112
113  @Override
114  public long getNumGeneralCallsDropped() {
115    return delegate.getNumGeneralCallsDropped();
116  }
117
118  @Override
119  public long getNumLifoModeSwitches() {
120    return delegate.getNumLifoModeSwitches();
121  }
122
123  @Override
124  public int getWriteQueueLength() {
125    return 0;
126  }
127
128  @Override
129  public int getReadQueueLength() {
130    return 0;
131  }
132
133  @Override
134  public int getScanQueueLength() {
135    return 0;
136  }
137
138  @Override
139  public int getActiveWriteRpcHandlerCount() {
140    return 0;
141  }
142
143  @Override
144  public int getActiveReadRpcHandlerCount() {
145    return 0;
146  }
147
148  @Override
149  public int getActiveScanRpcHandlerCount() {
150    return 0;
151  }
152
153  @Override
154  public CallQueueInfo getCallQueueInfo() {
155    return delegate.getCallQueueInfo();
156  }
157}