Examples of ByteArray


Examples of voldemort.utils.ByteArray

                                                            failureDetector,
                                                            createConfig(timeout));

        long start = System.nanoTime();
        try {
            routedStore.get(new ByteArray("test".getBytes()), null);
            fail("Should have thrown");
        } catch(InsufficientOperationalNodesException e) {
            long elapsed = (System.nanoTime() - start) / Time.NS_PER_MS;
            assertTrue(elapsed + " < " + totalDelay, elapsed < totalDelay);
        }
View Full Code Here

Examples of voldemort.utils.ByteArray

                                                            failureDetector,
                                                            createConfig(timeout));

        long start = System.nanoTime();
        try {
            routedStore.get(new ByteArray("test".getBytes()), null);
            fail("Should have thrown");
        } catch(InsufficientOperationalNodesException e) {
            long elapsed = (System.nanoTime() - start) / Time.NS_PER_MS;
            assertTrue(elapsed + " < " + totalDelay, elapsed < totalDelay);
        }

        start = System.nanoTime();
        try {
            routedStore.put(new ByteArray("test".getBytes()),
                            new Versioned<byte[]>(new byte[] { 1 }),
                            null);
            fail("Should have thrown");
        } catch(InsufficientOperationalNodesException e) {
            long elapsed = (System.nanoTime() - start) / Time.NS_PER_MS;
View Full Code Here

Examples of voldemort.utils.ByteArray

                                                            definition,
                                                            stores,
                                                            failureDetector,
                                                            createConfig(timeoutConfig));
        try {
            routedStore.put(new ByteArray("test".getBytes()),
                            new Versioned<byte[]>(new byte[] { 1 }),
                            null);
        } catch(InsufficientOperationalNodesException e) {
            fail("Should not have failed");
        }

        try {
            routedStore.get(new ByteArray("test".getBytes()), null);
            fail("Should have thrown");
        } catch(InsufficientOperationalNodesException e) {

        }
    }
View Full Code Here

Examples of voldemort.utils.ByteArray

                                                            storeDef,
                                                            subStores,
                                                            failureDetector,
                                                            createConfig(BANNAGE_PERIOD));

        ByteArray key1 = aKey;
        routedStore.put(key1, Versioned.value("value1".getBytes()), null);
        ByteArray key2 = TestUtils.toByteArray("voldemort");
        routedStore.put(key2, Versioned.value("value2".getBytes()), null);

        long putCount = statTrackingStore.getStats().getCount(Tracked.PUT);
        routedStore.getAll(Arrays.asList(key1, key2), null);
        /* Read repair happens asynchronously, so we wait a bit */
 
View Full Code Here

Examples of voldemort.utils.ByteArray

                                                                                             cluster);

        List<Node> nodesRoutedTo = routingStrategy.routeRequest("test".getBytes());
        long start = System.nanoTime(), elapsed;
        try {
            s1.put(new ByteArray("test".getBytes()), versioned, null);
        } finally {
            elapsed = (System.nanoTime() - start) / Time.NS_PER_MS;
            assertTrue(elapsed + " < " + SLEEPY_TIME, elapsed < SLEEPY_TIME);
        }

        Thread.sleep(SLEEPY_TIME - elapsed);

        for(Node node: nodesRoutedTo) {
            assertEquals(subStores.get(node.getId())
                                  .get(new ByteArray("test".getBytes()), null)
                                  .get(0), versioned);
        }

        // make sure the failure detector adds back any previously failed nodes
        Thread.sleep(BANNAGE_PERIOD + 100);
        start = System.nanoTime();
        try {
            s1.delete(new ByteArray("test".getBytes()), versioned.getVersion());
        } finally {
            elapsed = (System.nanoTime() - start) / Time.NS_PER_MS;
            assertTrue(elapsed + " < " + SLEEPY_TIME, elapsed < SLEEPY_TIME);
        }

        Thread.sleep(SLEEPY_TIME - elapsed);

        for(Node node: nodesRoutedTo) {
            assertEquals(subStores.get(node.getId())
                                  .get(new ByteArray("test".getBytes()), null)
                                  .size(), 0);
        }

    }
View Full Code Here

Examples of voldemort.utils.ByteArray

            String value = key;

            Versioned<byte[]> outputValue = Versioned.value(value.getBytes());
            // adminClient.streamingPut(new ByteArray(key.getBytes()),
            // outputValue);
            streamer.streamingPut(new ByteArray(key.getBytes()), outputValue);
        }
        streamer.commitToVoldemort();
        streamer.closeStreamingSession();
        assertEquals(verifyKeysExist(nodeIdOnWhichToVerifyKey), true);
View Full Code Here

Examples of voldemort.utils.ByteArray

            byte[] opCode = new byte[] { Slop.Operation.PUT.getOpCode() };
            byte[] spacer = new byte[] { (byte) 0 };
            byte[] storeNameBytes = ByteUtils.getBytes(STORE_NAME, "UTF-8");
            byte[] nodeIdBytes = new byte[ByteUtils.SIZE_OF_INT];
            ByteUtils.writeInt(nodeIdBytes, failingNodeId, 0);
            ByteArray slopKey = new ByteArray(ByteUtils.cat(opCode,
                                                            spacer,
                                                            storeNameBytes,
                                                            spacer,
                                                            nodeIdBytes,
                                                            spacer,
View Full Code Here

Examples of voldemort.utils.ByteArray

    public void testSlopOnDelayedFailingAsyncPut_2_1_1() {

        String key = "a";
        String val = "xyz";
        Versioned<byte[]> versionedVal = new Versioned<byte[]>(val.getBytes());
        ByteArray keyByteArray = new ByteArray(key.getBytes());
        List<Integer> failingNodeIdList = null;

        // Set the correct replication config
        REPLICATION_FACTOR = 2;
        P_READS = 1;
View Full Code Here

Examples of voldemort.utils.ByteArray

    public void testSlopOnDelayedFailingAsyncPut_3_2_2() {

        String key = "a";
        String val = "xyz";
        Versioned<byte[]> versionedVal = new Versioned<byte[]>(val.getBytes());
        ByteArray keyByteArray = new ByteArray(key.getBytes());
        List<Integer> failingNodeIdList = null;

        // Set the correct replication config
        REPLICATION_FACTOR = 3;
        P_READS = 2;
View Full Code Here

Examples of voldemort.utils.ByteArray

    public void testSlopViaSerialHint_2_1_1() {

        String key = "a";
        String val = "xyz";
        Versioned<byte[]> versionedVal = new Versioned<byte[]>(val.getBytes());
        ByteArray keyByteArray = new ByteArray(key.getBytes());
        List<Integer> failingNodeIdList = null;

        // Set the correct replication config
        REPLICATION_FACTOR = 2;
        P_READS = 1;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.