View Javadoc

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
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
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.
17   */
18  
19  package org.apache.hadoop.hbase.ipc;
20  
21  
22  import com.google.protobuf.RpcCallback;
23  import com.google.protobuf.RpcController;
24  
25  public class TimeLimitedRpcController implements RpcController {
26  
27    /**
28     * The time, in ms before the call should expire.
29     */
30    protected Integer callTimeout;
31  
32    public Integer getCallTimeout() {
33      return callTimeout;
34    }
35  
36    public void setCallTimeout(int callTimeout) {
37      this.callTimeout = callTimeout;
38    }
39  
40    public boolean hasCallTimeout(){
41      return callTimeout != null;
42    }
43  
44    @Override
45    public String errorText() {
46      throw new UnsupportedOperationException();
47    }
48  
49    @Override
50    public boolean failed() {
51      throw new UnsupportedOperationException();
52    }
53  
54    @Override
55    public boolean isCanceled() {
56      throw new UnsupportedOperationException();
57    }
58  
59    @Override
60    public void notifyOnCancel(RpcCallback<Object> arg0) {
61      throw new UnsupportedOperationException();
62    }
63  
64    @Override
65    public void reset() {
66      throw new UnsupportedOperationException();
67    }
68  
69    @Override
70    public void setFailed(String arg0) {
71      throw new UnsupportedOperationException();
72    }
73  
74    @Override
75    public void startCancel() {
76      throw new UnsupportedOperationException();
77    }
78  }