fdb-record-layer
fdb-record-layer copied to clipboard
Resolves #2484: Removes Apache commons usage
This PR removes the Apache commons dependency from all of the non-test artifacts. It builds upon previous work that mostly removed our usage of the Pair
class from that library, and then also introduces alternatives for a few methods that we ended up relying on.
There are a few places where the API had to change because we were exposing Pair
all the way up to the API level. They were:
-
Setting the async to sync timeout. Now, instead of taking a
Pair<Long, TimeUnit>
, it takes aDuration
, which is a kind of unit-associated time in much the same way that the pair was trying to represent. -
Returning either a result value or an error. A new
Result
class modeled on theResult
monad present in several functional programming languages. In some ways, it's a kind of specializedPair
, but with more documentation as to what its constituents mean. -
Splitting key spaces into ranges of
Tuple
s. One method on the online indexer usedPair<Tuple, Tuple>
instead ofTupleRange
. The firstTuple
was always inclusive and the endTuple
was always exclusive, so this is equivalent toTupleRange.between(startTuple, endTuple)
, so that's what replaced it. -
Key space resolution could return un-resolved elements from the original
Tuple
. This has been upgraded to its own named struct. - Time window leaderboard returned both the rank and the associated entry. This has also gotten its own named struct.
These should be relatively straightforward things for users to respond to. The upshot for adopters is that they are free now to drop the Apache commons dependency (or safely pick their own version).