mirror of https://github.com/tikv/client-java.git
fix key not in region (#104)
Signed-off-by: birdstorm <samuelwyf@hotmail.com>
This commit is contained in:
parent
0d15c5269c
commit
a0229f56aa
|
@ -1032,20 +1032,20 @@ public class RegionStoreClient extends AbstractRegionStoreClient {
|
|||
this);
|
||||
}
|
||||
|
||||
public RegionStoreClient build(TiRegion region, Store store) throws GrpcException {
|
||||
public synchronized RegionStoreClient build(TiRegion region, Store store) throws GrpcException {
|
||||
return build(region, store, TiStoreType.TiKV);
|
||||
}
|
||||
|
||||
public RegionStoreClient build(ByteString key) throws GrpcException {
|
||||
public synchronized RegionStoreClient build(ByteString key) throws GrpcException {
|
||||
return build(key, TiStoreType.TiKV);
|
||||
}
|
||||
|
||||
public RegionStoreClient build(ByteString key, TiStoreType storeType) throws GrpcException {
|
||||
public synchronized RegionStoreClient build(ByteString key, TiStoreType storeType) throws GrpcException {
|
||||
Pair<TiRegion, Store> pair = regionManager.getRegionStorePairByKey(key, storeType);
|
||||
return build(pair.first, pair.second, storeType);
|
||||
}
|
||||
|
||||
public RegionStoreClient build(TiRegion region) throws GrpcException {
|
||||
public synchronized RegionStoreClient build(TiRegion region) throws GrpcException {
|
||||
Store store = regionManager.getStoreById(region.getLeader().getStoreId());
|
||||
return build(region, store, TiStoreType.TiKV);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue