Package voldemort.routing

Examples of voldemort.routing.RoutingStrategyFactory


        fetcher.fetch(nodeFile.getAbsolutePath(), versionDir.getAbsolutePath());

        // Test if we work in the normal collision scenario open store
        ReadOnlyStorageEngine engine = new ReadOnlyStorageEngine(storeName,
                                                                 new CustomBinarySearchStrategy(),
                                                                 new RoutingStrategyFactory().updateRoutingStrategy(def,
                                                                                                                    cluster),
                                                                 0,
                                                                 storeDir,
                                                                 1);
        Store<Object, Object, Object> store = SerializingStore.wrap(engine,
View Full Code Here


     */

    public static Map<Integer, Set<Pair<Integer, Integer>>> getNodeIdToAllPartitions(final Cluster cluster,
                                                                                     final StoreDefinition storeDef,
                                                                                     boolean includePrimary) {
        final RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                                   cluster);

        final Map<Integer, Set<Pair<Integer, Integer>>> nodeIdToReplicas = new HashMap<Integer, Set<Pair<Integer, Integer>>>();
        final Map<Integer, Integer> partitionToNodeIdMap = cluster.getPartitionIdToNodeIdMap();

View Full Code Here

                break;
            }
        }
        assertNotNull("No such store found: " + STORE_NAME, storeDefinition);

        RoutingStrategy router = new RoutingStrategyFactory().updateRoutingStrategy(storeDefinition,
                                                                                    cluster);
        while(keysHashedToPar0.size() < 7) {
            // generate random key
            Map<ByteArray, byte[]> map = ServerTestUtils.createRandomKeyValuePairs(1);
            ByteArray key = map.keySet().iterator().next();
View Full Code Here

        assertEquals(consistentStore.getName(), "cstore");
        assertEquals(zoneStore.getName(), "zstore");

        Cluster cluster = VoldemortTestConstants.getEightNodeClusterWithZones();
        RoutingStrategy cStrategy = new RoutingStrategyFactory().updateRoutingStrategy(consistentStore,
                                                                                       cluster);
        RoutingStrategy zStrategy = new RoutingStrategyFactory().updateRoutingStrategy(zoneStore,
                                                                                       cluster);
        BdbStorageEngine cPrefixedBdbStore = (BdbStorageEngine) bdbStorage.getStore(consistentStore,
                                                                                    cStrategy);
        BdbStorageEngine zPrefixedBdbStore = (BdbStorageEngine) bdbStorage.getStore(zoneStore,
                                                                                    zStrategy);
View Full Code Here

                                                                                                                     exception);
            forceFailStores.put(nodeId, forceFailStore);
            ss.getStoreRepository().addLocalStore(forceFailStore);
        }

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

        // create client socket stores and slop stores
        SocketStoreClientFactoryForTest clientSocketStoreFactory = new SocketStoreClientFactoryForTest(STORE_NAME,
                                                                                                       SLOP_STORE_NAME);
        Serializer<ByteArray> slopKeySerializer = new ByteArraySerializer();
View Full Code Here

                break;
            default:
                throw new VoldemortException("Unsupported storage format type");

        }
        this.routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster);
    }
View Full Code Here

        this.primaryEntriesMoved = Maps.newHashMap();
        this.secondaryEntriesMoved = Maps.newHashMap();
        this.proxyPutTestPrimaryEntries = Maps.newHashMap();
        this.proxyPutTestSecondaryEntries = Maps.newHashMap();

        RoutingStrategy strategy = new
                RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                               currentCluster);
        for(Entry<ByteArray, byte[]> entry: entrySet.entrySet()) {
            storeClient.put(new String(entry.getKey().get()), new
                            String(entry.getValue()));
View Full Code Here

                                                               .setPreferredReads(1)
                                                               .setRequiredReads(1)
                                                               .setPreferredWrites(1)
                                                               .setRequiredWrites(1)
                                                               .build();
        RoutingStrategy router = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                    cluster);

        // build store files in outputDir
        File outputDir = TestUtils.createTempDir(baseDir);
        JsonStoreBuilder storeBuilder = new JsonStoreBuilder(reader,
View Full Code Here

        Cluster targetCluster = UpdateClusterUtils.createUpdatedCluster(cluster, 1, primaryMoved);

        HashMap<ByteArray, byte[]> keysMovedWith0AsSecondary = Maps.newHashMap();

        // insert it into server-0 store
        RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(StoreDefinitionUtils.getStoreDefinitionWithName(storeDefs,
                                                                                                                                      "test-recovery-data"),
                                                                                      cluster);

        Store<ByteArray, byte[], byte[]> store0 = getStore(0, "test-recovery-data");
        Store<ByteArray, byte[], byte[]> store1 = getStore(1, "test-recovery-data");
View Full Code Here

            }
        }
        if(storeDef == null) {
            throw new VoldemortException("StoreNotfound: " + storeName);
        }
        RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster);

        Properties properties = new Properties();
        properties.put("node.id","0");
        properties.put("voldemort.home",storeBdbFolder.getParent());
        VoldemortConfig voldemortConfig = new VoldemortConfig(properties);
View Full Code Here

TOP

Related Classes of voldemort.routing.RoutingStrategyFactory

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.