Package org.elasticsearch.hadoop

Examples of org.elasticsearch.hadoop.EsHadoopIllegalStateException


        try {
            ois = new ObjectInputStream(new FastByteArrayInputStream(rawData));
            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


    public static Writable availableShortWritable(short value) {
        if (SHORT_CTOR != null) {
            try {
                return SHORT_CTOR.newInstance(value);
            } catch (Exception e) {
                throw new EsHadoopIllegalStateException(e);
            }
        }
        return new IntWritable(value);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    public static <T> T getField(Field field, Object target) {
        try {
            return (T) field.get(target);
        } catch (IllegalAccessException ex) {
            throw new EsHadoopIllegalStateException("Unexpected reflection exception - " + ex.getClass().getName() + ": "+ ex.getMessage());
        }
    }
View Full Code Here

    public static void setField(Field field, Object target, Object value) {
        try {
            field.set(target, value);
        } catch (IllegalAccessException ex) {
            throw new EsHadoopIllegalStateException("Unexpected reflection exception - " + ex.getClass().getName() + ": "+ ex.getMessage());
        }
    }
View Full Code Here

*/
public class NoOpValueWriter implements ValueWriter<Object> {

    @Override
    public boolean write(Object object, Generator generator) {
        throw new EsHadoopIllegalStateException("Incorrect configuration - NoOpValueWriter should not have been called");
    }
View Full Code Here

public class NoOpFieldExtractor implements FieldExtractor {

    @Override
    public String field(Object target) {
        throw new EsHadoopIllegalStateException("Should not be called - indicates a configuration issue or a bug");
    }
View Full Code Here

        ClassLoader cl = (loader != null ? loader : ObjectUtils.class.getClassLoader());
        Class<?> clz = null;
        try {
            clz = cl.loadClass(className);
        } catch (ClassNotFoundException e) {
            throw new EsHadoopIllegalStateException(String.format("Cannot load class [%s]", className), e);
        }
        try {
            return (T) clz.newInstance();
        } catch (Exception ex) {
            throw new EsHadoopIllegalStateException(String.format("Cannot instantiate class [%s]", className), ex);
        }
    }
View Full Code Here

        try {
            object = pt.getTuple().get(0);
            type = pt.getTuple().getType(0);
        } catch (Exception ex) {
            throw new EsHadoopIllegalStateException("Encountered exception while processing tuple", ex);
        }


        if (type == DataType.BIGCHARARRAY || type == DataType.CHARARRAY) {
            to.bytes(object.toString());
View Full Code Here

                        }
                        else {
                            Assert.isTrue(false, String.format("Unsupported data type [%s] for field [%s]; use only 'primitives' or 'tuples'", DataType.findTypeName(type), getFieldName()));
                        }
                    } catch (ExecException ex) {
                        throw new EsHadoopIllegalStateException(String.format("Cannot retrieve field [%s]", getFieldName()), ex);
                    }
                }
            }
        }
View Full Code Here

        if (payload.length() > ba.available()) {
            if (autoFlush) {
                flush();
            }
            else {
                throw new EsHadoopIllegalStateException(
                        String.format("Auto-flush disabled and bulk buffer full; disable manual flush or increase capacity [current size %s]; bailing out", ba.capacity()));
            }
        }

        data.copyFrom(payload);
        payload.reset();

        dataEntries++;
        if (bufferEntriesThreshold > 0 && dataEntries >= bufferEntriesThreshold) {
            if (autoFlush) {
                flush();
            }
            else {
                // handle the corner case of manual flush that occurs only after the buffer is completely full (think size of 1)
                if (dataEntries > bufferEntriesThreshold) {
                    throw new EsHadoopIllegalStateException(
                            String.format(
                                    "Auto-flush disabled and maximum number of entries surpassed; disable manual flush or increase capacity [current size %s]; bailing out",
                                    bufferEntriesThreshold));
                }
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.EsHadoopIllegalStateException

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.