Search in sources :

Example 6 with DefaultSerializerFactory

use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.

the class ProtoBufSerializerTest method testGetSerializer.

public void testGetSerializer() {
    SerializerDefinition def = new SerializerDefinition("protobuf", "java=" + MessageStub.class.getName());
    Serializer<?> serializer = new DefaultSerializerFactory().getSerializer(def);
    assertEquals(ProtoBufSerializer.class, serializer.getClass());
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 7 with DefaultSerializerFactory

use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer6.

public void testGetSerializer6() {
    try {
        SerializerDefinition def = new SerializerDefinition("thrift", "java=" + MockMessage.class.getName() + ",protocol=bongus");
        new DefaultSerializerFactory().getSerializer(def);
    } catch (IllegalArgumentException e) {
        return;
    }
    fail("IllegalArgumentException should have been thrown for bogus Thrift protocol");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 8 with DefaultSerializerFactory

use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer3.

public void testGetSerializer3() {
    try {
        SerializerDefinition def = new SerializerDefinition("thrift", "protocol=json");
        new DefaultSerializerFactory().getSerializer(def);
    } catch (IllegalArgumentException e) {
        return;
    }
    fail("IllegalArgumentException should have been thrown for missing Thrift class");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 9 with DefaultSerializerFactory

use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer.

public void testGetSerializer() {
    SerializerDefinition def = new SerializerDefinition("thrift", "java=" + MockMessage.class.getName() + ", protocol=binary   ");
    Serializer<?> serializer = new DefaultSerializerFactory().getSerializer(def);
    assertEquals(ThriftSerializer.class, serializer.getClass());
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Example 10 with DefaultSerializerFactory

use of voldemort.serialization.DefaultSerializerFactory in project voldemort by voldemort.

the class ThriftSerializerTest method testGetSerializer5.

public void testGetSerializer5() {
    try {
        SerializerDefinition def = new SerializerDefinition("thrift", "java=com.abc.FooBar,protocol=simple-json");
        new DefaultSerializerFactory().getSerializer(def);
    } catch (IllegalArgumentException e) {
        return;
    }
    fail("IllegalArgumentException should have been thrown for non-existing Thrift class");
}
Also used : DefaultSerializerFactory(voldemort.serialization.DefaultSerializerFactory) SerializerDefinition(voldemort.serialization.SerializerDefinition)

Aggregations

DefaultSerializerFactory (voldemort.serialization.DefaultSerializerFactory)21 SerializerDefinition (voldemort.serialization.SerializerDefinition)15 Serializer (voldemort.serialization.Serializer)10 SerializerFactory (voldemort.serialization.SerializerFactory)8 StoreDefinition (voldemort.store.StoreDefinition)8 ByteArray (voldemort.utils.ByteArray)8 Node (voldemort.cluster.Node)7 IOException (java.io.IOException)6 CompressionStrategy (voldemort.store.compress.CompressionStrategy)6 CompressionStrategyFactory (voldemort.store.compress.CompressionStrategyFactory)6 File (java.io.File)5 Versioned (voldemort.versioning.Versioned)5 BufferedWriter (java.io.BufferedWriter)4 HashMap (java.util.HashMap)4 Map (java.util.Map)4 RoutingStrategyFactory (voldemort.routing.RoutingStrategyFactory)4 StringSerializer (voldemort.serialization.StringSerializer)4 Pair (voldemort.utils.Pair)4 ArrayList (java.util.ArrayList)3 VoldemortException (voldemort.VoldemortException)3