fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

Resolves #2484: Removes Apache commons usage

Open alecgrieser opened this issue 7 months ago • 7 comments

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 a Duration, 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 the Result monad present in several functional programming languages. In some ways, it's a kind of specialized Pair, but with more documentation as to what its constituents mean.
  • Splitting key spaces into ranges of Tuples. One method on the online indexer used Pair<Tuple, Tuple> instead of TupleRange. The first Tuple was always inclusive and the end Tuple was always exclusive, so this is equivalent to TupleRange.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).

alecgrieser avatar Jul 18 '24 16:07 alecgrieser