-
#include "tensorstore/kvstore/spec.h"
- class tensorstore::kvstore::Spec;
Combines a driver-specific kvstore spec with a string
path
that serves as a key prefix.Constructors¶
- Spec();
Constructs an invalid (null) spec.
- Spec(DriverSpecPtr driver);
Constructs from a driver with empty path.
- explicit Spec(DriverSpecPtr driver, std::string path);
Constructs a path from the specified driver and key prefix.
Methods¶
- void AppendSuffix(std::string_view suffix);
- void AppendPathComponent(std::string_view component);
Joins a ‘/’-separated path component to the end
path
.
- bool valid() const;
Returns
true
if this is a valid (non-null) spec.
- absl::Status BindContext(const Context& context);
Binds any unbound context resources using the specified context. Any already-bound context resources remain unmodified.
- void UnbindContext();
Unbinds any bound context resources, replacing them with context resource specs that may be used to recreate the context resources.
- void StripContext();
Replaces any context resources with a default context resource spec.
- ContextBindingState context_binding_state() const;
Returns the context binding state of the spec.
- absl::Status Set(Option&&... option);
- absl::Status Set(SpecConvertOptions&& options);
Mutates this spec according to the specified options.
- static Result<Spec> FromUrl(std::string_view url);
Parses a
kvstore::Spec
from its URL representation.
- Result<Spec> base() const;
Returns the underlying kvstore spec, if this is an adapter (such as OCDBT or neuroglancer_uint64_sharded).
Data members¶
- DriverSpecPtr driver;
Driver spec.
Friend functions¶
- friend bool operator==(const Spec& a, const Spec& b);
- friend bool operator!=(const Spec& a, const Spec& b);
Compares for equality via JSON representation, except that bound context resources are compared by identity.
Related Types¶
- struct tensorstore::kvstore::DriverSpecOptions;
Options for mutating
Spec
objects that are handled directly by drivers.
- struct tensorstore::kvstore::SpecConvertOptions : public DriverSpecOptions;
Options that may be specified for modifying an existing
Spec
.
- class tensorstore::kvstore::DriverSpecPtr;
Smart pointer that represents a driver-specific kvstore spec.
- struct tensorstore::kvstore::SpecRequestOptions : public DriverSpecOptions;
Options that may be specified when requesting the
Spec
for an openKvStore
.
- struct tensorstore::kvstore::DriverOpenOptions;
Driver-agnostic options that may be specified when opening a
DriverPtr
.
- struct tensorstore::kvstore::OpenOptions : public DriverOpenOptions;
Driver-agnostic options that may be specified when opening a
KvStore
.