Files
scylladb/sstables/open_info.hh
Piotr Sarna 209c2f5d99 sstables: define generation_type for sstables
No functional changes intended - this series is quite verbose,
but after it's in, it should be considerably easier to change
the type of SSTable generations to something else - e.g. a string
or timeUUID.

Closes #10533
2022-05-11 14:46:30 +02:00

59 lines
1.8 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 "sstables/generation_type.hh"
#include <seastar/core/shared_ptr.hh>
namespace sstables {
struct entry_descriptor {
sstring sstdir;
sstring ks;
sstring cf;
generation_type 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, generation_type 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;
generation_type generation;
sstable_version_types version;
sstable_format_types format;
uint64_t uncompressed_data_size;
};
}