Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MDB_INTEGERKEY and endianness #105

Closed
Labels
questionQueries on usage of the library, architectural patterns and alike
@kogupta

Description

@kogupta

I am facing an issue while using range search usingKeyRange.

In lmdb, the following is stored:

key: event timestamp in millisvalue: event payload

What I want to do:

  • count query by for a given time range (how many events between 1000 hrs to 1010 hrs)
  • fetch all the events for a given time range

Issue:

  • if counts are queried usingKeyRange.all(), correct count is returned.
  • but, if queried using specific range, it does not return current count:
    • KeyRange.closed(min, max) returns 0

Observations:

  • strangely, if queried usingKeyRange.closed(min, max * numberOfKeys), it returns correct result.
  • if the keys aredense, then things work as expected
    • say,
    long start = toMillis(LocalDateTime.of(2018, Month.JANUARY, 1, 0, 0));for(int i = 0; i < numberOfKeys; i++) {  dbi.put(bb(start + i), bb(i));}
    • in this scenario,KeyRange.closed() etc. work as expected.

My question is :
am I using the correct APIs for my usecase? is it a configuration issue?


Note:

  • Java version
    $ java -versionjava version "1.8.0_181"Java(TM) SE Runtime Environment (build 1.8.0_181-b13)Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
  • Windows 10 dev environment

A reproducible test case:gist

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQueries on usage of the library, architectural patterns and alike

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp