Commit Graph

9 Commits

Author SHA1 Message Date
Benny Halevy
721e94dcf1 min_max_tracker: mark functions noexcept
Based on tracked types being nothrow copy and move construtible.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2022-07-27 13:17:27 +03:00
Michael Livshin
ef06f92631 extremum_tracker: do not require default-constructible value types
The requirement is just an unintended artifact of the implementation.

Signed-off-by: Michael Livshin <michael.livshin@scylladb.com>
2022-06-20 19:37:31 +03:00
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
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
2022-01-18 12:15:18 +01:00
Avi Kivity
a55b434a2b treewide: extent copyright statements to present day 2021-06-06 19:18:49 +03:00
Pavel Solodovnikov
94b5c6333f utils: add missing <limits> header in extremum_tracking.hh
This makes all headers in scylla to be self-sufficient up
to the moment.

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
2021-05-20 00:04:51 +03:00
Paweł Dziepak
de2a447576 utils/extremum_tracking: drop default constructor
Default constructed extremum_tracker has uninitialised _default_value
which basically makes it never correct to do that. Since this class is a
mechanism and not a value it doesn't really need to be a regular type,
so let's drop the default constructor.

Message-Id: <20190207162430.7460-1-pdziepak@scylladb.com>
2019-02-07 18:31:25 +02:00
Paweł Dziepak
2680022df0 utils/extremum_tracking: preserve "not-set" status on merge
extremum_tracker allows choosing a default value that's going to be used
only if no "real" values were provided. Since it is never compared with
the actual input values it can be anything. For instance, if the minimum
tracker default value is 0 and there was one update with the value 1 the
detected minimum is going to be 1 (the default is ignored).

However, this doesn't work when the trackers are merged since that
process always leaves the destination tracker in the "set" state
regardless whether any of the merged trakcers has ever seen any value.

This is fixed by this patch, by properly preserving _is_set state on
merge.
2019-02-07 10:16:50 +00:00
Vladimir Krivopalov
8b8c9a5d10 Add class for tracking both extremum values (min and max) on updates.
Signed-off-by: Vladimir Krivopalov <vladimir@scylladb.com>
2018-05-03 17:05:06 -07:00
Vladimir Krivopalov
f6f99919da Factor out min_tracker and max_tracker as common helpers.
They will be re-used for collecting encoding statistics which is needed
to write SSTables 3.0.

Part of #1969.

Signed-off-by: Vladimir Krivopalov <vladimir@scylladb.com>
2018-04-25 14:58:47 -07:00