Package org.elasticsearch.hadoop.serialization

Examples of org.elasticsearch.hadoop.serialization.EsHadoopSerializationException


        ObjectOutputStream oos = null;
        try {
            oos = new ObjectOutputStream(baos);
            oos.writeObject(object);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException("Cannot serialize object " + object, ex);
        } finally {
            close(oos);
        }
        return DatatypeConverter.printBase64Binary(baos.bytes().bytes());
    }
View Full Code Here


            Object o = ois.readObject();
            return (T) o;
        } catch (ClassNotFoundException ex) {
            throw new EsHadoopIllegalStateException("cannot deserialize object", ex);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException("cannot deserialize object", ex);
        } finally {
            close(ois);
        }
    }
View Full Code Here

    }

    @SuppressWarnings("unchecked")
    public ContentBuilder value(Object value) {
        if (!writer.write(value, generator)) {
            throw new EsHadoopSerializationException(String.format("Cannot handle type [%s], instance [%s] using writer [%s]", value.getClass(), value, writer));
        }
        return this;
    }
View Full Code Here

    @Override
    public void writeBeginObject() {
        try {
            generator.writeStartObject();
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

    @Override
    public void writeEndObject() {
        try {
            generator.writeEndObject();
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

    @Override
    public void writeFieldName(String name) {
        try {
            generator.writeFieldName(name);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

    @Override
    public void writeString(String text) {
        try {
            generator.writeString(text);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

            }
            else {
                generator.writeString(new String(text, offset, len, StringUtils.UTF_8));
            }
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

    @Override
    public void writeBinary(byte[] data, int offset, int len) {
        try {
            generator.writeBinary(data, offset, len);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

    @Override
    public void writeNumber(int i) {
        try {
            generator.writeNumber(i);
        } catch (IOException ex) {
            throw new EsHadoopSerializationException(ex);
        }
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.serialization.EsHadoopSerializationException

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.