Search in sources :

Example 1 with JournalServerState

use of com.questdb.net.ha.model.JournalServerState in project questdb by bluestreak01.

the class JournalDeltaConsumer method createPartitions.

private void createPartitions(JournalServerState metadata) throws JournalException {
    int pc = journal.nonLagPartitionCount() - 1;
    for (int i = 0, k = metadata.getNonLagPartitionCount(); i < k; i++) {
        JournalServerState.PartitionMetadata partitionMetadata = metadata.getMeta(i);
        if (partitionMetadata.getPartitionIndex() > pc) {
            Interval interval = new Interval(partitionMetadata.getIntervalEnd(), partitionMetadata.getIntervalStart());
            journal.createPartition(interval, partitionMetadata.getPartitionIndex());
        }
    }
}
Also used : JournalServerState(com.questdb.net.ha.model.JournalServerState) Interval(com.questdb.std.time.Interval)

Aggregations

JournalServerState (com.questdb.net.ha.model.JournalServerState)1 Interval (com.questdb.std.time.Interval)1