Package org.elasticsearch.hadoop

Examples of org.elasticsearch.hadoop.EsHadoopIllegalArgumentException


        }
    }

    public Tap createTap(Scheme scheme, String path, SinkMode sinkMode, Properties properties) {
        if (!(scheme instanceof EsScheme)) {
            throw new EsHadoopIllegalArgumentException("Unknown scheme; expected " + EsScheme.class.getName());
        }

        String host = properties.getProperty("host");
        String portString = properties.getProperty("port");
        int port = (StringUtils.hasText(portString) ? Integer.parseInt(portString) : -1);
View Full Code Here


    @SuppressWarnings("unchecked")
    public static <T> T invoke(Method method, Object target, Object...args) {
        try {
            return (T) method.invoke(target, args);
        } catch (Exception ex) {
            throw new EsHadoopIllegalArgumentException("Cannot invoke method " + method, ex);
        }
    }
View Full Code Here

    public static String encodeUri(String uri) {
        try {
            return URIUtil.encodePathQuery(uri);
        } catch (URIException ex) {
            throw new EsHadoopIllegalArgumentException("Cannot escape uri" + uri);
        }
    }
View Full Code Here

    public static String encodePath(String path) {
        try {
            return URIUtil.encodePath(path, "UTF-8");
        } catch (URIException ex) {
            throw new EsHadoopIllegalArgumentException("Cannot encode path" + path, ex);
        }
    }
View Full Code Here

    public static String encodeQuery(String query) {
        try {
            return URLEncoder.encode(query, "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            throw new EsHadoopIllegalArgumentException("Cannot encode path" + query, ex);
        }
    }
View Full Code Here

    public static String decodeQuery(String query) {
        try {
            return URLDecoder.decode(query, "UTF-8");
        } catch (UnsupportedEncodingException ex) {
            throw new EsHadoopIllegalArgumentException("Cannot encode path" + query, ex);
        }
    }
View Full Code Here

    static int oversize(int minTargetSize, int bytesPerElement) {

        if (minTargetSize < 0) {
            // catch usage that accidentally overflows int
            throw new EsHadoopIllegalArgumentException("invalid array size " + minTargetSize);
        }

        if (minTargetSize == 0) {
            // wait until at least one element is requested
            return 0;
View Full Code Here

        }
        else if (ConfigurationOptions.ES_OPERATION_UPSERT.equals(operation)) {
            factory = new UpdateBulkFactory(settings, true);
        }
        else {
            throw new EsHadoopIllegalArgumentException("Unknown operation " + operation);
        }

        return factory.createBulk();
    }
View Full Code Here

            pool.reset();

            Object value = extractor.field(object);
            if (value == FieldExtractor.NOT_FOUND) {
                String obj = (extractor instanceof FieldExplainer ? ((FieldExplainer) extractor).toString(object) : object.toString());
                throw new EsHadoopIllegalArgumentException(String.format("[%s] cannot extract value from entity [%s] | instance [%s]", extractor, obj.getClass(), obj));
            }

            if (value instanceof List) {
                List list = (List) value;
                for (int i = 0; i < list.size() - 1; i++) {
View Full Code Here

    private void append(StringBuilder sb, List<Object> list, Object target) {
        for (Object object : list) {
            if (object instanceof FieldExtractor) {
                Object field = ((FieldExtractor) object).field(target);
                if (field == NOT_FOUND) {
                    throw new EsHadoopIllegalArgumentException(String.format("Cannot find match for %s", pattern));
                }
                else {
                    sb.append(field);
                }
            }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.EsHadoopIllegalArgumentException

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.