Java Code Examples for org.springframework.data.redis.connection.RedisClusterNode#getType()

The following examples show how to use org.springframework.data.redis.connection.RedisClusterNode#getType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 2
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 3
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 4
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 5
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 6
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 6 votes vote down vote up
@Test
public void testClusterGetNodes() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    assertThat(nodes).hasSize(6);
    for (RedisClusterNode redisClusterNode : nodes) {
        assertThat(redisClusterNode.getLinkState()).isNotNull();
        assertThat(redisClusterNode.getFlags()).isNotEmpty();
        assertThat(redisClusterNode.getHost()).isNotNull();
        assertThat(redisClusterNode.getPort()).isNotNull();
        assertThat(redisClusterNode.getId()).isNotNull();
        assertThat(redisClusterNode.getType()).isNotNull();
        if (redisClusterNode.getType() == NodeType.MASTER) {
            assertThat(redisClusterNode.getSlotRange().getSlots()).isNotEmpty();
        } else {
            assertThat(redisClusterNode.getMasterId()).isNotNull();
        }
    }
}
 
Example 7
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}
 
Example 8
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}
 
Example 9
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}
 
Example 10
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}
 
Example 11
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}
 
Example 12
Source File: RedissonClusterConnectionTest.java    From redisson with Apache License 2.0 5 votes vote down vote up
@Test
public void testClusterGetNodesMaster() {
    Iterable<RedisClusterNode> nodes = connection.clusterGetNodes();
    for (RedisClusterNode redisClusterNode : nodes) {
        if (redisClusterNode.getType() == NodeType.MASTER) {
            Collection<RedisClusterNode> slaves = connection.clusterGetSlaves(redisClusterNode);
            assertThat(slaves).hasSize(1);
        }
    }
}