tensorstore.KvStore.spec(self, *, retain_context: bool | None = None, unbind_context: bool | None = None) KvStore.Spec

Spec that may be used to re-open or re-create the key-value store.

Example

>>> kvstore = await ts.KvStore.open({'driver': 'memory', 'path': 'abc/'})
>>> kvstore.spec()
KvStore.Spec({'driver': 'memory', 'path': 'abc/'})
>>> kvstore.spec(unbind_context=True)
KvStore.Spec({'context': {'memory_key_value_store': {}}, 'driver': 'memory', 'path': 'abc/'})
>>> kvstore.spec(retain_context=True)
KvStore.Spec({
  'context': {'memory_key_value_store': {}},
  'driver': 'memory',
  'memory_key_value_store': ['memory_key_value_store'],
  'path': 'abc/',
})
Parameters:
retain_context: bool | None = None

Retain all bound context resources (e.g. specific concurrency pools, specific cache pools).

The resultant Spec may be used to re-open the KvStore using the identical context resources.

Specifying a value of False has no effect.

unbind_context: bool | None = None

Convert any bound context resources to context resource specs that fully capture the graph of shared context resources and interdependencies.

Re-binding/re-opening the resultant spec will result in a new graph of new context resources that is isomorphic to the original graph of context resources. The resultant spec will not refer to any external context resources; consequently, binding it to any specific context will have the same effect as binding it to a default context.

Specifying a value of False has no effect.