Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.