View Javadoc

1   /*
2    *
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   * http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.hadoop.hbase.ipc;
21  
22  import com.google.protobuf.BlockingService;
23  import com.google.protobuf.Descriptors.MethodDescriptor;
24  import com.google.protobuf.Message;
25  import com.google.protobuf.ServiceException;
26  import java.io.IOException;
27  import java.net.InetSocketAddress;
28  import org.apache.hadoop.conf.Configuration;
29  import org.apache.hadoop.hbase.classification.InterfaceAudience;
30  import org.apache.hadoop.hbase.classification.InterfaceStability;
31  import org.apache.hadoop.hbase.CellScanner;
32  import org.apache.hadoop.hbase.HBaseInterfaceAudience;
33  import org.apache.hadoop.hbase.monitoring.MonitoredRPCHandler;
34  import org.apache.hadoop.hbase.namequeues.NamedQueueRecorder;
35  import org.apache.hadoop.hbase.regionserver.RSRpcServices;
36  import org.apache.hadoop.hbase.util.Pair;
37  import org.apache.hadoop.security.authorize.PolicyProvider;
38  
39  @InterfaceAudience.LimitedPrivate({HBaseInterfaceAudience.COPROC, HBaseInterfaceAudience.PHOENIX})
40  @InterfaceStability.Evolving
41  public interface RpcServerInterface {
42    void start();
43    boolean isStarted();
44  
45    void stop();
46    void join() throws InterruptedException;
47  
48    void setSocketSendBufSize(int size);
49    InetSocketAddress getListenerAddress();
50  
51    /**
52     * @deprecated As of release 1.3, this will be removed in HBase 3.0
53     */
54    @Deprecated
55    Pair<Message, CellScanner> call(BlockingService service, MethodDescriptor md,
56      Message param, CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status)
57    throws IOException, ServiceException;
58  
59    Pair<Message, CellScanner> call(BlockingService service, MethodDescriptor md, Message param,
60        CellScanner cellScanner, long receiveTime, MonitoredRPCHandler status, long startTime,
61        int timeout) throws IOException, ServiceException;
62  
63    void setErrorHandler(HBaseRPCErrorHandler handler);
64    HBaseRPCErrorHandler getErrorHandler();
65  
66    /**
67     * Returns the metrics instance for reporting RPC call statistics
68     */
69    MetricsHBaseServer getMetrics();
70  
71    /**
72     * Add/subtract from the current size of all outstanding calls.  Called on setup of a call to add
73     * call total size and then again at end of a call to remove the call size.
74     * @param diff Change (plus or minus)
75     */
76    void addCallSize(long diff);
77  
78    /**
79     * It was removed in HBASE-24174 and added back in HBASE-25285 for compactibility concern.
80     * NOTICE: implementations should call {@link #refreshAuthManager(Configuration, PolicyProvider)}
81     * for correctness.
82     * @param pp PolicyProvider
83     */
84    @InterfaceAudience.Private
85    @Deprecated
86    void refreshAuthManager(PolicyProvider pp);
87  
88    /**
89     * Refresh authentication manager policy.
90     * @param conf configuration for refresh
91     * @param pp
92     */
93    @InterfaceAudience.Private
94    void refreshAuthManager(Configuration conf, PolicyProvider pp);
95  
96    RpcScheduler getScheduler();
97  
98    void setRsRpcServices(RSRpcServices rsRpcServices);
99  
100   /**
101    * Set Online SlowLog Provider
102    *
103    * @param namedQueueRecorder instance of {@link NamedQueueRecorder}
104    */
105   void setNamedQueueRecorder(final NamedQueueRecorder namedQueueRecorder);
106 
107 }