#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 driverstd::string path);

Constructs a path from the specified driver and key prefix.

Methods

void AppendSuffix(std::string_view suffix);

Appends suffix to the path.

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 Contextcontext);

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<std::string> ToUrl() const;

Returns the URL representation of this spec, if supported.

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.

std::string path;

Path within the driver.

Friend functions

friend bool operator==(const Specaconst Specb);
friend bool operator!=(const Specaconst Specb);

Compares for equality via JSON representation, except that bound context resources are compared by identity.

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 open KvStore.

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.