- Notifications
You must be signed in to change notification settings - Fork124
Closed
Description
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 using
KeyRange.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 using
KeyRange.closed(min, max * numberOfKeys)
, it returns correct result. - if the keys are
dense
, 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