Package voldemort.routing

Examples of voldemort.routing.RoutingStrategyFactory


                                   StoreDefinition def,
                                   Store<ByteArray, byte[], byte[]> store,
                                   HashMap<Integer, List<Integer>> flattenedPresentTuples,
                                   HashMap<String, String> baselineTuples,
                                   HashMap<String, VectorClock> baselineVersions) {
        RoutingStrategy routing = new RoutingStrategyFactory().updateRoutingStrategy(def, cluster);

        for(Entry<String, String> entry: baselineTuples.entrySet()) {
            ByteArray keyBytes = new ByteArray(ByteUtils.getBytes(entry.getKey(), "UTF-8"));

            List<Integer> partitions = routing.getPartitionList(keyBytes.get());
View Full Code Here


                                                                      null,
                                                                      null,
                                                                      null,
                                                                      0);
            SlopStorageEngine slopEngine = new SlopStorageEngine(config.getStore(slopStoreDefinition,
                                                                                 new RoutingStrategyFactory().updateRoutingStrategy(slopStoreDefinition,
                                                                                                                                    metadata.getCluster())),
                                                                 metadata.getCluster());
            registerInternalEngine(slopEngine, false, "slop");
            storeRepository.setSlopStore(slopEngine);
View Full Code Here

            throw new ConfigurationException("Attempt to open store " + storeDef.getName()
                                             + " but " + storeDef.getType()
                                             + " storage engine has not been enabled.");

        boolean isReadOnly = storeDef.getType().compareTo(ReadOnlyStorageConfiguration.TYPE_NAME) == 0;
        final RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                                   metadata.getCluster());

        final StorageEngine<ByteArray, byte[], byte[]> engine = config.getStore(storeDef,
                                                                                routingStrategy);
        // Update the routing strategy + add listener to metadata
View Full Code Here

                                                                 StoreDefinition storeDef,
                                                                 int zoneId) {

            Map<Integer, List<Integer>> returnMap = Maps.newHashMap();

            RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                          cluster);
            List<Integer> restoringNodePartition = cluster.getNodeById(restoringNode)
                                                          .getPartitionIds();

            // Go over every partition. As long as one of them belongs to the
View Full Code Here

        this.readRepairer = new ReadRepairer<ByteArray, byte[]>();
        this.timeoutConfig = timeoutConfig;
        this.time = Utils.notNull(time);
        this.storeDef = storeDef;
        this.failureDetector = failureDetector;
        this.routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef, cluster);
    }
View Full Code Here

            List<Integer> secondaryPartitionsMoved = Lists.newArrayList(4, 5, 6, 7);

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

            RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef2,
                                                                                          currentCluster);
            for(Entry<ByteArray, byte[]> entry: entrySet.entrySet()) {
                storeClient1.put(new String(entry.getKey().get()), new String(entry.getValue()));
                storeClient2.put(new String(entry.getKey().get()), new String(entry.getValue()));
                List<Integer> pList = strategy.getPartitionList(entry.getKey().get());
View Full Code Here

            HashMap<ByteArray, byte[]> primaryEntriesMoved = Maps.newHashMap();
            HashMap<ByteArray, byte[]> secondaryEntriesMoved = Maps.newHashMap();
            HashMap<ByteArray, byte[]> tertiaryEntriesMoved = Maps.newHashMap();

            RoutingStrategy strategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef2,
                                                                                          currentCluster);
            for(Entry<ByteArray, byte[]> entry: entrySet.entrySet()) {
                storeClient1.put(new String(entry.getKey().get()), new String(entry.getValue()));
                storeClient2.put(new String(entry.getKey().get()), new String(entry.getValue()));
                List<Integer> pList = strategy.getPartitionList(entry.getKey().get());
View Full Code Here

            node = cluster.getNodeById(nodeId);
        } catch(VoldemortException e) {
            Utils.croak("Can't find a node with id " + nodeId);
        }

        RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDefinition,
                                                                                             cluster);
        try {
            new RequestFileFilter(storeDefinition,
                                  routingStrategy,
                                  inputFile,
View Full Code Here

     */
    public static RoutingStrategy makeSingleNodeRoutingStrategy() {
        Cluster cluster = VoldemortTestConstants.getOneNodeCluster();
        StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
        List<StoreDefinition> storeDefs = mapper.readStoreList(new StringReader(VoldemortTestConstants.getSingleStoreDefinitionsXml()));
        return new RoutingStrategyFactory().updateRoutingStrategy(storeDefs.get(0), cluster);
    }
View Full Code Here

                Utils.croak("No store found with name \"" + storeName + "\"");

            if(!outputDir.exists())
                Utils.croak("Directory \"" + outputDir.getAbsolutePath() + "\" does not exist.");

            RoutingStrategy routingStrategy = new RoutingStrategyFactory().updateRoutingStrategy(storeDef,
                                                                                                 cluster);

            new JsonStoreBuilder(reader,
                                 cluster,
                                 storeDef,
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.