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
.client
;
20 import java
.util
.List
;
21 import java
.util
.concurrent
.CompletableFuture
;
22 import java
.util
.concurrent
.TimeUnit
;
23 import java
.util
.function
.Function
;
24 import org
.apache
.hadoop
.conf
.Configuration
;
25 import org
.apache
.hadoop
.hbase
.TableName
;
26 import org
.apache
.hadoop
.hbase
.filter
.Filter
;
28 import org
.apache
.hbase
.thirdparty
.com
.google
.protobuf
.RpcChannel
;
31 * Can be overridden in UT if you only want to implement part of the methods in {@link AsyncTable}.
33 public class DummyAsyncTable
<C
extends ScanResultConsumerBase
> implements AsyncTable
<C
> {
36 public TableName
getName() {
41 public Configuration
getConfiguration() {
46 public CompletableFuture
<TableDescriptor
> getDescriptor() {
51 public AsyncTableRegionLocator
getRegionLocator() {
56 public long getRpcTimeout(TimeUnit unit
) {
61 public long getReadRpcTimeout(TimeUnit unit
) {
66 public long getWriteRpcTimeout(TimeUnit unit
) {
71 public long getOperationTimeout(TimeUnit unit
) {
76 public long getScanTimeout(TimeUnit unit
) {
81 public CompletableFuture
<Result
> get(Get get
) {
86 public CompletableFuture
<Void
> put(Put put
) {
91 public CompletableFuture
<Void
> delete(Delete delete
) {
96 public CompletableFuture
<Result
> append(Append append
) {
101 public CompletableFuture
<Result
> increment(Increment increment
) {
106 public CheckAndMutateBuilder
checkAndMutate(byte[] row
, byte[] family
) {
111 public CheckAndMutateWithFilterBuilder
checkAndMutate(byte[] row
, Filter filter
) {
116 public CompletableFuture
<CheckAndMutateResult
> checkAndMutate(CheckAndMutate checkAndMutate
) {
121 public List
<CompletableFuture
<CheckAndMutateResult
>> checkAndMutate(
122 List
<CheckAndMutate
> checkAndMutates
) {
127 public CompletableFuture
<Result
> mutateRow(RowMutations mutation
) {
132 public void scan(Scan scan
, C consumer
) {
136 public ResultScanner
getScanner(Scan scan
) {
141 public CompletableFuture
<List
<Result
>> scanAll(Scan scan
) {
146 public List
<CompletableFuture
<Result
>> get(List
<Get
> gets
) {
151 public List
<CompletableFuture
<Void
>> put(List
<Put
> puts
) {
156 public List
<CompletableFuture
<Void
>> delete(List
<Delete
> deletes
) {
161 public <T
> List
<CompletableFuture
<T
>> batch(List
<?
extends Row
> actions
) {
166 public <S
, R
> CompletableFuture
<R
> coprocessorService(Function
<RpcChannel
, S
> stubMaker
,
167 ServiceCaller
<S
, R
> callable
, byte[] row
) {
172 public <S
, R
> CoprocessorServiceBuilder
<S
, R
> coprocessorService(
173 Function
<RpcChannel
, S
> stubMaker
, ServiceCaller
<S
, R
> callable
,
174 CoprocessorCallback
<R
> callback
) {