-
Notifications
You must be signed in to change notification settings - Fork 21
Refactor RangeBuilder RangeSpliter KeyRangeUtils and etc. #129
Comments
@ilovesoup @Novemser @birdstorm PTAL. |
I would like to state my reason why we should replace Although in current base branch, Sometimes it is confusing if we have two types of data waiting to compare with, while we have't get their types explicitly. We know that TiDB stores ranges in form of In my perspective the new implementation should at least resolve problems above, that's why I have tried a rather silly approach in my selectivity branch, by implementing a I know that wasn't a desirable solution to this issue, we should dig more into this. Because I can't see how the |
I am considering building our own |
Per discussion offline, I agree with @birdstorm
|
@birdstorm @ilovesoup Per " when we need to compare byte[] with ByteString directly.", I see no usage in current code base or potential usage. But it is a good point, we need convert our value into a unified form, e.g Originally, I came up with a solution converting all value into Here was my original solution:
For other types, we can extend from this base class. |
this issue is blocked by double index read, will work on this once that PR get merged into master. |
I will take over it and refactor type system on the fly. |
Where does this used in current code base?
KeyRangeUtils
*
*
RangeBuilder
Comparable<?> comparableVal = Comparables.wrap(constVal.getValue());
RegionManager
keyToRegionIdCache.get(Comparables.wrap(key))
ScanIterator
*
Why we need this comparables?
Range need key to be comparable, but ByteString and Bytep[] are not comparable.
Comparables is just a wrapper. Comparables is just to resolve ByteString and Byte[].
Solution for replacing Comparables.
Create a new class call Key
The text was updated successfully, but these errors were encountered: