Search in sources :

Example 6 with RecordCountException

use of org.apache.gobblin.source.extractor.exception.RecordCountException in project incubator-gobblin by apache.

the class JdbcExtractor method getSourceCount.

@Override
public long getSourceCount(String schema, String entity, WorkUnit workUnit, List<Predicate> predicateList) throws RecordCountException {
    this.log.info("Get source record count using JDBC");
    long count = 0;
    try {
        List<Command> cmds = this.getCountMetadata(schema, entity, workUnit, predicateList);
        CommandOutput<?, ?> response = this.executeSql(cmds);
        count = this.getCount(response);
        this.log.info("Source record count:" + count);
        return count;
    } catch (Exception e) {
        throw new RecordCountException("Failed to get source record count using JDBC; error - " + e.getMessage(), e);
    }
}
Also used : RecordCountException(org.apache.gobblin.source.extractor.exception.RecordCountException) Command(org.apache.gobblin.source.extractor.extract.Command) ParseException(java.text.ParseException) RecordCountException(org.apache.gobblin.source.extractor.exception.RecordCountException) DataRecordException(org.apache.gobblin.source.extractor.DataRecordException) SqlParseException(org.apache.calcite.sql.parser.SqlParseException) SchemaException(org.apache.gobblin.source.extractor.exception.SchemaException) SQLException(java.sql.SQLException) IOException(java.io.IOException) HighWatermarkException(org.apache.gobblin.source.extractor.exception.HighWatermarkException)

Aggregations

IOException (java.io.IOException)6 DataRecordException (org.apache.gobblin.source.extractor.DataRecordException)6 HighWatermarkException (org.apache.gobblin.source.extractor.exception.HighWatermarkException)6 RecordCountException (org.apache.gobblin.source.extractor.exception.RecordCountException)6 SchemaException (org.apache.gobblin.source.extractor.exception.SchemaException)6 ParseException (java.text.ParseException)4 RestApiConnectionException (org.apache.gobblin.source.extractor.exception.RestApiConnectionException)3 AsyncApiException (com.sforce.async.AsyncApiException)2 SQLException (java.sql.SQLException)2 Iterator (java.util.Iterator)2 SqlParseException (org.apache.calcite.sql.parser.SqlParseException)2 RestApiClientException (org.apache.gobblin.source.extractor.exception.RestApiClientException)2 Command (org.apache.gobblin.source.extractor.extract.Command)2 JsonElement (com.google.gson.JsonElement)1 JsonObject (com.google.gson.JsonObject)1 ResultSet (java.sql.ResultSet)1 ListIterator (java.util.ListIterator)1 ExtractPrepareException (org.apache.gobblin.source.extractor.exception.ExtractPrepareException)1 RestApiProcessingException (org.apache.gobblin.source.extractor.exception.RestApiProcessingException)1 Predicate (org.apache.gobblin.source.extractor.watermark.Predicate)1