use of org.apache.gobblin.source.extractor.exception.HighWatermarkException in project incubator-gobblin by apache.
the class JdbcExtractor method getMaxWatermark.
@Override
public long getMaxWatermark(String schema, String entity, String watermarkColumn, List<Predicate> predicateList, String watermarkSourceFormat) throws HighWatermarkException {
this.log.info("Get high watermark using JDBC");
long calculatedHighWatermark = ConfigurationKeys.DEFAULT_WATERMARK_VALUE;
try {
List<Command> cmds = this.getHighWatermarkMetadata(schema, entity, watermarkColumn, predicateList);
CommandOutput<?, ?> response = this.executeSql(cmds);
calculatedHighWatermark = this.getHighWatermark(response, watermarkColumn, watermarkSourceFormat);
return calculatedHighWatermark;
} catch (Exception e) {
throw new HighWatermarkException("Failed to get high watermark using JDBC; error - " + e.getMessage(), e);
}
}
Aggregations