public class ClientUtils extends Object
Constructor and Description |
---|
ClientUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
appendBatches(BackOffer backOffer,
List<Batch> batches,
TiRegion region,
List<com.google.protobuf.ByteString> keys,
int batchMaxSizeInBytes,
int batchLimit)
Append batch to list and split them according to batch limit
|
static void |
appendBatches(BackOffer backOffer,
List<Batch> batches,
TiRegion region,
List<com.google.protobuf.ByteString> keys,
List<com.google.protobuf.ByteString> values,
int batchMaxSizeInBytes,
int batchLimit)
Append batch to list and split them according to batch limit
|
static byte[] |
genUUID() |
static List<Batch> |
getBatches(BackOffer backOffer,
List<com.google.protobuf.ByteString> keys,
int batchSize,
int batchLimit,
RegionStoreClient.RegionStoreClientBuilder clientBuilder) |
static List<Kvrpcpb.KvPair> |
getKvPairs(ExecutorCompletionService<List<Kvrpcpb.KvPair>> completionService,
List<Batch> batches,
int backOff) |
static <T> void |
getTasks(ExecutorCompletionService<List<T>> completionService,
Queue<List<T>> taskQueue,
List<T> batches,
long backOff) |
static <T,U> List<U> |
getTasksWithOutput(ExecutorCompletionService<Pair<List<T>,List<U>>> completionService,
Queue<List<T>> taskQueue,
List<T> batches,
long backOff) |
static Map<TiRegion,List<com.google.protobuf.ByteString>> |
groupKeysByRegion(RegionManager regionManager,
List<com.google.protobuf.ByteString> keys,
BackOffer backoffer) |
static Map<TiRegion,List<com.google.protobuf.ByteString>> |
groupKeysByRegion(RegionManager regionManager,
List<com.google.protobuf.ByteString> keys,
BackOffer backoffer,
boolean sorted)
Group by list of keys according to its region
|
static Map<TiRegion,List<com.google.protobuf.ByteString>> |
groupKeysByRegion(RegionManager regionManager,
Set<com.google.protobuf.ByteString> keys,
BackOffer backoffer) |
public static void appendBatches(BackOffer backOffer, List<Batch> batches, TiRegion region, List<com.google.protobuf.ByteString> keys, int batchMaxSizeInBytes, int batchLimit)
backOffer
- backOfferbatches
- a grouped batchregion
- regionkeys
- keysbatchMaxSizeInBytes
- batch max limitpublic static void appendBatches(BackOffer backOffer, List<Batch> batches, TiRegion region, List<com.google.protobuf.ByteString> keys, List<com.google.protobuf.ByteString> values, int batchMaxSizeInBytes, int batchLimit)
backOffer
- backOfferbatches
- a grouped batchregion
- regionkeys
- keysvalues
- valuesbatchMaxSizeInBytes
- batch max limitpublic static List<Batch> getBatches(BackOffer backOffer, List<com.google.protobuf.ByteString> keys, int batchSize, int batchLimit, RegionStoreClient.RegionStoreClientBuilder clientBuilder)
public static Map<TiRegion,List<com.google.protobuf.ByteString>> groupKeysByRegion(RegionManager regionManager, Set<com.google.protobuf.ByteString> keys, BackOffer backoffer)
public static Map<TiRegion,List<com.google.protobuf.ByteString>> groupKeysByRegion(RegionManager regionManager, List<com.google.protobuf.ByteString> keys, BackOffer backoffer)
public static Map<TiRegion,List<com.google.protobuf.ByteString>> groupKeysByRegion(RegionManager regionManager, List<com.google.protobuf.ByteString> keys, BackOffer backoffer, boolean sorted)
keys
- keyspublic static List<Kvrpcpb.KvPair> getKvPairs(ExecutorCompletionService<List<Kvrpcpb.KvPair>> completionService, List<Batch> batches, int backOff)
public static <T> void getTasks(ExecutorCompletionService<List<T>> completionService, Queue<List<T>> taskQueue, List<T> batches, long backOff)
public static <T,U> List<U> getTasksWithOutput(ExecutorCompletionService<Pair<List<T>,List<U>>> completionService, Queue<List<T>> taskQueue, List<T> batches, long backOff)
public static byte[] genUUID()
Copyright © 2024 PingCAP. All rights reserved.