Example usage for java.time LocalDateTime minusSeconds

List of usage examples for java.time LocalDateTime minusSeconds

Introduction

In this page you can find the example usage for java.time LocalDateTime minusSeconds.

Prototype

public LocalDateTime minusSeconds(long seconds) 

Source Link

Document

Returns a copy of this LocalDateTime with the specified number of seconds subtracted.

Usage

From source file:com.streamsets.pipeline.stage.origin.jdbc.cdc.oracle.OracleCDCSource.java

private LocalDateTime adjustStartTime(LocalDateTime startTime) {
    return useLocalBuffering ? startTime : startTime.minusSeconds(configBean.txnWindow);
}

From source file:com.streamsets.pipeline.stage.origin.jdbc.cdc.oracle.OracleCDCSource.java

/**
 * An element is "expired" if the transaction started before the current window being processed
 * and if no records have actually been sent to the pipeline. If a record has been sent, then a commit was seen,
 * so it is not expired./*from  w  ww  . j  ava  2 s . c o m*/
 * @param entry
 * @return
 */
private boolean expired(Map.Entry<TransactionIdKey, HashQueue<RecordSequence>> entry, LocalDateTime startTime) {
    return startTime != null && // Can be null if starting from SCN and first batch is not complete yet.
            entry.getKey().txnStartTime.isBefore(startTime.minusSeconds(configBean.txnWindow))
            && entry.getValue().peek().seq == 1;
}