use of com.walmartlabs.concord.server.jooq.tables.EventProcessorMarker in project concord by walmartlabs.
the class EventMarkerDao method get.
public EventMarker get(String processorName) {
EventProcessorMarker m = EVENT_PROCESSOR_MARKER.as("m");
Long currentEventSeq = txResult(tx -> tx.select(m.EVENT_SEQ).from(m).where(m.PROCESSOR_NAME.eq(processorName)).fetchOne(m.EVENT_SEQ));
Long maxEventSeq = txResult(tx -> tx.select(max(PROCESS_EVENTS.EVENT_SEQ)).from(PROCESS_EVENTS).fetchOne(Record1::value1));
return EventMarker.builder().eventSeq(currentEventSeq != null ? currentEventSeq : -1).maxEventSeq(maxEventSeq != null ? maxEventSeq : -1).build();
}
use of com.walmartlabs.concord.server.jooq.tables.EventProcessorMarker in project concord by walmartlabs.
the class EventMarkerDao method update.
public void update(DSLContext tx, String processorName, long eventSeq) {
EventProcessorMarker m = EVENT_PROCESSOR_MARKER.as("m");
tx.insertInto(m).columns(m.PROCESSOR_NAME, m.EVENT_SEQ).values(value(processorName), value(eventSeq)).onDuplicateKeyUpdate().set(m.EVENT_SEQ, eventSeq).where(m.PROCESSOR_NAME.eq(processorName)).execute();
}
use of com.walmartlabs.concord.server.jooq.tables.EventProcessorMarker in project concord by walmartlabs.
the class EventMarkerDao method get.
@WithTimer
public EventMarker get(String processorName) {
EventProcessorMarker m = Tables.EVENT_PROCESSOR_MARKER.as("m");
Long currentEventSeq = txResult(tx -> tx.select(m.EVENT_SEQ).from(m).where(m.PROCESSOR_NAME.eq(processorName)).fetchOne(m.EVENT_SEQ));
Long maxEventSeq = txResult(tx -> tx.select(max(PROCESS_EVENTS.EVENT_SEQ)).from(PROCESS_EVENTS).fetchOne(Record1::value1));
return EventMarker.builder().eventSeq(currentEventSeq != null ? currentEventSeq : -1).maxEventSeq(maxEventSeq != null ? maxEventSeq : -1).build();
}
use of com.walmartlabs.concord.server.jooq.tables.EventProcessorMarker in project concord by walmartlabs.
the class EventMarkerDao method update.
@WithTimer
public void update(DSLContext tx, String processorName, long eventSeq) {
EventProcessorMarker m = Tables.EVENT_PROCESSOR_MARKER.as("m");
tx.insertInto(m).columns(m.PROCESSOR_NAME, m.EVENT_SEQ).values(value(processorName), value(eventSeq)).onDuplicateKeyUpdate().set(m.EVENT_SEQ, eventSeq).where(m.PROCESSOR_NAME.eq(processorName)).execute();
}
Aggregations