RedisClusterNodes added

pull/555/head
Nikita 9 years ago
parent b1c519c07a
commit 4a519b71b5

@ -0,0 +1,28 @@
/**
* Copyright 2016 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson;
import org.redisson.connection.ConnectionManager;
import org.redisson.core.ClusterNode;
import org.redisson.core.ClusterNodesGroup;
public class RedisClusterNodes extends RedisNodes<ClusterNode> implements ClusterNodesGroup {
public RedisClusterNodes(ConnectionManager connectionManager) {
super(connectionManager);
}
}

@ -37,7 +37,7 @@ import org.redisson.connection.ElasticacheConnectionManager;
import org.redisson.connection.MasterSlaveConnectionManager;
import org.redisson.connection.SentinelConnectionManager;
import org.redisson.connection.SingleConnectionManager;
import org.redisson.core.ClusterNode;
import org.redisson.core.ClusterNodesGroup;
import org.redisson.core.Node;
import org.redisson.core.NodesGroup;
import org.redisson.core.RAtomicDouble;
@ -563,11 +563,11 @@ public class Redisson implements RedissonClient {
}
@Override
public NodesGroup<ClusterNode> getClusterNodesGroup() {
public ClusterNodesGroup getClusterNodesGroup() {
if (!config.isClusterConfig()) {
throw new IllegalStateException("Redisson is not in cluster mode!");
}
return new RedisNodes<ClusterNode>(connectionManager);
return new RedisClusterNodes(connectionManager);
}
@Override

@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
import org.redisson.client.codec.Codec;
import org.redisson.core.ClusterNode;
import org.redisson.core.ClusterNodesGroup;
import org.redisson.core.Node;
import org.redisson.core.NodesGroup;
import org.redisson.core.RAtomicDouble;
@ -697,7 +698,7 @@ public interface RedissonClient {
*
* @return
*/
NodesGroup<ClusterNode> getClusterNodesGroup();
ClusterNodesGroup getClusterNodesGroup();
/**
* Returns {@code true} if this Redisson instance has been shut down.

@ -0,0 +1,20 @@
/**
* Copyright 2016 Nikita Koksharov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.redisson.core;
public interface ClusterNodesGroup extends NodesGroup<ClusterNode> {
}
Loading…
Cancel
Save