Search in sources :

Example 11 with Price

use of org.questdb.examples.support.Price in project questdb by bluestreak01.

the class SslReplicationServerMain method publishPrice.

private void publishPrice(JournalWriter<Price> writer, int count) throws JournalException {
    long tZero = System.currentTimeMillis();
    System.out.println("sending: " + tZero);
    Price p = new Price();
    for (int i = 0; i < count; i++) {
        p.setTimestamp(tZero + i);
        p.setNanos(System.nanoTime());
        p.setSym(String.valueOf(i % 20));
        p.setPrice(i * 1.04598 + i);
        writer.append(p);
    }
    // commit triggers network publishing
    writer.commit();
}
Also used : Price(org.questdb.examples.support.Price)

Aggregations

Price (org.questdb.examples.support.Price)11 Factory (com.questdb.store.factory.Factory)8 JournalConfiguration (com.questdb.store.factory.configuration.JournalConfiguration)7 JournalConfigurationBuilder (com.questdb.store.factory.configuration.JournalConfigurationBuilder)7 JournalClient (com.questdb.net.ha.JournalClient)4 JournalListener (com.questdb.store.JournalListener)4 JournalServer (com.questdb.net.ha.JournalServer)3 ClientConfig (com.questdb.net.ha.config.ClientConfig)3 ServerConfig (com.questdb.net.ha.config.ServerConfig)2 InputStream (java.io.InputStream)2 ClusterController (com.questdb.net.ha.ClusterController)1 ServerNode (com.questdb.net.ha.config.ServerNode)1 JournalWriter (com.questdb.store.JournalWriter)1