use of com.questdb.net.ha.producer.JournalDeltaProducer in project questdb by bluestreak01.
the class AbstractJournalTest method setUp.
@Before
public void setUp() throws Exception {
origin = getFactory().writer(Quote.class, "origin");
slave = getFactory().writer(Quote.class, "slave");
master = getFactory().writer(Quote.class, "master");
journalClientStateProducer = new JournalClientStateProducer();
journalClientStateConsumer = new JournalClientStateConsumer();
this.masterReader = getFactory().reader(Quote.class, "master");
journalDeltaProducer = new JournalDeltaProducer(masterReader);
journalDeltaConsumer = new JournalDeltaConsumer(slave);
channel = new MockByteChannel();
}
use of com.questdb.net.ha.producer.JournalDeltaProducer 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.net.ha.producer.JournalDeltaProducer 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