Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.
Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.
The changes we applied mechanically with a script, except to
licenses/README.md.
Closes#9937
The current filter tracker uses a distributed mechanism, even though the values
for all CPUs but one are usually at zero. This is because - I wrongly assumed -
that when using legacy sstables, the same sstable would be serving keys for
multiple shards, leading to the map reduce being a necessary operation in this
case.
However, Avi currently point out that:
"It is and it isn't [the case]. Yes the sstable will be loaded on multiple cores, but
each core will have its own independent sstable object (only the files on disk
are shared).
So to aggregate statistics on such a shared sstables, you have to match them by
name (and the sharded<filter_tracker> is useless)."
Avi is correct in his remarks. The code will hereby be simplified by keeping
local counters only, and the map reduce operation will happen at a higher
level.
Also, because the users of the get methods will go through the sstable, we can
actually just move them there. With that we can leave the counters private to
the external world in the filter itself.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
We are currently initializing some of the filter statistics. That can lead to
bogus values.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
All sharded services "should" define a stop method. Calling them is also
a good practice. For this one specifically, though, we will not call stop.
We miss a good way to add a Deleter to a shared_ptr class, and that would
be the only reliable way to tie into its lifetime.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
This class will be used to generate filter hit / miss statistics to be consumed
by upper layers
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>