Git Product home page Git Product logo

Comments (3)

bluestreak01 avatar bluestreak01 commented on May 18, 2024

it is an excellent spot, thanks. I've added your changes to repository.

As far as partitioning by "interval" type, would this work if you had different journals for separate interval types?

JournalWriter<Quote> w1 = factory.writer(Quote.class, "quote_1");
JournalWriter<Quote> w3 = factory.writer(Quote.class, "quote_3");
JournalWriter<Quote> w5 = factory.writer(Quote.class, "quote_5");
JournalWriter<Quote> w60 = factory.writer(Quote.class, "quote_60");

I would make interval type a byte (to save disk space):

public void append(Quote q) {
    switch (q.getType()) {
        case 1:
            w1.append(q);
            break;
        case 3:
            w3.append(q);
            break;
        case 5:
            w5.append(q);
            break;
        case 60:
            w60.append(q);
            break;
    }
}

It should be possible to search by symbol + interval. First you declare where symbols are:

JournalFactory factory1 = new JournalFactory(
        new JournalConfigurationBuilder() {{
            $(Quote.class)
                     // name of symbol field  + total number of values it can have (hint)
                    .$sym("sym").index().valueCountHint(15)
                     // name of timestamp field
                    .$ts("timestamp")
            ;
        }}.build("path")
);

Next you can search them:

for (Quote q : w.query().all().withSymValues("sym", "ABC", "CDE").slice(Dates.interval(a, b)).asResultSet()) {
...
}

hope this helps,

from questdb.

ValeryNo avatar ValeryNo commented on May 18, 2024

Really appreciate your quick response!

I'm sorry for my ignorance, but is there any way to get the changes through maven? Not sure if you do daily builds etc.

I wasn't aware that I can bypass journal name to factory.writer. Missed that. Thanks a lot! I think that should work then.

from questdb.

bluestreak01 avatar bluestreak01 commented on May 18, 2024

No problem, nfsdb should be better documented.

If you add this to your pom.xml you should be able to pull snapshot in (2.0.1-SNAPSHOT):

<repositories>
    <repository>
        <id>sonatype-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

from questdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.