Files
scylladb/sstables/open_info.hh
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

58 lines
1.7 KiB
C++

/*
* Copyright (C) 2020-present ScyllaDB
*
*/
/*
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include <seastar/core/sstring.hh>
#include <seastar/core/file.hh>
#include <seastar/core/sharded.hh>
#include <vector>
#include "sstables/version.hh"
#include "sstables/component_type.hh"
#include "sstables/shareable_components.hh"
#include <seastar/core/shared_ptr.hh>
namespace sstables {
struct entry_descriptor {
sstring sstdir;
sstring ks;
sstring cf;
int64_t generation;
sstable_version_types version;
sstable_format_types format;
component_type component;
static entry_descriptor make_descriptor(sstring sstdir, sstring fname);
// Use the given ks and cf and don't attempt to extract it from the dir path.
// This allows loading sstables from any path, but the filename still has to be valid.
static entry_descriptor make_descriptor(sstring sstdir, sstring fname, sstring ks, sstring cf);
entry_descriptor(sstring sstdir, sstring ks, sstring cf, int64_t generation,
sstable_version_types version, sstable_format_types format,
component_type component)
: sstdir(sstdir), ks(ks), cf(cf), generation(generation), version(version), format(format), component(component) {}
};
// contains data for loading a sstable using components shared by a single shard;
// can be moved across shards
struct foreign_sstable_open_info {
foreign_ptr<lw_shared_ptr<shareable_components>> components;
std::vector<shard_id> owners;
seastar::file_handle data;
seastar::file_handle index;
uint64_t generation;
sstable_version_types version;
sstable_format_types format;
uint64_t uncompressed_data_size;
};
}