Search in sources :

Example 1 with Tuple3

use of akka.japi.tuple.Tuple3 in project torodb by torodb.

the class AkkaDbCloner method postInsertFold.

private Tuple3<Integer, Integer, Instant> postInsertFold(String toDb, String toCol, Tuple3<Integer, Integer, Instant> acum, Pair<Integer, Integer> newBatch) {
    Instant lastLogInstant = acum.t3();
    long now = clock.millis();
    long millisSinceLastLog = now - lastLogInstant.toEpochMilli();
    if (shouldLogCollectionCloning(millisSinceLastLog)) {
        logCollectionCloning(toDb, toCol, acum.t1(), acum.t2());
        lastLogInstant = Instant.ofEpochMilli(now);
    }
    return new Tuple3<>(acum.t1() + newBatch.first(), acum.t2() + newBatch.second(), lastLogInstant);
}
Also used : Instant(java.time.Instant) Tuple3(akka.japi.tuple.Tuple3)

Aggregations

Tuple3 (akka.japi.tuple.Tuple3)1 Instant (java.time.Instant)1