001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.apache.hadoop.hbase.client; 019 020import java.util.List; 021import java.util.Map; 022import java.util.concurrent.CompletableFuture; 023import java.util.concurrent.TimeUnit; 024import java.util.function.Function; 025import org.apache.hadoop.conf.Configuration; 026import org.apache.hadoop.hbase.TableName; 027import org.apache.hadoop.hbase.filter.Filter; 028 029import org.apache.hbase.thirdparty.com.google.protobuf.RpcChannel; 030 031/** 032 * Can be overridden in UT if you only want to implement part of the methods in {@link AsyncTable}. 033 */ 034public class DummyAsyncTable<C extends ScanResultConsumerBase> implements AsyncTable<C> { 035 036 @Override 037 public TableName getName() { 038 return null; 039 } 040 041 @Override 042 public Configuration getConfiguration() { 043 return null; 044 } 045 046 @Override 047 public CompletableFuture<TableDescriptor> getDescriptor() { 048 return null; 049 } 050 051 @Override 052 public AsyncTableRegionLocator getRegionLocator() { 053 return null; 054 } 055 056 @Override 057 public long getRpcTimeout(TimeUnit unit) { 058 return 0; 059 } 060 061 @Override 062 public long getReadRpcTimeout(TimeUnit unit) { 063 return 0; 064 } 065 066 @Override 067 public long getWriteRpcTimeout(TimeUnit unit) { 068 return 0; 069 } 070 071 @Override 072 public long getOperationTimeout(TimeUnit unit) { 073 return 0; 074 } 075 076 @Override 077 public long getScanTimeout(TimeUnit unit) { 078 return 0; 079 } 080 081 @Override 082 public Map<String, byte[]> getRequestAttributes() { 083 return null; 084 } 085 086 @Override 087 public CompletableFuture<Result> get(Get get) { 088 return null; 089 } 090 091 @Override 092 public CompletableFuture<Void> put(Put put) { 093 return null; 094 } 095 096 @Override 097 public CompletableFuture<Void> delete(Delete delete) { 098 return null; 099 } 100 101 @Override 102 public CompletableFuture<Result> append(Append append) { 103 return null; 104 } 105 106 @Override 107 public CompletableFuture<Result> increment(Increment increment) { 108 return null; 109 } 110 111 @Override 112 public CheckAndMutateBuilder checkAndMutate(byte[] row, byte[] family) { 113 return null; 114 } 115 116 @Override 117 public CheckAndMutateWithFilterBuilder checkAndMutate(byte[] row, Filter filter) { 118 return null; 119 } 120 121 @Override 122 public CompletableFuture<CheckAndMutateResult> checkAndMutate(CheckAndMutate checkAndMutate) { 123 return null; 124 } 125 126 @Override 127 public List<CompletableFuture<CheckAndMutateResult>> 128 checkAndMutate(List<CheckAndMutate> checkAndMutates) { 129 return null; 130 } 131 132 @Override 133 public CompletableFuture<Result> mutateRow(RowMutations mutation) { 134 return null; 135 } 136 137 @Override 138 public void scan(Scan scan, C consumer) { 139 } 140 141 @Override 142 public ResultScanner getScanner(Scan scan) { 143 return null; 144 } 145 146 @Override 147 public CompletableFuture<List<Result>> scanAll(Scan scan) { 148 return null; 149 } 150 151 @Override 152 public List<CompletableFuture<Result>> get(List<Get> gets) { 153 return null; 154 } 155 156 @Override 157 public List<CompletableFuture<Void>> put(List<Put> puts) { 158 return null; 159 } 160 161 @Override 162 public List<CompletableFuture<Void>> delete(List<Delete> deletes) { 163 return null; 164 } 165 166 @Override 167 public <T> List<CompletableFuture<T>> batch(List<? extends Row> actions) { 168 return null; 169 } 170 171 @Override 172 public <S, R> CompletableFuture<R> coprocessorService(Function<RpcChannel, S> stubMaker, 173 ServiceCaller<S, R> callable, byte[] row) { 174 return null; 175 } 176 177 @Override 178 public <S, R> CoprocessorServiceBuilder<S, R> coprocessorService( 179 Function<RpcChannel, S> stubMaker, ServiceCaller<S, R> callable, 180 CoprocessorCallback<R> callback) { 181 return null; 182 } 183 184 @Override 185 public <S, R> CoprocessorServiceBuilder<S, R> coprocessorService( 186 Function<RpcChannel, S> stubMaker, ServiceCaller<S, R> callable, 187 PartialResultCoprocessorCallback<S, R> callback) { 188 return null; 189 } 190}