public class ImporterStoreClient<RequestClass,ResponseClass> extends AbstractGRPCClient<ImportSSTGrpc.ImportSSTBlockingStub,ImportSSTGrpc.ImportSSTFutureStub> implements io.grpc.stub.StreamObserver<ResponseClass>
Modifier and Type | Class and Description |
---|---|
static class |
ImporterStoreClient.ImporterStoreClientBuilder<RequestClass,ResponseClass> |
asyncStub, blockingStub, channelFactory, conf, timeout
Modifier | Constructor and Description |
---|---|
protected |
ImporterStoreClient(TiConfiguration conf,
ChannelFactory channelFactory,
ImportSSTGrpc.ImportSSTBlockingStub blockingStub,
ImportSSTGrpc.ImportSSTFutureStub asyncStub,
ImportSSTGrpc.ImportSSTStub stub) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finishWrite()
This API should be called after `writeBatch`.
|
protected ImportSSTGrpc.ImportSSTFutureStub |
getAsyncStub() |
protected ImportSSTGrpc.ImportSSTBlockingStub |
getBlockingStub() |
protected ImportSSTGrpc.ImportSSTStub |
getStub() |
Throwable |
getWriteError() |
ResponseClass |
getWriteResponse() |
boolean |
hasWriteResponseError() |
boolean |
isWriteResponseReceived() |
void |
multiIngest(Kvrpcpb.Context ctx,
Object writeResponse)
This API should be called after `finishWrite`.
|
void |
onCompleted() |
void |
onError(Throwable t) |
void |
onNext(ResponseClass response) |
void |
startWrite()
Ingest KV pairs to RawKV/Txn using gRPC streaming mode.
|
void |
switchMode(ImportSstpb.SwitchMode mode) |
void |
writeBatch(RequestClass request)
This API should be called after `startWrite`.
|
callAsyncWithRetry, callServerStreamingWithRetry, callWithRetry, checkHealth, getConf, getTimeout, setTimeout
protected ImporterStoreClient(TiConfiguration conf, ChannelFactory channelFactory, ImportSSTGrpc.ImportSSTBlockingStub blockingStub, ImportSSTGrpc.ImportSSTFutureStub asyncStub, ImportSSTGrpc.ImportSSTStub stub)
public boolean isWriteResponseReceived()
public ResponseClass getWriteResponse()
public boolean hasWriteResponseError()
public Throwable getWriteError()
public void onNext(ResponseClass response)
onNext
in interface io.grpc.stub.StreamObserver<ResponseClass>
public void onError(Throwable t)
onError
in interface io.grpc.stub.StreamObserver<ResponseClass>
public void onCompleted()
onCompleted
in interface io.grpc.stub.StreamObserver<ResponseClass>
public void startWrite()
public void writeBatch(RequestClass request)
request
- public void finishWrite()
public void multiIngest(Kvrpcpb.Context ctx, Object writeResponse) throws RegionException
ctx
- writeResponse
- RegionException
public void switchMode(ImportSstpb.SwitchMode mode)
protected ImportSSTGrpc.ImportSSTBlockingStub getBlockingStub()
getBlockingStub
in class AbstractGRPCClient<ImportSSTGrpc.ImportSSTBlockingStub,ImportSSTGrpc.ImportSSTFutureStub>
protected ImportSSTGrpc.ImportSSTFutureStub getAsyncStub()
getAsyncStub
in class AbstractGRPCClient<ImportSSTGrpc.ImportSSTBlockingStub,ImportSSTGrpc.ImportSSTFutureStub>
protected ImportSSTGrpc.ImportSSTStub getStub()
public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2024 PingCAP. All rights reserved.