Package voldemort.store

Examples of voldemort.store.StoreDefinitionBuilder


        final String newStoreXMLFilePrefix = "updated.stores";
        final String newStoreXMLFileSuffix = "xml";

        List<StoreDefinition> newStoresToUpload = new ArrayList<StoreDefinition>();
        for(StoreDefinition storeDef: stores) {
            StoreDefinitionBuilder sb = AdminToolTestUtils.storeDefToBuilder(storeDef);
            sb.setName(sb.getName() + "_new");
            newStoresToUpload.add(sb.build());
        }

        // create file of new metadata
        File newStoresXMLFolder = TestUtils.createTempDir();
        File newStoreXMLFile = File.createTempFile(newStoreXMLFilePrefix,
View Full Code Here


     * Tests that getAll returns partial results
     */
    @Test
    public void testPartialGetAll() throws Exception {
        // create a store with rf=1 i.e disjoint partitions
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
View Full Code Here

        zoneReplicationFactor.put(2, 1);

        // Create a store with RF=3, Required reads = 3 and zone count reads = 2
        // This ensures that a GET operation requires a response from all 3
        // nodes (from the respective 3 zones)
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
View Full Code Here

    }

    @Test
    public void testPutTimeout() throws Exception {
        int timeout = 50;
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
View Full Code Here

    }

    @Test
    public void testGetTimeout() throws Exception {
        int timeout = 50;
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
View Full Code Here

        zoneReplicationFactor.put(2, 1);

        // Create a store with RF=3, Required reads = 3 and zone count reads = 2
        // This ensures that a GET operation requires a response from all 3
        // nodes (from the respective 3 zones)
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
View Full Code Here

        }
    }

    @Test
    public void testOperationSpecificTimeouts() throws Exception {
        StoreDefinition definition = new StoreDefinitionBuilder().setName("test")
                                                                 .setType("foo")
                                                                 .setKeySerializer(new SerializerDefinition("test"))
                                                                 .setValueSerializer(new SerializerDefinition("test"))
                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                 .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
View Full Code Here

        final String newStoreXMLFilePrefix = "updated.stores";
        final String newStoreXMLFileSuffix = "xml";

        List<StoreDefinition> newStores = new ArrayList<StoreDefinition>();
        for(StoreDefinition storeDef: ClusterTestUtils.getZZZStoreDefsInMemory()) {
            StoreDefinitionBuilder sb = storeDefToBuilder(storeDef);
            Map<Integer, Integer> zrf = sb.getZoneReplicationFactor();
            Integer zone0RepFactor = zrf.get(0);
            zrf.remove(0);
            sb.setReplicationFactor(sb.getReplicationFactor() - zone0RepFactor);
            newStores.add(sb.build());
        }

        File newStoresXMLFolder = TestUtils.createTempDir();
        File newStoreXMLFile = File.createTempFile(newStoreXMLFilePrefix,
                                                   newStoreXMLFileSuffix,
View Full Code Here

    }

    // This function is not a full implementation and should only used
    // in this test suite
    private StoreDefinitionBuilder storeDefToBuilder(StoreDefinition sd) {
        StoreDefinitionBuilder sb = new StoreDefinitionBuilder();
        sb.setName(sd.getName())
          .setDescription(sd.getDescription())
          .setType(sd.getType())
          .setRoutingPolicy(sd.getRoutingPolicy())
          .setRoutingStrategyType(sd.getRoutingStrategyType())
          .setKeySerializer(sd.getKeySerializer())
View Full Code Here

        this.storeDef = storeDef;
    }

    @Parameterized.Parameters
    public static Collection<Object[]> configs() {
        StoreDefinition storeDefConsistestStrategy = new StoreDefinitionBuilder().setName(TEST_STORE_NAME)
                                                                                 .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                                 .setKeySerializer(new SerializerDefinition("string"))
                                                                                 .setValueSerializer(new SerializerDefinition("string"))
                                                                                 .setRoutingPolicy(RoutingTier.CLIENT)
                                                                                 .setRoutingStrategyType(RoutingStrategyType.CONSISTENT_STRATEGY)
                                                                                 .setReplicationFactor(2)
                                                                                 .setPreferredReads(1)
                                                                                 .setRequiredReads(1)
                                                                                 .setPreferredWrites(2)
                                                                                 .setRequiredWrites(2)
                                                                                 .build();

        HashMap<Integer, Integer> zoneReplicationFactor = new HashMap<Integer, Integer>();
        zoneReplicationFactor.put(1, 2);
        zoneReplicationFactor.put(3, 2);
        StoreDefinition storeDefZoneStrategy = new StoreDefinitionBuilder().setName(TEST_STORE_NAME)
                                                                           .setType(BdbStorageConfiguration.TYPE_NAME)
                                                                           .setKeySerializer(new SerializerDefinition("string"))
                                                                           .setValueSerializer(new SerializerDefinition("string"))
                                                                           .setRoutingPolicy(RoutingTier.CLIENT)
                                                                           .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
View Full Code Here

TOP

Related Classes of voldemort.store.StoreDefinitionBuilder

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.