Commit Graph

10 Commits

Author SHA1 Message Date
Taras Veretilnyk
478c1eaec5 sstables: add digest_file_random_access_reader for CRC32 digest computation
Add a new reader that wraps file_random_access_reader and computes a
running CRC32 digest over the data as it is read. The digest accumulates
across sequential read_exactly() calls and is reset on seek(), since a
non-sequential read invalidates the running checksum.
2026-03-10 19:24:05 +01:00
Avi Kivity
f3eade2f62 treewide: relicense to ScyllaDB-Source-Available-1.0
Drop the AGPL license in favor of a source-available license.
See the blog post [1] for details.

[1] https://www.scylladb.com/2024/12/18/why-were-moving-to-a-source-available-license/
2024-12-18 17:45:13 +02:00
Kefu Chai
6ead5a4696 treewide: move log.hh into utils/log.hh
the log.hh under the root of the tree was created keep the backward
compatibility when seastar was extracted into a separate library.
so log.hh should belong to `utils` directory, as it is based solely
on seastar, and can be used all subsystems.

in this change, we move log.hh into utils/log.hh to that it is more
modularized. and this also improves the readability, when one see
`#include "utils/log.hh"`, it is obvious that this source file
needs the logging system, instead of its own log facility -- please
note, we do have two other `log.hh` in the tree.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
2024-10-22 06:54:46 +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
Benny Halevy
fc89018146 sstables: random_access_reader: make methods noexcept
handle all exceptions in read_exactly, seek, and close
and specify them as noexcept.

Also, specify eof() as noexcept as it trivially is.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2020-07-05 19:40:48 +03:00
Benny Halevy
94460f3199 sstables: random_access_reader: futurize seek
And adjust its callers to wait on the returned future.

With this, there is no need for a gate to serialize close()
with the background work seek() used to leave behind.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2020-07-05 19:40:26 +03:00
Benny Halevy
765c5752c2 sstables: random_access_reader: unify input stream close code
Define a close_if_needed() helper function, to be called
from seek() and close().

A future patch will call it with a possibly disengaged
`_in` so it will close it only if it was engaged.

close_if_needed() captures the input stream unique ptr
so it will remain valid throughout close.
This was missing from close().

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2020-07-05 19:37:39 +03:00
Benny Halevy
e7fdadd748 sstables: random_access_reader: let file_random_access_reader set the input stream
Allow file_random_access_reader constructor to set the
input stream to prepare for futurizing seek() by adding
a protected set() method.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2020-07-05 19:37:36 +03:00
Benny Halevy
0bb1c0f37d sstables: random_access_reader: move functions out of line
These are not good candidates for inlining.

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
2020-07-05 18:47:04 +03:00