HBASE-26474 Implement connection-level attributes (addendum)
[hbase.git] / hbase-client / src / main / java / org / apache / hadoop / hbase / ipc / DelegatingHBaseRpcController.java
blobd68d955a984edb2fb4a691d67e0f623bb7a244bb
1 /**
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;
28 /**
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;
41 @Override
42 public void reset() {
43 delegate.reset();
46 @Override
47 public boolean failed() {
48 return delegate.failed();
51 @Override
52 public String errorText() {
53 return delegate.errorText();
56 @Override
57 public void startCancel() {
58 delegate.startCancel();
61 @Override
62 public void setFailed(String reason) {
63 delegate.setFailed(reason);
66 @Override
67 public boolean isCanceled() {
68 return delegate.isCanceled();
71 @Override
72 public void notifyOnCancel(RpcCallback<Object> callback) {
73 delegate.notifyOnCancel(callback);
76 @Override
77 public CellScanner cellScanner() {
78 return delegate.cellScanner();
81 @Override
82 public void setCellScanner(CellScanner cellScanner) {
83 delegate.setCellScanner(cellScanner);
86 @Override
87 public void setPriority(int priority) {
88 delegate.setPriority(priority);
91 @Override
92 public void setPriority(TableName tn) {
93 delegate.setPriority(tn);
96 @Override
97 public int getPriority() {
98 return delegate.getPriority();
101 @Override
102 public int getCallTimeout() {
103 return delegate.getCallTimeout();
106 @Override
107 public void setCallTimeout(int callTimeout) {
108 delegate.setCallTimeout(callTimeout);
111 @Override
112 public boolean hasCallTimeout() {
113 return delegate.hasCallTimeout();
116 @Override
117 public void setFailed(IOException e) {
118 delegate.setFailed(e);
121 @Override
122 public IOException getFailed() {
123 return delegate.getFailed();
126 @Override
127 public void setDone(CellScanner cellScanner) {
128 delegate.setDone(cellScanner);
131 @Override
132 public void notifyOnCancel(RpcCallback<Object> callback, CancellationCallback action)
133 throws IOException {
134 delegate.notifyOnCancel(callback, action);