Package voldemort.store

Examples of voldemort.store.UnreachableStoreException


    @Test(expected = InsufficientOperationalNodesException.class)
    public void testConfigureNodesNotEnoughNodes() throws Exception {
        for(Node node: cluster.getNodes())
            failureDetector.recordException(node,
                                            0,
                                            new UnreachableStoreException("Test for "
                                                                          + getClass().getName()));

        RoutingStrategy routingStrategy = new RouteToAllStrategy(cluster.getNodes());
        GetAllPipelineData pipelineData = new GetAllPipelineData();
View Full Code Here


                                   writes,
                                   threads,
                                   failures,
                                   0,
                                   RoutingStrategyType.TO_ALL_STRATEGY,
                                   new UnreachableStoreException("no go"));
        } else {
            routedStore = customRoutedStore;
        }

        try {
View Full Code Here

                                                null,
                                                zoneReplicationFactor,
                                                RoutingStrategyType.ZONE_STRATEGY,
                                                0,
                                                BANNAGE_PERIOD,
                                                new UnreachableStoreException("no go"));

        testBasicOperationFailure(cluster.getNumberOfNodes() - 2,
                                  cluster.getNumberOfNodes() - 2,
                                  0,
                                  0,
View Full Code Here

                                                       9,
                                                       9,
                                                       9,
                                                       0,
                                                       RoutingStrategyType.TO_ALL_STRATEGY,
                                                       new UnreachableStoreException("no go"));
        try {
            s2.put(aKey, new Versioned<byte[]>(aValue), aTransform);
            fail("Failure is expected");
        } catch(InsufficientOperationalNodesException e) { /* expected */
        }
        assertOperationalNodes(0);

        // test get
        cluster = getNineNodeCluster();

        s1 = getStore(cluster,
                      1,
                      9,
                      9,
                      9,
                      0,
                      RoutingStrategyType.TO_ALL_STRATEGY,
                      new VoldemortException());
        try {
            s1.get(aKey, aTransform);
            fail("Failure is expected");
        } catch(InsufficientOperationalNodesException e) { /* expected */
        }
        assertOperationalNodes(9);

        cluster = getNineNodeCluster();

        s2 = getStore(cluster,
                      1,
                      9,
                      9,
                      9,
                      0,
                      RoutingStrategyType.TO_ALL_STRATEGY,
                      new UnreachableStoreException("no go"));
        try {
            s2.get(aKey, aTransform);
            fail("Failure is expected");
        } catch(InsufficientOperationalNodesException e) { /* expected */
        }
        assertOperationalNodes(0);

        // test delete
        cluster = getNineNodeCluster();

        s1 = getStore(cluster,
                      1,
                      9,
                      9,
                      9,
                      0,
                      RoutingStrategyType.TO_ALL_STRATEGY,
                      new VoldemortException());
        try {
            s1.delete(aKey, new VectorClock());
            fail("Failure is expected");
        } catch(InsufficientOperationalNodesException e) { /* expected */
        }
        assertOperationalNodes(9);

        cluster = getNineNodeCluster();

        s2 = getStore(cluster,
                      1,
                      9,
                      9,
                      9,
                      0,
                      RoutingStrategyType.TO_ALL_STRATEGY,
                      new UnreachableStoreException("no go"));
        try {
            s2.delete(aKey, new VectorClock());
            fail("Failure is expected");
        } catch(InsufficientOperationalNodesException e) { /* expected */
        }
View Full Code Here

    public void testCatastrophicErrors() throws Exception {
        Node node = Iterables.get(cluster.getNodes(), 8);

        failureDetector.recordException(node,
                                        0,
                                        new UnreachableStoreException("intentionalerror",
                                                                      new ConnectException("intentionalerror")));
        assertEquals(false, failureDetector.isAvailable(node));
        time.sleep(BANNAGE_MILLIS + 1);
        assertTrue(failureDetector.isAvailable(node));

        failureDetector.recordException(node,
                                        0,
                                        new UnreachableStoreException("intentionalerror",
                                                                      new UnknownHostException("intentionalerror")));
        assertEquals(false, failureDetector.isAvailable(node));
        time.sleep(BANNAGE_MILLIS + 1);
        assertTrue(failureDetector.isAvailable(node));

        failureDetector.recordException(node,
                                        0,
                                        new UnreachableStoreException("intentionalerror",
                                                                      new NoRouteToHostException("intentionalerror")));
        assertEquals(false, failureDetector.isAvailable(node));
        time.sleep(BANNAGE_MILLIS + 1);
        assertTrue(failureDetector.isAvailable(node));
    }
View Full Code Here

        strategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster);

        InMemoryStorageEngine<ByteArray, byte[], byte[]> inMemoryStorageEngine = new InMemoryStorageEngine<ByteArray, byte[], byte[]>(STORE_NAME);
        LoggingStore<ByteArray, byte[], byte[]> loggingStore = new LoggingStore<ByteArray, byte[], byte[]>(inMemoryStorageEngine);

        VoldemortException e = new UnreachableStoreException("Node down");
        ForceFailStore<ByteArray, byte[], byte[]> failureStore = new ForceFailStore<ByteArray, byte[], byte[]>(loggingStore,
                                                                                                               e);
        SleepyStore<ByteArray, byte[], byte[]> sleepyFailureStore = new SleepyStore<ByteArray, byte[], byte[]>(sleepBeforeFailingInMs,
                                                                                                               failureStore);
        failureStore.setFail(true);
View Full Code Here

        for(int i = 0; i < 1000; i++) {
            failureDetector.recordSuccess(node, 1);
        }

        UnreachableStoreException normalError = new UnreachableStoreException("intentionalerror");
        for(int i = 0; i < 10; i++) {
            failureDetector.recordException(node, 0, normalError);
        }
        assertAvailable(node);

        UnreachableStoreException catastrophicError = new UnreachableStoreException("intentionalerror",
                                                                                    new UnknownHostException("intentionalerror"));
        for(int i = 0; i < 10; i++) {
            failureDetector.recordException(node, 0, catastrophicError);
        }
View Full Code Here

        Node node = cluster.getNodeById(9);
        storeVerifier.addStore(node);
        for(int i = 0; i < 10; i++) {
            failureDetector.recordException(node,
                                            0,
                                            new UnreachableStoreException("intentionalerror",
                                                                          new UnknownHostException("intentionalerror")));
        }

        /**
         * Update the failure detector state with the new cluster
View Full Code Here

    }

    protected void updateNodeStoreAvailability(FailureDetectorConfig failureDetectorConfig,
                                               Node node,
                                               boolean shouldMarkAvailable) {
        UnreachableStoreException e = shouldMarkAvailable ? null
                                                         : new UnreachableStoreException("test error");
        ((MutableStoreVerifier) failureDetectorConfig.getStoreVerifier()).setErrorStore(node, e);
    }
View Full Code Here

                                                         new SlopSerializer(),
                                                         new IdentitySerializer()));
            // wrap original store with force fail store
            Store<ByteArray, byte[], byte[]> store = ss.getStoreRepository()
                                                       .removeLocalStore(STORE_NAME);
            UnreachableStoreException exception = new UnreachableStoreException("Force failed");
            ForceFailStore<ByteArray, byte[], byte[]> forceFailStore = new ForceFailStore<ByteArray, byte[], byte[]>(store,
                                                                                                                     exception);
            forceFailStores.put(nodeId, forceFailStore);
            ss.getStoreRepository().addLocalStore(forceFailStore);
        }
View Full Code Here

TOP

Related Classes of voldemort.store.UnreachableStoreException

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.