Search in sources :

Example 1 with JournalSymbolTableConsumer

use of com.questdb.net.ha.comsumer.JournalSymbolTableConsumer in project questdb by bluestreak01.

the class PartitionTest method syncSymbolTables.

private void syncSymbolTables() throws JournalNetworkException {
    JournalClientStateProducer sp = new JournalClientStateProducer();
    JournalClientStateConsumer sc = new JournalClientStateConsumer();
    sp.write(channel, new IndexedJournal(0, slave));
    sc.read(channel);
    JournalSymbolTableProducer p = new JournalSymbolTableProducer(master);
    JournalSymbolTableConsumer c = new JournalSymbolTableConsumer(slave);
    p.configure(master.find(sc.getValue().getTxn(), sc.getValue().getTxPin()));
    p.write(channel);
    c.read(channel);
}
Also used : JournalClientStateProducer(com.questdb.net.ha.producer.JournalClientStateProducer) JournalClientStateConsumer(com.questdb.net.ha.comsumer.JournalClientStateConsumer) IndexedJournal(com.questdb.net.ha.model.IndexedJournal) JournalSymbolTableProducer(com.questdb.net.ha.producer.JournalSymbolTableProducer) JournalSymbolTableConsumer(com.questdb.net.ha.comsumer.JournalSymbolTableConsumer)

Example 2 with JournalSymbolTableConsumer

use of com.questdb.net.ha.comsumer.JournalSymbolTableConsumer in project questdb by bluestreak01.

the class JournalSymbolTableTest method setUp.

@Before
public void setUp() throws Exception {
    origin = getFactory().writer(Quote.class, "origin");
    master = getFactory().writer(Quote.class, "master");
    slave = getFactory().writer(Quote.class, "slave");
    channel = new MockByteChannel();
    journalSymbolTableProducer = new JournalSymbolTableProducer(master);
    journalSymbolTableConsumer = new JournalSymbolTableConsumer(slave);
    origin.append(new Quote().setSym("AB").setEx("EX1").setMode("M1"));
    origin.append(new Quote().setSym("CD").setEx("EX2").setMode("M2"));
    origin.append(new Quote().setSym("EF").setEx("EX3").setMode("M2"));
    origin.append(new Quote().setSym("GH").setEx("EX3").setMode("M3"));
}
Also used : Quote(com.questdb.model.Quote) JournalSymbolTableProducer(com.questdb.net.ha.producer.JournalSymbolTableProducer) JournalSymbolTableConsumer(com.questdb.net.ha.comsumer.JournalSymbolTableConsumer) Before(org.junit.Before)

Example 3 with JournalSymbolTableConsumer

use of com.questdb.net.ha.comsumer.JournalSymbolTableConsumer in project questdb by bluestreak01.

the class LinkedJournalSymbolTableTest method setUp.

@Before
public void setUp() throws Exception {
    origin = getFactory().writer(RDFNode.class, "origin");
    master = getFactory().writer(RDFNode.class, "master");
    slave = getFactory().writer(RDFNode.class, "slave");
    channel = new MockByteChannel();
    journalSymbolTableProducer = new JournalSymbolTableProducer(master);
    journalSymbolTableConsumer = new JournalSymbolTableConsumer(slave);
    origin.append(new RDFNode().setObj("O1").setSubj("S1"));
    origin.append(new RDFNode().setObj("O2").setSubj("S1"));
    origin.append(new RDFNode().setObj("O3").setSubj("S2"));
    origin.append(new RDFNode().setObj("S2").setSubj("S1"));
}
Also used : JournalSymbolTableProducer(com.questdb.net.ha.producer.JournalSymbolTableProducer) RDFNode(com.questdb.model.RDFNode) JournalSymbolTableConsumer(com.questdb.net.ha.comsumer.JournalSymbolTableConsumer) Before(org.junit.Before)

Aggregations

JournalSymbolTableConsumer (com.questdb.net.ha.comsumer.JournalSymbolTableConsumer)3 JournalSymbolTableProducer (com.questdb.net.ha.producer.JournalSymbolTableProducer)3 Before (org.junit.Before)2 Quote (com.questdb.model.Quote)1 RDFNode (com.questdb.model.RDFNode)1 JournalClientStateConsumer (com.questdb.net.ha.comsumer.JournalClientStateConsumer)1 IndexedJournal (com.questdb.net.ha.model.IndexedJournal)1 JournalClientStateProducer (com.questdb.net.ha.producer.JournalClientStateProducer)1