use of com.questdb.store.Journal in project questdb by bluestreak01.
the class JournalServerAgent method createReader.
private <T> void createReader(int index, JournalKey<T> key) throws JournalException {
Journal journal = readers.getQuiet(index);
if (journal == null) {
readers.extendAndSet(index, journal = server.getFactory().reader(key));
}
JournalDeltaProducer producer = producers.getQuiet(index);
if (producer == null) {
producers.extendAndSet(index, new JournalDeltaProducer(journal));
}
}
use of com.questdb.store.Journal in project questdb by bluestreak01.
the class JournalServerAgent method removeReader.
private void removeReader(int index) {
Journal journal = readers.getQuiet(index);
if (journal != null) {
journal.close();
if (index < readers.size()) {
readers.setQuick(index, null);
}
}
JournalDeltaProducer producer = producers.getQuiet(index);
if (producer != null) {
producer.free();
if (index < producers.size()) {
producers.setQuick(index, null);
}
}
}
Aggregations