lukecwik commented on pull request #15549: URL: https://github.com/apache/beam/pull/15549#issuecomment-978442241
> Updated RedisCursor compareTo to differentiate start and end, moved util functions to RedisCursorRangeTrakcer. About the internal ByteKeyRangeTracker, I removed it and moved its logic to the RedisCursorRangeTracker as having the internal ByteKeyRangeTracker presented some problems, mainly that the trySplit method would produce ranges with a starting key that was not a valid cursor returned by redis (because of its next function adding 1 to the current ByteKey) this caused problems on the test case with a large number of keys. RedisCursorRangeTracker maintains the same logic used on ByteKeyRangeTracker with the exception of a modified trySplit method. You can convert the next() ByteKey cursor by rounding up to next closet valid redis cursor. If the bytekey is 8 bytes (length of long) then you can decode it using the BigEndianLongCoder and if its longer then 8 bytes then you can truncate it down to 8 bytes decode it and add 1. This will allow you to reuse the ByteKeyRangeTracker. Note that the ByteKeyRangeTracker is has a lot of logic which has been well tested so duplicating it is very likely to create subtle errors. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
