Package voldemort.serialization

Examples of voldemort.serialization.SerializationException


                            l2 - LENGTH_BYTES);
    }

    public int compareBytes(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
        if(serializer == null)
            throw new SerializationException("No serializer has been set!");
        try {
            buffer.reset(b1, s1, l1);
            Object key1 = serializer.toObject(dataInput);

            buffer.reset(b2, s2, l2);
            Object key2 = serializer.toObject(dataInput);

            if(key1 instanceof Comparable) {
                return this.compareSerializedObjects(key1, key2);
            } else {
                return customCompare(key1, key2, serializer);
            }
        } catch(IOException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here


        try {
            clazz = (Class<T>) Class.forName(SerializationUtils.getJavaClassFromSchemaInfo(schemaInfo));
            if(!SpecificRecord.class.isAssignableFrom(clazz))
                throw new IllegalArgumentException("Class provided should implement SpecificRecord");
        } catch(ClassNotFoundException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here

        try {
            datumWriter = new SpecificDatumWriter<T>(clazz);
            datumWriter.write(object, encoder);
            encoder.flush();
        } catch(IOException e) {
            throw new SerializationException(e);
        } finally {
            SerializationUtils.close(output);
        }
        return output.toByteArray();
    }
View Full Code Here

        SpecificDatumReader<T> reader = null;
        try {
            reader = new SpecificDatumReader<T>(clazz);
            return reader.read(null, decoder);
        } catch(IOException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here

        try {
            datumWriter = new GenericDatumWriter<Object>(typeDef);
            datumWriter.write(object, encoder);
            encoder.flush();
        } catch(IOException e) {
            throw new SerializationException(e);
        } finally {
            SerializationUtils.close(output);
        }
        return output.toByteArray();
    }
View Full Code Here

        GenericDatumReader<Object> reader = null;
        try {
            reader = new GenericDatumReader<Object>(typeDef);
            return reader.read(null, decoder);
        } catch(IOException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public AvroReflectiveSerializer(String schemaInfo) {
        try {
            clazz = (Class<T>) Class.forName(SerializationUtils.getJavaClassFromSchemaInfo(schemaInfo));
        } catch(ClassNotFoundException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here

        try {
            datumWriter = new ReflectDatumWriter<T>(clazz);
            datumWriter.write(object, encoder);
            encoder.flush();
        } catch(IOException e) {
            throw new SerializationException(e);
        } finally {
            SerializationUtils.close(output);
        }
        return output.toByteArray();
    }
View Full Code Here

        ReflectDatumReader<T> reader = null;
        try {
            reader = new ReflectDatumReader<T>(clazz);
            return reader.read(null, decoder);
        } catch(IOException e) {
            throw new SerializationException(e);
        }
    }
View Full Code Here

            datumWriter.write(object, encoder);
            encoder.flush();
        } catch(SerializationException sE) {
            throw sE;
        } catch(IOException e) {
            throw new SerializationException(e);
        } catch(Exception aIOBE) {

            // probably the object sent to us was not created using the latest
            // schema
            // We simply check the old version number and serialize it using the
View Full Code Here

TOP

Related Classes of voldemort.serialization.SerializationException

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.