2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 package org
.apache
.hadoop
.hbase
.ipc
;
20 import org
.apache
.hbase
.thirdparty
.com
.google
.protobuf
.RpcCallback
;
22 import java
.io
.IOException
;
24 import org
.apache
.hadoop
.hbase
.CellScanner
;
25 import org
.apache
.hadoop
.hbase
.TableName
;
26 import org
.apache
.yetus
.audience
.InterfaceAudience
;
29 * Simple delegating controller for use with the {@link RpcControllerFactory} to help override
30 * standard behavior of a {@link HBaseRpcController}. Used testing.
32 @InterfaceAudience.Private
33 public class DelegatingHBaseRpcController
implements HBaseRpcController
{
35 private final HBaseRpcController delegate
;
37 public DelegatingHBaseRpcController(HBaseRpcController delegate
) {
38 this.delegate
= delegate
;
47 public boolean failed() {
48 return delegate
.failed();
52 public String
errorText() {
53 return delegate
.errorText();
57 public void startCancel() {
58 delegate
.startCancel();
62 public void setFailed(String reason
) {
63 delegate
.setFailed(reason
);
67 public boolean isCanceled() {
68 return delegate
.isCanceled();
72 public void notifyOnCancel(RpcCallback
<Object
> callback
) {
73 delegate
.notifyOnCancel(callback
);
77 public CellScanner
cellScanner() {
78 return delegate
.cellScanner();
82 public void setCellScanner(CellScanner cellScanner
) {
83 delegate
.setCellScanner(cellScanner
);
87 public void setPriority(int priority
) {
88 delegate
.setPriority(priority
);
92 public void setPriority(TableName tn
) {
93 delegate
.setPriority(tn
);
97 public int getPriority() {
98 return delegate
.getPriority();
102 public int getCallTimeout() {
103 return delegate
.getCallTimeout();
107 public void setCallTimeout(int callTimeout
) {
108 delegate
.setCallTimeout(callTimeout
);
112 public boolean hasCallTimeout() {
113 return delegate
.hasCallTimeout();
117 public void setFailed(IOException e
) {
118 delegate
.setFailed(e
);
122 public IOException
getFailed() {
123 return delegate
.getFailed();
127 public void setDone(CellScanner cellScanner
) {
128 delegate
.setDone(cellScanner
);
132 public void notifyOnCancel(RpcCallback
<Object
> callback
, CancellationCallback action
)
134 delegate
.notifyOnCancel(callback
, action
);