proxystore.store¶
The ProxyStore Store
interface.
get_store() ¶
Get the backend store with name.
Parameters:
Returns:
-
Store[Any] | None
–Store
if a store matching the name or belonging to the proxy exists. If the store does not exist, returnsNone
.
Raises:
-
ProxyStoreFactoryError
–If the value is a proxy but does not contain a factory of type
StoreFactory
.
Source code in proxystore/store/__init__.py
register_store() ¶
Register the store instance to the global registry.
Note
Global means globally accessible within the Python process.
Tip
Use the store_registration
context manager to automatically register and unregister as store.
Parameters:
-
store
(
Store[Any]
) –Store instance to register.
-
exist_ok
(
bool
) –If a store with the same name exists, overwrite it.
Raises:
-
StoreExistsError
–If a store with the same name is already registered and
exist_ok
is false.
Source code in proxystore/store/__init__.py
store_registration() ¶
Context manager that registers and unregisters a set of stores.
Example
from proxystore.connectors.local import LocalConnector
from proxystore.store import Store
from proxystore.store import store_registration
with Store('store', LocalConnector()) as store:
with store_registration(store):
...
stores = [
Store('store1', LocalConnector()),
Store('store2', LocalConnector()),
]
with store_registration(*stores):
...
Parameters:
-
stores
(
Store[Any]
) –Set of
Store
instances to register then unregister when the context manager is exited. -
exist_ok
(
bool
) –If a store with the same name exists, overwrite it.
Raises:
-
StoreExistsError
–If a store with the same name is already registered and
exist_ok
is false.
Source code in proxystore/store/__init__.py
unregister_store() ¶
Unregisters the store instance from the global registry.
Note
This function is a no-op if no store matching the name exists (i.e., no exception will be raised).
Parameters: