Spring Data Redis refactoring

pull/6394/head
Nikita Koksharov 2 weeks ago
parent 28017b6c8b
commit 3b7e13a8eb

@ -15,7 +15,6 @@
*/
package org.redisson.spring.data.connection;
import io.netty.util.CharsetUtil;
import org.redisson.api.BatchResult;
import org.redisson.api.RFuture;
import org.redisson.api.RedissonClient;
@ -381,7 +380,7 @@ public class RedissonClusterConnection extends RedissonConnection implements Red
throw new InvalidDataAccessResourceUsageException("Clustered rename is not supported in a pipeline");
}
if (redisson.getConnectionManager().calcSlot(oldName) == redisson.getConnectionManager().calcSlot(newName)) {
if (executorService.getConnectionManager().calcSlot(oldName) == executorService.getConnectionManager().calcSlot(newName)) {
super.rename(oldName, newName);
return;
}
@ -410,7 +409,7 @@ public class RedissonClusterConnection extends RedissonConnection implements Red
throw new InvalidDataAccessResourceUsageException("Clustered rename is not supported in a pipeline");
}
if (redisson.getConnectionManager().calcSlot(oldName) == redisson.getConnectionManager().calcSlot(newName)) {
if (executorService.getConnectionManager().calcSlot(oldName) == executorService.getConnectionManager().calcSlot(newName)) {
return super.renameNX(oldName, newName);
}

@ -258,7 +258,7 @@ public class RedissonConnection extends AbstractRedisConnection {
return new ScanCursor<byte[]>(0, options) {
private RedisClient client;
private Iterator<MasterSlaveEntry> entries = redisson.getConnectionManager().getEntrySet().iterator();
private Iterator<MasterSlaveEntry> entries = executorService.getConnectionManager().getEntrySet().iterator();
private MasterSlaveEntry entry = entries.next();
@Override
@ -1606,7 +1606,7 @@ public class RedissonConnection extends AbstractRedisConnection {
public void subscribe(MessageListener listener, byte[]... channels) {
checkSubscription();
subscription = new RedissonSubscription(executorService, redisson.getConnectionManager().getSubscribeService(), listener);
subscription = new RedissonSubscription(executorService, listener);
subscription.subscribe(channels);
}
@ -1627,7 +1627,7 @@ public class RedissonConnection extends AbstractRedisConnection {
public void pSubscribe(MessageListener listener, byte[]... patterns) {
checkSubscription();
subscription = new RedissonSubscription(executorService, redisson.getConnectionManager().getSubscribeService(), listener);
subscription = new RedissonSubscription(executorService, listener);
subscription.pSubscribe(patterns);
}

@ -42,10 +42,10 @@ public class RedissonSubscription extends AbstractSubscription {
private final CommandAsyncExecutor commandExecutor;
private final PublishSubscribeService subscribeService;
public RedissonSubscription(CommandAsyncExecutor commandExecutor, PublishSubscribeService subscribeService, MessageListener listener) {
public RedissonSubscription(CommandAsyncExecutor commandExecutor, MessageListener listener) {
super(listener, null, null);
this.commandExecutor = commandExecutor;
this.subscribeService = subscribeService;
this.subscribeService = commandExecutor.getConnectionManager().getSubscribeService();
}
@Override

Loading…
Cancel
Save