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.io.IOException;
021import java.util.List;
022import java.util.concurrent.CompletableFuture;
023import java.util.concurrent.ExecutorService;
024import org.apache.hadoop.conf.Configuration;
025import org.apache.hadoop.hbase.RegionLocations;
026import org.apache.hadoop.hbase.ServerName;
027import org.apache.hadoop.hbase.TableName;
028import org.apache.hadoop.hbase.ipc.RpcClient;
029import org.apache.hadoop.hbase.util.Pair;
030import org.apache.hadoop.hbase.wal.WAL.Entry;
031import org.apache.hadoop.hbase.zookeeper.MasterAddressTracker;
032import org.apache.hadoop.security.token.Token;
033
034import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse;
035
036/**
037 * Can be overridden in UT if you only want to implement part of the methods in
038 * {@link AsyncClusterConnection}.
039 */
040public class DummyAsyncClusterConnection implements AsyncClusterConnection {
041
042  @Override
043  public Configuration getConfiguration() {
044    return null;
045  }
046
047  @Override
048  public AsyncTableRegionLocator getRegionLocator(TableName tableName) {
049    return null;
050  }
051
052  @Override
053  public void clearRegionLocationCache() {
054  }
055
056  @Override
057  public AsyncTableBuilder<AdvancedScanResultConsumer> getTableBuilder(TableName tableName) {
058    return null;
059  }
060
061  @Override
062  public AsyncTableBuilder<ScanResultConsumer> getTableBuilder(TableName tableName,
063    ExecutorService pool) {
064    return null;
065  }
066
067  @Override
068  public AsyncAdminBuilder getAdminBuilder() {
069    return null;
070  }
071
072  @Override
073  public AsyncAdminBuilder getAdminBuilder(ExecutorService pool) {
074    return null;
075  }
076
077  @Override
078  public AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName) {
079    return null;
080  }
081
082  @Override
083  public AsyncBufferedMutatorBuilder getBufferedMutatorBuilder(TableName tableName,
084    ExecutorService pool) {
085    return null;
086  }
087
088  @Override
089  public CompletableFuture<Hbck> getHbck() {
090    return null;
091  }
092
093  @Override
094  public Hbck getHbck(ServerName masterServer) throws IOException {
095    return null;
096  }
097
098  @Override
099  public boolean isClosed() {
100    return false;
101  }
102
103  @Override
104  public void close() throws IOException {
105  }
106
107  @Override
108  public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) {
109    return null;
110  }
111
112  @Override
113  public NonceGenerator getNonceGenerator() {
114    return null;
115  }
116
117  @Override
118  public RpcClient getRpcClient() {
119    return null;
120  }
121
122  @Override
123  public CompletableFuture<FlushRegionResponse> flush(byte[] regionName,
124    boolean writeFlushWALMarker) {
125    return null;
126  }
127
128  @Override
129  public CompletableFuture<RegionLocations> getRegionLocations(TableName tableName, byte[] row,
130    boolean reload) {
131    return null;
132  }
133
134  @Override
135  public CompletableFuture<String> prepareBulkLoad(TableName tableName) {
136    return null;
137  }
138
139  @Override
140  public CompletableFuture<Boolean> bulkLoad(TableName tableName,
141    List<Pair<byte[], String>> familyPaths, byte[] row, boolean assignSeqNum, Token<?> userToken,
142    String bulkToken, boolean copyFiles, List<String> clusterIds, boolean replicate) {
143    return null;
144  }
145
146  @Override
147  public CompletableFuture<Void> cleanupBulkLoad(TableName tableName, String bulkToken) {
148    return null;
149  }
150
151  @Override
152  public Connection toConnection() {
153    return null;
154  }
155
156  @Override
157  public CompletableFuture<List<ServerName>>
158    getLiveRegionServers(MasterAddressTracker masterAddrTracker, int count) {
159    return null;
160  }
161
162  @Override
163  public CompletableFuture<List<ServerName>> getAllBootstrapNodes(ServerName regionServer) {
164    return null;
165  }
166
167  @Override
168  public CompletableFuture<Void> replicate(RegionInfo replica, List<Entry> entries, int numRetries,
169    long rpcTimeoutNs, long operationTimeoutNs) {
170    return null;
171  }
172}