refactoring

pull/1423/head
Nikita 7 years ago
parent 5eaab6e37f
commit 20323d8132

@ -219,6 +219,23 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
this.commandExecutor = new CommandSyncService(this);
}
/*
* Remove it once https://github.com/netty/netty/issues/7882 get resolved
*/
protected DnsAddressResolverGroup createResolverGroup() {
if (cfg.getTransportMode() == TransportMode.EPOLL) {
return cfg.getAddressResolverGroupFactory().create(EpollDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
} else if (cfg.getTransportMode() == TransportMode.KQUEUE) {
return cfg.getAddressResolverGroupFactory().create(KQueueDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
}
return cfg.getAddressResolverGroupFactory().create(NioDatagramChannel.class, DnsServerAddressStreamProviders.platformDefault());
}
public SlotGenerator getSlotGenerator() {
return slotGenerator;
}
protected void closeNodeConnections() {
List<RFuture<Void>> futures = new ArrayList<RFuture<Void>>();
for (RedisConnection connection : nodeConnections.values()) {

@ -346,6 +346,10 @@ public class MasterSlaveEntry {
return addSlave(client, freezed, nodeType);
}
public ClientConnectionsEntry getSlaveEntry(RedisClient client) {
return slaveBalancer.getEntry(client);
}
public Collection<ClientConnectionsEntry> getSlaveEntries() {
List<ClientConnectionsEntry> result = new ArrayList<ClientConnectionsEntry>();
for (ClientConnectionsEntry slaveEntry : slaveBalancer.getEntries()) {

@ -222,8 +222,7 @@ public class LoadBalancerManager {
return null;
}
protected ClientConnectionsEntry getEntry(RedisClient redisClient) {
public ClientConnectionsEntry getEntry(RedisClient redisClient) {
return client2Entry.get(redisClient);
}

Loading…
Cancel
Save