Package voldemort.serialization

Examples of voldemort.serialization.SerializerDefinition


    @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)
                                                                 .setReplicationFactor(1)
                                                                 .setPreferredReads(1)
                                                                 .setRequiredReads(1)
View Full Code Here


        // 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)
                                                                 .setHintedHandoffStrategy(HintedHandoffStrategyType.PROXIMITY_STRATEGY)
                                                                 .setReplicationFactor(3)
                                                                 .setPreferredReads(3)
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)
                                                                 .setReplicationFactor(3)
                                                                 .setPreferredReads(3)
                                                                 .setRequiredReads(3)
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)
                                                                 .setReplicationFactor(3)
                                                                 .setPreferredReads(3)
                                                                 .setRequiredReads(3)
View Full Code Here

        // 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)
                                                                 .setHintedHandoffStrategy(HintedHandoffStrategyType.PROXIMITY_STRATEGY)
                                                                 .setReplicationFactor(3)
                                                                 .setPreferredReads(3)
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)
                                                                 .setReplicationFactor(3)
                                                                 .setPreferredReads(3)
                                                                 .setRequiredReads(3)
View Full Code Here

    @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)
                                                                           .setReplicationFactor(4)
                                                                           .setPreferredReads(1)
                                                                           .setRequiredReads(1)
View Full Code Here

                                                                TEST_STORE_NAME,
                                                                partitionIdList,
                                                                null,
                                                                false);

            final SerializerDefinition serializerDef = storeDef.getKeySerializer();
            final SerializerFactory serializerFactory = new DefaultSerializerFactory();
            @SuppressWarnings("unchecked")
            final Serializer<Object> serializer = (Serializer<Object>) serializerFactory.getSerializer(serializerDef);

            final CompressionStrategy keysCompressionStrategy;
            if(serializerDef != null && serializerDef.hasCompression()) {
                keysCompressionStrategy = new CompressionStrategyFactory().get(serializerDef.getCompression());
            } else {
                keysCompressionStrategy = null;
            }
            final Iterator<ByteArray> keyIterator = keyIteratorRef;
            while(keyIterator.hasNext()) {
View Full Code Here

                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(4)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
                                               .setKeySerializer(new SerializerDefinition("string"))
                                               .setValueSerializer(new SerializerDefinition("string"))
                                               .setPreferredReads(2)
                                               .setRequiredReads(1)
                                               .setPreferredWrites(1)
                                               .setRequiredWrites(1)
                                               .setZoneCountReads(0)
View Full Code Here

                                               .setType(InMemoryStorageConfiguration.TYPE_NAME)
                                               .setRoutingPolicy(RoutingTier.CLIENT)
                                               .setRoutingStrategyType(RoutingStrategyType.ZONE_STRATEGY)
                                               .setReplicationFactor(4)
                                               .setZoneReplicationFactor(zoneReplicationFactor)
                                               .setKeySerializer(new SerializerDefinition("string"))
                                               .setValueSerializer(new SerializerDefinition("string"))
                                               .setPreferredReads(1)
                                               .setRequiredReads(1)
                                               .setPreferredWrites(1)
                                               .setRequiredWrites(1)
                                               .setZoneCountReads(0)
View Full Code Here

TOP

Related Classes of voldemort.serialization.SerializerDefinition

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.