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
.security
.token
.Token
;
33 import org
.apache
.hadoop
.hbase
.shaded
.protobuf
.generated
.AdminProtos
.FlushRegionResponse
;
36 * Can be overridden in UT if you only want to implement part of the methods in
37 * {@link AsyncClusterConnection}.
39 public class DummyAsyncClusterConnection
implements AsyncClusterConnection
{
42 public Configuration
getConfiguration() {
47 public AsyncTableRegionLocator
getRegionLocator(TableName tableName
) {
52 public void clearRegionLocationCache() {
56 public AsyncTableBuilder
<AdvancedScanResultConsumer
> getTableBuilder(TableName tableName
) {
61 public AsyncTableBuilder
<ScanResultConsumer
> getTableBuilder(TableName tableName
,
62 ExecutorService pool
) {
67 public AsyncAdminBuilder
getAdminBuilder() {
72 public AsyncAdminBuilder
getAdminBuilder(ExecutorService pool
) {
77 public AsyncBufferedMutatorBuilder
getBufferedMutatorBuilder(TableName tableName
) {
82 public AsyncBufferedMutatorBuilder
getBufferedMutatorBuilder(TableName tableName
,
83 ExecutorService pool
) {
88 public CompletableFuture
<Hbck
> getHbck() {
93 public Hbck
getHbck(ServerName masterServer
) throws IOException
{
98 public boolean isClosed() {
103 public void close() throws IOException
{
107 public AsyncRegionServerAdmin
getRegionServerAdmin(ServerName serverName
) {
112 public NonceGenerator
getNonceGenerator() {
117 public RpcClient
getRpcClient() {
122 public CompletableFuture
<FlushRegionResponse
> flush(byte[] regionName
,
123 boolean writeFlushWALMarker
) {
128 public CompletableFuture
<Long
> replay(TableName tableName
, byte[] encodedRegionName
, byte[] row
,
129 List
<Entry
> entries
, int replicaId
, int numRetries
, long operationTimeoutNs
) {
134 public CompletableFuture
<RegionLocations
> getRegionLocations(TableName tableName
, byte[] row
,
140 public CompletableFuture
<String
> prepareBulkLoad(TableName tableName
) {
145 public CompletableFuture
<Boolean
> bulkLoad(TableName tableName
,
146 List
<Pair
<byte[], String
>> familyPaths
, byte[] row
, boolean assignSeqNum
, Token
<?
> userToken
,
147 String bulkToken
, boolean copyFiles
, List
<String
> clusterIds
, boolean replicate
) {
152 public CompletableFuture
<Void
> cleanupBulkLoad(TableName tableName
, String bulkToken
) {
157 public Connection
toConnection() {