Examples of ExtractException


Examples of com.alibaba.otter.node.etl.extract.exceptions.ExtractException

            for (int i = 0; i < columnTypes.length; i++) {
                try {
                    String value = SqlUtils.sqlValueToString(rs, i + 1, columnTypes[i]);
                    result.add(value);
                } catch (Exception e) {
                    throw new ExtractException("ERROR ## get columnName has an error", e);
                }
            }
            return result;
        }
View Full Code Here

Examples of com.salesforce.dataloader.exception.ExtractException

                startWriteExtraction(size);
                writeExtraction();
                flushResults();
            }
        } catch (final ApiFault e) {
            throw new ExtractException(e.getExceptionMessage(), e);
        } catch (final ConnectionException e) {
            throw new ExtractException(e.getMessage(), e);
        } catch (final AsyncApiException e) {
            throw new ExtractException(e.getExceptionMessage(), e);
        }
    }
View Full Code Here

Examples of com.salesforce.dataloader.exception.ExtractException

                getRateCalculator(), false);
        jobUtil.createJob(getConfig());
        try {
            jobUtil.createBatch(new ByteArrayInputStream(soql.getBytes(Config.BULK_API_ENCODING)));
        } catch (final UnsupportedEncodingException e) {
            throw new ExtractException(e);
        }
        jobUtil.closeJob();
        final BatchInfo b = jobUtil.getBatches().getBatchInfo()[0];
        if (b.getState() == BatchStateEnum.Failed) throw new ExtractException("Batch failed: " + b.getStateMessage());
        this.batch = b;
        return b.getNumberRecordsProcessed();
    }
View Full Code Here

Examples of com.salesforce.dataloader.exception.ExtractException

    }

    @Override
    protected void writeExtraction() throws AsyncApiException, ExtractException, DataAccessObjectException {
        if (this.batch.getState() == BatchStateEnum.Failed)
            throw new ExtractException("Batch failed: " + this.batch.getStateMessage());
        final QueryResultList results = getController().getBulkClient().getClient()
                .getQueryResultList(this.batch.getJobId(), this.batch.getId());

        for (final String resultId : results.getResult()) {
            if (getProgressMonitor().isCanceled()) return;
            try {
                final InputStream resultStream = getController().getBulkClient().getClient()
                        .getQueryResultStream(this.batch.getJobId(), this.batch.getId(), resultId);
                try {
                    final CSVReader rdr = new CSVReader(resultStream, Config.BULK_API_ENCODING);
                    rdr.setMaxCharsInFile(Integer.MAX_VALUE);
                    rdr.setMaxRowsInFile(Integer.MAX_VALUE);
                    List<String> headers;
                    headers = rdr.nextRecord();
                    List<String> csvRow;
                    while ((csvRow = rdr.nextRecord()) != null) {
                        final StringBuilder id = new StringBuilder();
                        final Row daoRow = getDaoRow(headers, csvRow, id);
                        addResultRow(daoRow, id.toString());
                    }
                } finally {
                    resultStream.close();
                }
            } catch (final IOException e) {
                throw new ExtractException(e);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.