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
.io
.IOException
;
21 import java
.util
.List
;
22 import java
.util
.concurrent
.CompletableFuture
;
23 import java
.util
.concurrent
.ExecutorService
;
24 import org
.apache
.hadoop
.conf
.Configuration
;
25 import org
.apache
.hadoop
.hbase
.RegionLocations
;
26 import org
.apache
.hadoop
.hbase
.ServerName
;
27 import org
.apache
.hadoop
.hbase
.TableName
;
28 import org
.apache
.hadoop
.hbase
.ipc
.RpcClient
;
29 import org
.apache
.hadoop
.hbase
.util
.Pair
;
30 import org
.apache
.hadoop
.hbase
.wal
.WAL
.Entry
;
31 import org
.apache
.hadoop
.hbase
.zookeeper
.MasterAddressTracker
;
32 import org
.apache
.hadoop
.security
.token
.Token
;
34 import org
.apache
.hadoop
.hbase
.shaded
.protobuf
.generated
.AdminProtos
.FlushRegionResponse
;
37 * Can be overridden in UT if you only want to implement part of the methods in
38 * {@link AsyncClusterConnection}.
40 public class DummyAsyncClusterConnection
implements AsyncClusterConnection
{
43 public Configuration
getConfiguration() {
48 public AsyncTableRegionLocator
getRegionLocator(TableName tableName
) {
53 public void clearRegionLocationCache() {
57 public AsyncTableBuilder
<AdvancedScanResultConsumer
> getTableBuilder(TableName tableName
) {
62 public AsyncTableBuilder
<ScanResultConsumer
> getTableBuilder(TableName tableName
,
63 ExecutorService pool
) {
68 public AsyncAdminBuilder
getAdminBuilder() {
73 public AsyncAdminBuilder
getAdminBuilder(ExecutorService pool
) {
78 public AsyncBufferedMutatorBuilder
getBufferedMutatorBuilder(TableName tableName
) {
83 public AsyncBufferedMutatorBuilder
getBufferedMutatorBuilder(TableName tableName
,
84 ExecutorService pool
) {
89 public CompletableFuture
<Hbck
> getHbck() {
94 public Hbck
getHbck(ServerName masterServer
) throws IOException
{
99 public boolean isClosed() {
104 public void close() throws IOException
{
108 public AsyncRegionServerAdmin
getRegionServerAdmin(ServerName serverName
) {
113 public NonceGenerator
getNonceGenerator() {
118 public RpcClient
getRpcClient() {
123 public CompletableFuture
<FlushRegionResponse
> flush(byte[] regionName
,
124 boolean writeFlushWALMarker
) {
129 public CompletableFuture
<RegionLocations
> getRegionLocations(TableName tableName
, byte[] row
,
135 public CompletableFuture
<String
> prepareBulkLoad(TableName tableName
) {
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
) {
147 public CompletableFuture
<Void
> cleanupBulkLoad(TableName tableName
, String bulkToken
) {
152 public Connection
toConnection() {
157 public CompletableFuture
<List
<ServerName
>>
158 getLiveRegionServers(MasterAddressTracker masterAddrTracker
, int count
) {
163 public CompletableFuture
<List
<ServerName
>> getAllBootstrapNodes(ServerName regionServer
) {
168 public CompletableFuture
<Void
> replicate(RegionInfo replica
,
169 List
<Entry
> entries
, int numRetries
, long rpcTimeoutNs
,
170 long operationTimeoutNs
) {