Package org.elasticsearch.hadoop

Examples of org.elasticsearch.hadoop.EsHadoopIllegalStateException


            }

            try {
                batch = repository.scroll(scrollId, reader);
            } catch (IOException ex) {
                throw new EsHadoopIllegalStateException("Cannot retrieve scroll [" + scrollId + "]", ex);
            }
            read += batch.size();
            stats.docsReceived += batch.size();

            if (batch.isEmpty()) {
View Full Code Here


        @Override
        public InputStream copy() {
            try {
                return (reusable ? method.getResponseBodyAsStream() : null);
            } catch (IOException ex) {
                throw new EsHadoopIllegalStateException(ex);
            }
        }
View Full Code Here

    private SSLContext createSSLContext() {
        SSLContext ctx;
        try {
            ctx = SSLContext.getInstance(sslProtocol);
        } catch (NoSuchAlgorithmException ex) {
      throw new EsHadoopIllegalStateException("Cannot instantiate SSL - " + ex.getMessage(), ex);
        }
        try {
            ctx.init(loadKeyManagers(), loadTrustManagers(), null);
        } catch (Exception ex) {
      throw new EsHadoopIllegalStateException("Cannot initialize SSL - " + ex.getMessage(), ex);
        }

        return ctx;
    }
View Full Code Here

        schemaField = new ResourceFieldSchema();
        schemaField.setType(DataType.TUPLE);
        try {
            schemaField.setSchema(schema);
        } catch (IOException ex) {
            throw new EsHadoopIllegalStateException(String.format("Cannot use schema [%s]", schema), ex);
        }
    }
View Full Code Here

            List<Object> tuple = createTuple(next[1]);

            if (ackReads) {
                if (queueSize > 0) {
                    if (inTransitQueue.size() >= queueSize) {
                        throw new EsHadoopIllegalStateException(String.format("Ack-tuples queue has exceeded the specified size [%s]", inTransitQueue.size()));
                    }
                    inTransitQueue.put(next[0], next[1]);
                }

                collector.emit(tuple, next[0]);
View Full Code Here

        }

        int primitive = attempts.intValue();
        if (primitive == 0) {
            switch (tupleFailure) {
               case ABORT: throw new EsHadoopIllegalStateException(String.format("Tuple [%s] has failed to be fully processed after [%d] retries; aborting...", tuple, attempts));
               case WARN: log.warn(String.format("Tuple [%s] has failed to be fully processed after [%d] retries; aborting...", tuple, attempts));
               case IGNORE: // move on
            }
            return;
        }
View Full Code Here

    public void start() {
        try {
            pig = createPig();
        } catch (ExecException ex) {
            throw new EsHadoopIllegalStateException("Cannot create pig server", ex);
        }
        pig.setBatchOn();
    }
View Full Code Here

        pig.registerScript(new ByteArrayInputStream(script.getBytes()));
        try {
            List<ExecJob> executeBatch = pig.executeBatch();
            for (ExecJob execJob : executeBatch) {
                if (execJob.getStatus() == ExecJob.JOB_STATUS.FAILED) {
                    throw new EsHadoopIllegalStateException("Pig execution failed");
                }
            }
        } finally {
            pig.discardBatch();
            pig.setBatchOn();
View Full Code Here

        InitializationUtils.checkIdForOperation(settings);
        InitializationUtils.setFieldExtractorIfNotSet(settings, HiveFieldExtractor.class, log);
        try {
            InitializationUtils.discoverEsVersion(settings, log);
        } catch (IOException ex) {
            throw new EsHadoopIllegalStateException("Cannot discover Elasticsearch version", ex);
        }
    }
View Full Code Here

        try {
            InitializationUtils.discoverNodesIfNeeded(settings, log);
            InitializationUtils.discoverEsVersion(settings, log);
        } catch (IOException ex) {
            throw new EsHadoopIllegalStateException("Cannot discover Elasticsearch information", ex);
        }

        InitializationUtils.setValueWriterIfNotSet(settings, CascadingValueWriter.class, log);
        InitializationUtils.setValueReaderIfNotSet(settings, JdkValueReader.class, log);
        InitializationUtils.setBytesConverterIfNeeded(settings, CascadingLocalBytesConverter.class, log);
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.