Package voldemort.store

Examples of voldemort.store.StoreDefinition


        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
        zoneRep322.put(0, 3);
        zoneRep322.put(1, 3);
        StoreDefinition storeDef322 = new StoreDefinitionBuilder().setName("ZZ322")
                                                                  .setType(storageType)
                                                                  .setRoutingPolicy(RoutingTier.CLIENT)
                                                                  .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                  .setKeySerializer(new SerializerDefinition("string"))
                                                                  .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here


        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
        zoneRep322.put(0, 3);
        zoneRep322.put(2, 3);
        StoreDefinition storeDef322 = new StoreDefinitionBuilder().setName("ZZ322")
                                                                  .setType(storageType)
                                                                  .setRoutingPolicy(RoutingTier.CLIENT)
                                                                  .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                  .setKeySerializer(new SerializerDefinition("string"))
                                                                  .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here

        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        HashMap<Integer, Integer> zoneRep111 = new HashMap<Integer, Integer>();
        zoneRep111.put(0, 1);
        zoneRep111.put(1, 1);
        zoneRep111.put(2, 1);
        StoreDefinition storeDef111 = new StoreDefinitionBuilder().setName("ZZ111")
                                                                  .setType(storageType)
                                                                  .setRoutingPolicy(RoutingTier.CLIENT)
                                                                  .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                  .setKeySerializer(new SerializerDefinition("string"))
                                                                  .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here

        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        HashMap<Integer, Integer> zoneRep211 = new HashMap<Integer, Integer>();
        zoneRep211.put(0, 2);
        zoneRep211.put(1, 2);
        zoneRep211.put(2, 2);
        StoreDefinition storeDef211 = new StoreDefinitionBuilder().setName("ZZ211")
                                                                  .setType(storageType)
                                                                  .setRoutingPolicy(RoutingTier.CLIENT)
                                                                  .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                  .setKeySerializer(new SerializerDefinition("string"))
                                                                  .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here

        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        HashMap<Integer, Integer> zoneRep322 = new HashMap<Integer, Integer>();
        zoneRep322.put(0, 3);
        zoneRep322.put(1, 3);
        zoneRep322.put(2, 3);
        StoreDefinition storeDef322 = new StoreDefinitionBuilder().setName("ZZ322")
                                                                  .setType(storageType)
                                                                  .setRoutingPolicy(RoutingTier.CLIENT)
                                                                  .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                                  .setKeySerializer(new SerializerDefinition("string"))
                                                                  .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here

        List<StoreDefinition> storeDefs = new LinkedList<StoreDefinition>();
        int totalReplicationFactor = 0;
        for (Integer value : zoneRep.values()) {
            totalReplicationFactor += value;
        }
        StoreDefinition storeDef = new StoreDefinitionBuilder().setName(storeName)
                                                               .setType(storageType)
                                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                                               .setKeySerializer(new SerializerDefinition("string"))
                                                               .setValueSerializer(new SerializerDefinition("string"))
View Full Code Here

            oldMd5ToNewMd5.put(new ByteArray(oldMd5), currentMd5);
            entryId++;
        }
        FileUtils.writeStringToFile(inputFile, contents.toString());

        StoreDefinition def = new StoreDefinitionBuilder().setName(storeName)
                                                          .setType(ReadOnlyStorageConfiguration.TYPE_NAME)
                                                          .setKeySerializer(serDef)
                                                          .setValueSerializer(serDef)
                                                          .setRoutingPolicy(RoutingTier.CLIENT)
                                                          .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
View Full Code Here

            String storeName = storeDef.getName();
            storeNamesUnion.add(storeName);
            newStoreDefinitionMap.put(storeName, storeDef);
        }
        for(String storeName: storeNamesUnion) {
            StoreDefinition oldStoreDef = oldStoreDefinitionMap.get(storeName);
            StoreDefinition newStoreDef = newStoreDefinitionMap.get(storeName);
            if(oldStoreDef == null && newStoreDef != null || oldStoreDef != null
               && newStoreDef == null || oldStoreDef != null && newStoreDef != null
               && !oldStoreDef.equals(newStoreDef)) {
                storesChanged.add(storeName);
            }
View Full Code Here

            for(Node node: adminClient.getAdminClientCluster().getNodes()) {
                partitionIdList.addAll(node.getPartitionIds());
            }
        }

        StoreDefinition storeDefinition = null;
        for(String store: stores) {
            storeDefinition = storeDefinitionMap.get(store);

            if(null == storeDefinition) {

                System.out.println("No store found under the name \'" + store + "\'");
                continue;
            }

            Iterator<Pair<ByteArray, Versioned<byte[]>>> entriesIteratorRef = null;
            if(fetchOrphaned) {
                System.out.println("Fetching orphaned entries of " + store);
                entriesIteratorRef = adminClient.bulkFetchOps.fetchOrphanedEntries(nodeId, store);
            } else {
                System.out.println("Fetching entries in partitions "
                                   + Joiner.on(", ").join(partitionIdList) + " of " + store);
                entriesIteratorRef = adminClient.bulkFetchOps.fetchEntries(nodeId,
                                                                           store,
                                                                           partitionIdList,
                                                                           null,
                                                                           false);
            }

            final Iterator<Pair<ByteArray, Versioned<byte[]>>> entriesIterator = entriesIteratorRef;
            File outputFile = null;
            if(directory != null) {
                outputFile = new File(directory, store + ".entries");
            }

            if(useAscii) {
                // k-v serializer
                SerializerDefinition keySerializerDef = storeDefinition.getKeySerializer();
                SerializerDefinition valueSerializerDef = storeDefinition.getValueSerializer();
                SerializerFactory serializerFactory = new DefaultSerializerFactory();
                @SuppressWarnings("unchecked")
                final Serializer<Object> keySerializer = (Serializer<Object>) serializerFactory.getSerializer(keySerializerDef);
                @SuppressWarnings("unchecked")
                final Serializer<Object> valueSerializer = (Serializer<Object>) serializerFactory.getSerializer(valueSerializerDef);
View Full Code Here

            for(Node node: adminClient.getAdminClientCluster().getNodes()) {
                partitionIdList.addAll(node.getPartitionIds());
            }
        }

        StoreDefinition storeDefinition = null;
        for(String store: stores) {
            storeDefinition = storeDefinitionMap.get(store);

            if(null == storeDefinition) {
                System.out.println("No store found under the name \'" + store + "\'");
                continue;
            }

            Iterator<ByteArray> keyIteratorRef = null;
            if(fetchOrphaned) {
                System.out.println("Fetching orphaned keys  of " + store);
                keyIteratorRef = adminClient.bulkFetchOps.fetchOrphanedKeys(nodeId, store);
            } else {
                System.out.println("Fetching keys in partitions "
                                   + Joiner.on(", ").join(partitionIdList) + " of " + store);
                keyIteratorRef = adminClient.bulkFetchOps.fetchKeys(nodeId,
                                                                    store,
                                                                    partitionIdList,
                                                                    null,
                                                                    false);
            }
            File outputFile = null;
            if(directory != null) {
                outputFile = new File(directory, store + ".keys");
            }
            final Iterator<ByteArray> keyIterator = keyIteratorRef;
            if(useAscii) {
                final SerializerDefinition serializerDef = storeDefinition.getKeySerializer();
                final SerializerFactory serializerFactory = new DefaultSerializerFactory();
                @SuppressWarnings("unchecked")
                final Serializer<Object> serializer = (Serializer<Object>) serializerFactory.getSerializer(serializerDef);

                final CompressionStrategy keysCompressionStrategy;
View Full Code Here

TOP

Related Classes of voldemort.store.StoreDefinition

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.