Package voldemort.store

Examples of voldemort.store.StoreDefinition


     * key
     */
    @Test
    public void testNoReadRepair() throws Exception {
        cluster = VoldemortTestConstants.getThreeNodeCluster();
        StoreDefinition storeDef = ServerTestUtils.getStoreDef("test",
                                                               3,
                                                               2,
                                                               1,
                                                               3,
                                                               2,
View Full Code Here


    }

    @Test
    public void testTardyResponsesNotIncludedInResult() throws Exception {
        cluster = VoldemortTestConstants.getThreeNodeCluster();
        StoreDefinition storeDef = ServerTestUtils.getStoreDef("test",
                                                               3,
                                                               3,
                                                               2,
                                                               3,
                                                               1,
View Full Code Here

    }

    @Test
    public void testSlowStoreDowngradesFromPreferredToRequired() throws Exception {
        cluster = VoldemortTestConstants.getThreeNodeCluster();
        StoreDefinition storeDef = ServerTestUtils.getStoreDef("test",
                                                               3,
                                                               3,
                                                               2,
                                                               3,
                                                               1,
View Full Code Here

            subStores.put(n.getId(), subStore);
        }

        setFailureDetector(subStores);
        StoreDefinition storeDef = ServerTestUtils.getStoreDef("test",
                                                               1,
                                                               1,
                                                               1,
                                                               1,
                                                               0,
View Full Code Here

        voldemortConfig.setBdbCacheSize(10 * 1024 * 1024);
        voldemortConfig.setBdbOneEnvPerStore(true);
        voldemortConfig.setBdbDataDirectory(bdbMasterDir.toURI().getPath());
        voldemortConfig.setBdbPrefixKeysWithPartitionId(true);
        bdbStorage = new BdbStorageConfiguration(voldemortConfig);
        StoreDefinition defA = TestUtils.makeStoreDefinition("storeA");
        store = (BdbStorageEngine) bdbStorage.getStore(defA,
                                                       (strategy = TestUtils.makeSingleNodeRoutingStrategy()));

        // load some data for non odd partitions, and note down how much data we
        // have for each partition.
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

        // Also get the adjusted store definitions, with the zone dropped
        Cluster finalCluster = RebalanceUtils.dropZone(interimCluster, dropZoneId);
        List<StoreDefinition> clippedStoreDefs = RebalanceUtils.dropZone(storeDefs, dropZoneId);

        for(StoreDefinition storeDef: clippedStoreDefs) {
            StoreDefinition orgStoreDef = StoreDefinitionUtils.getStoreDefinitionWithName(storeDefs,
                                                                                          storeDef.getName());
            assertFalse("Clipped storedef has replication for dropped zone",
                        storeDef.getZoneReplicationFactor().containsKey(dropZoneId));
            assertEquals("Clipped storedef has incorrect number of zones",
                         initialCluster.getZones().size() - 1,
                         storeDef.getZoneReplicationFactor().size());
            assertEquals("Clipped storedef has incorrect total repfactor",
                         orgStoreDef.getReplicationFactor()
                                 - orgStoreDef.getZoneReplicationFactor().get(dropZoneId),
                         storeDef.getReplicationFactor());
        }

        // Confirm that we would not route to any of the dropped nodes for any
        // store.
View Full Code Here

    @Before
    public void setup() throws IOException {
        storeDef = storeDefs.get(0);
        Integer zoneCountWrite = 1;
        // override
        storeDef = new StoreDefinition(storeDef.getName(),
                                       storeDef.getType(),
                                       storeDef.getDescription(),
                                       storeDef.getKeySerializer(),
                                       storeDef.getValueSerializer(),
                                       storeDef.getTransformsSerializer(),
View Full Code Here

    private static int LOOP_COUNT = 1000;

    public void testValidMetaData() {
        Cluster cluster = ServerTestUtils.getLocalCluster(3, new int[][] { { 0, 1, 2, 3 },
                { 4, 5, 6, 7 }, { 8, 9, 10, 11 } });
        StoreDefinition storeDef = ServerTestUtils.getStoreDefs(1).get(0);

        MetadataStore metadata = ServerTestUtils.createMetadataStore(cluster,
                                                                     Arrays.asList(storeDef));

        InvalidMetadataCheckingStore store = new InvalidMetadataCheckingStore(0,
                                                                              new DoNothingStore<ByteArray, byte[], byte[]>(storeDef.getName()),
                                                                              metadata);

        try {
            doOperations(0, store, metadata, storeDef);
        } catch(InvalidMetadataException e) {
View Full Code Here

    /**
     * NOTE: the total number of partitions should remain same for hash
     * consistency
     */
    public void testAddingPartition() {
        StoreDefinition storeDef = ServerTestUtils.getStoreDefs(1).get(0);

        Cluster cluster = ServerTestUtils.getLocalCluster(3, new int[][] { { 0, 1, 2, 3 },
                { 4, 5, 6, 7 }, { 8, 9, 10 } });

        MetadataStore metadata = ServerTestUtils.createMetadataStore(cluster,
                                                                     Arrays.asList(storeDef));

        InvalidMetadataCheckingStore store = new InvalidMetadataCheckingStore(0,
                                                                              new DoNothingStore<ByteArray, byte[], byte[]>(storeDef.getName()),
                                                                              metadata);
        try {
            // add partitions to node 0 on client side.
            Cluster updatedCluster = ServerTestUtils.getLocalCluster(3, new int[][] {
                    { 0, 1, 2, 3, 4, 5, 10 }, { 6, 7 }, { 8, 9 } });
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.