Package voldemort.utils.ConsistencyCheck

Examples of voldemort.utils.ConsistencyCheck.KeyFetchTracker


    }

    @Test
    public void testKeyFetchTracker() {
        KeyFetchTracker tracker = new KeyFetchTracker(4);
        tracker.recordFetch(cn0_1, new ByteArray(value1));
        tracker.recordFetch(cn0_2, new ByteArray(value1));
        tracker.recordFetch(cn0_3, new ByteArray(value1));
        tracker.recordFetch(cn0_4, new ByteArray(value1));
        tracker.recordFetch(cn0_1, new ByteArray(value2));
        tracker.recordFetch(cn0_2, new ByteArray(value2));
        tracker.recordFetch(cn0_3, new ByteArray(value2));
        assertNull(tracker.nextFinished());
        tracker.recordFetch(cn0_4, new ByteArray(value2));
        assertEquals(new ByteArray(value1), tracker.nextFinished());
        assertNull(tracker.nextFinished());
        // multiple fetch on same node same key
        tracker.recordFetch(cn0_1, new ByteArray(value3));
        tracker.recordFetch(cn0_2, new ByteArray(value3));
        tracker.recordFetch(cn0_3, new ByteArray(value3));
        tracker.recordFetch(cn0_4, new ByteArray(value3));
        tracker.recordFetch(cn0_4, new ByteArray(value3));
        tracker.recordFetch(cn0_4, new ByteArray(value3));
        assertEquals(new ByteArray(value2), tracker.nextFinished());

        tracker.recordFetch(cn0_1, new ByteArray(value4));
        tracker.recordFetch(cn0_2, new ByteArray(value4));
        tracker.recordFetch(cn0_3, new ByteArray(value4));

        assertNull(tracker.nextFinished());

        tracker.finishAll();
        assertEquals(new ByteArray(value3), tracker.nextFinished());
        assertEquals(new ByteArray(value4), tracker.nextFinished());
        assertNull(tracker.nextFinished());
    }
View Full Code Here

TOP

Related Classes of voldemort.utils.ConsistencyCheck.KeyFetchTracker

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.