Fixed - codec is not applied to RBuckets.set() method in non Cluster mode. #3913

pull/3917/head
Nikita Koksharov 3 years ago
parent 722dfa5b3b
commit 06e370897e

@ -150,7 +150,7 @@ public class RedissonBuckets implements RBuckets {
} }
return params.toArray(); return params.toArray();
} }
}, buckets.keySet().toArray(new String[]{}), buckets); }, buckets.keySet().toArray(new String[]{}));
} }
} }

@ -120,7 +120,5 @@ public interface CommandAsyncExecutor {
<T, R> RFuture<R> readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys); <T, R> RFuture<R> readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys);
<T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys); <T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys);
<T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String[] keys, Map<String, ?> valueMap);
} }

@ -597,35 +597,21 @@ public class CommandAsyncService implements CommandAsyncExecutor {
@Override @Override
public <T, R> RFuture<R> readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys) { public <T, R> RFuture<R> readBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys) {
return executeBatchedAsync(true, codec, command, callback, keys, null); return executeBatchedAsync(true, codec, command, callback, keys);
} }
@Override @Override
public <T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys) { public <T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String... keys) {
return executeBatchedAsync(false, codec, command, callback, keys, null); return executeBatchedAsync(false, codec, command, callback, keys);
} }
@Override private <T, R> RFuture<R> executeBatchedAsync(boolean readOnly, Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String[] keys) {
public <T, R> RFuture<R> writeBatchedAsync(Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String[] keys, Map<String, ?> valueMap) {
return executeBatchedAsync(false, codec, command, callback, keys, valueMap);
}
private <T, R> RFuture<R> executeBatchedAsync(boolean readOnly, Codec codec, RedisCommand<T> command, SlotCallback<T, R> callback, String[] keys, Map<String, ?> valueMap) {
if (!connectionManager.isClusterMode()) { if (!connectionManager.isClusterMode()) {
List<Object> params = null; Object[] params = callback.createParams(Arrays.asList(keys));
if (valueMap != null) {
params = new ArrayList<>(keys.length * 2);
for (String key : keys) {
params.add(key);
params.add(valueMap.get(key));
}
} else {
params = Arrays.asList(keys);
}
if (readOnly) { if (readOnly) {
return readAsync((String) null, codec, command, params.toArray()); return readAsync((String) null, codec, command, params);
} }
return writeAsync((String) null, codec, command, params.toArray()); return writeAsync((String) null, codec, command, params);
} }
Map<MasterSlaveEntry, Map<Integer, List<String>>> entry2keys = Arrays.stream(keys).collect( Map<MasterSlaveEntry, Map<Integer, List<String>>> entry2keys = Arrays.stream(keys).collect(

Loading…
Cancel
Save