public abstract class AbstractRedisConnection extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
EMPTY_STRING |
| 构造器和说明 |
|---|
AbstractRedisConnection() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Long |
batchDeleteOnCluster(int batchSize,
byte[][] keys,
Function<byte[][],Long> executor,
Function<byte[],Integer> calculator)
集群批量删除
|
protected Long |
batchDeleteOnStandalone(int batchSize,
byte[][] keys,
Function<byte[][],Long> executor)
单机批量删除
|
protected List<byte[]> |
batchGetOnCluster(int batchSize,
byte[][] keys,
Function<byte[][],List<byte[]>> executor,
Function<byte[],Integer> calculator)
集群批量获取,按slot分类后,分批执行MGET操作
|
protected List<byte[]> |
batchGetOnStandalone(int batchSize,
byte[][] keys,
Function<byte[][],List<byte[]>> executor)
单机批量获取,分批次执行MGET操作
|
protected static ExecutorService |
defaultExecutor() |
protected Set<byte[]> |
distributionScanKeys(Function<CompletionService<Set<byte[]>>,Integer> forkExecutor)
并发扫描
|
protected Map<Integer,Set<byte[]>> |
getClassifiedKeys(Function<byte[],Integer> calculator,
byte[]... keys)
Keys安装slot分类
|
protected ExecutorService |
getExecutor()
可自由定制
|
protected String |
parseServerVersion(String content)
解析当前Redis-Server版本,不支持Redis跨版本集群解析
|
protected static ExecutorService defaultExecutor()
protected String parseServerVersion(String content)
content - redis-server-infoprotected Long batchDeleteOnStandalone(int batchSize, byte[][] keys, Function<byte[][],Long> executor)
batchSize - 每批次处理的数量keys - 待处理的keysexecutor - 执行删除动作的执行器protected List<byte[]> batchGetOnStandalone(int batchSize, byte[][] keys, Function<byte[][],List<byte[]>> executor)
batchSize - 每批次处理的数量keys - 待处理的keysexecutor - 执行MGET动作的执行器protected Long batchDeleteOnCluster(int batchSize, byte[][] keys, Function<byte[][],Long> executor, Function<byte[],Integer> calculator)
batchSize - 每批次处理的数量keys - 待处理的keysexecutor - 执行删除动作的执行器calculator - slot计算器protected List<byte[]> batchGetOnCluster(int batchSize, byte[][] keys, Function<byte[][],List<byte[]>> executor, Function<byte[],Integer> calculator)
batchSize - 每批次处理的数量keys - 待处理的keysexecutor - 执行MGET动作的执行器calculator - slot计算器protected Map<Integer,Set<byte[]>> getClassifiedKeys(Function<byte[],Integer> calculator, byte[]... keys)
calculator - slot计算器keys - 未分类的keysprotected Set<byte[]> distributionScanKeys(Function<CompletionService<Set<byte[]>>,Integer> forkExecutor)
forkExecutor - 负责任务分发,最终需要返回已分发的任务总数protected ExecutorService getExecutor()
Copyright © 2021. All rights reserved.