Skip to content

Implemented a Simple NumericIndexStrategy#471

Merged
rfecher merged 2 commits intomasterfrom
simple-idx
Jul 19, 2015
Merged

Implemented a Simple NumericIndexStrategy#471
rfecher merged 2 commits intomasterfrom
simple-idx

Conversation

@meislerj
Copy link
Copy Markdown
Contributor

This is an implementation of a simple 1-dimensional NumericIndexStrategy for indexing integer values. Can index keys of different sizes by using the appropriate lexicoder (short, int, or long are currently implemented). This index strategy will not work well for range insertions. See commit comments for more detail.

meislerj added 2 commits July 18, 2015 22:28
Implemented lexicoders for signed shorts, ints, and longs. The
most significant bit is inverted so that negative numbers sort
before positive numbers. Lexicographic sorting of the byte
arrays matches the natural order of the numbers.
Created a simple 1-dimensional NumericIndexStrategy that
can index integer values. The strategy doesn't use any
binning. The ids are simply the byte array values of
the numbers. This index strategy won't work well for
inserting ranges since the data will be replicated for
each integer value in the range.

The SimpleNumericIndexStrategy is an abstract class that
uses a Short, Integer, or Long lexicoder to encode/decode
numbers. This allows for adjusting the size of the keys
(i.e. a 16 or 32 bit integer might give a large enough
range for some applications) to save space in the row ID.
Extended by SimpleShortIndexStrategy (for 16 bit keys),
SimpleIntegerIndexStrategy (for 32 bit keys), and
SimpleLongIndexStrategy (for 64 bit keys).

getQueryRanges always returns 1 range since the sort order of the
bytes is the same as the sort order of the values. This means that
a contiguous range of values can be represented by a single
contiguous ByteArrayRange.

getInsertionIds returns a single insertionId if you are inserting
a point. If you insert a range, you'll get back a list with the
size of the number of integers in the range (because there is no
binning). That is not the intended use of this index strategy.
rfecher added a commit that referenced this pull request Jul 19, 2015
Implemented a Simple NumericIndexStrategy
@rfecher rfecher merged commit 664ae7d into master Jul 19, 2015
@rfecher rfecher deleted the simple-idx branch July 19, 2015 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants