Package org.voltdb.RateLimitedClientNotifier

Examples of org.voltdb.RateLimitedClientNotifier.Node


     * equal
     */
    @Test
    public void testNode() throws Exception {
        Supplier<DeferredSerialization> sup = getSupplier(null);
        Node n = new Node(sup, null);
        Node n2 = new Node(sup, null);
        Node diffSup = new Node(getSupplier(null), null);
        assertFalse(n.equals(null));
        assertTrue(n.equals(n2));
        assertEquals(n.hashCode(), n2.hashCode());
        assertTrue(n2.equals(n));
        assertTrue(n.equals(n));
        assertFalse(n.equals(diffSup));
        assertFalse(n.hashCode() == diffSup.hashCode());

        Supplier<DeferredSerialization> sup2 = getSupplier(null);
        Node n3 = new Node(sup2, n);
        assertFalse(n3.equals(n2));
        assertFalse(n3.hashCode() == n2.hashCode());
        Node n3_2 = new Node(sup2, n);

        Supplier<DeferredSerialization> sup3 = getSupplier(null);
        Node n4 = new Node(sup3, n3);
        Node n4_2 = new Node(sup3, n3_2);
        assertTrue(n4.equals(n4_2));
        assertTrue(n4.hashCode() == n4_2.hashCode());
    }
View Full Code Here


    Cache<Node, Node> cache =
            CacheBuilder.newBuilder()
                    .maximumSize(10000).concurrencyLevel(1).build();
    private Node getNode(Supplier<DeferredSerialization> s, Node n) throws Exception {
        Node node = new Node(s, n);
        return cache.get(node, node);
    }
View Full Code Here

     * Check caching postfixes of nodes works
     */
    @Test
    public void testNodeCaching() throws Exception {
        Supplier<DeferredSerialization> sup = getSupplier(null);
        Node n = getNode(sup, null);
        Node n2 = getNode(sup, null);
        Node diffSup = getNode(getSupplier(null), null);
        assertFalse(n.equals(null));
        assertTrue(n.equals(n2));
        assertEquals(n.hashCode(), n2.hashCode());
        assertTrue(n2.equals(n));
        assertTrue(n.equals(n));
        assertFalse(n.equals(diffSup));
        assertFalse(n.hashCode() == diffSup.hashCode());

        Supplier<DeferredSerialization> sup2 = getSupplier(null);
        Node n3 = getNode(sup2, n);
        assertFalse(n3.equals(n2));
        assertFalse(n3.hashCode() == n2.hashCode());
        Node n3_2 = getNode(sup2, n);

        Supplier<DeferredSerialization> sup3 = getSupplier(null);
        Node n4 = getNode(sup3, n3);
        Node n4_2 = getNode(sup3, n3_2);
        assertTrue(n4.equals(n4_2));
        assertTrue(n4.hashCode() == n4_2.hashCode());
        assertEquals(cache.size(), 4);
    }
View Full Code Here

TOP

Related Classes of org.voltdb.RateLimitedClientNotifier.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.