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);
}
}
Aggregations