proxystore.connectors.daos¶
DAOS Container connector implementation.
DAOSKey
¶
Bases: NamedTuple
Key to object stored in a DAOS container.
Attributes:
-
pool(str) –DAOS pool the container belongs to.
-
container(str) –Name of the DAOS container the dictionary with the object is in.
-
namespace(str) –Name of the DAOS dictionary the object is in.
-
dict_key(str) –Unique key in the DAOS dictionary.
DAOSConnector
¶
DAOS Container connector.
Learn more about DAOS in Python here.
Note
PyDAOS is not available on PyPI and must be installed alongside DAOS. See the DAOS guide for more details.
Warning
This connector is only tested against a mocked version of PyDAOS based on the DAOS v2.4 reference implementation. It is not tested against real DAOS deployments, and changes to the PyDAOS interface in other DAOS versions may break this connector.
Example
Assume we have a DAOS pool named "mypool." First, we create a new
container in that pool named "kvstore" with type PYTHON.
Then we can create a connector.
Parameters:
-
pool(str) –DAOS pool label or UUID string.
-
container(str) –DAOS container label or UUID string.
-
namespace(str) –Name of the DAOS dictionary created in the DAOS container. All operations will be performed on this one dictionary so it can be thought of as a logically namespace separated from other applications interacting with this DAOS container.
-
clear(bool, default:False) –Remove all keys from the DAOS dictionary named
namespacewhenclose()is called. This will delete keys regardless of if they were created by ProxyStore or not.
Source code in proxystore/connectors/daos.py
close
¶
close(clear: bool | None = None) -> None
Close the connector and clean up.
Warning
Passing clear=True will result in ALL keys in the DAOS
Dictionary being deleted regardless of if they were created by
ProxyStore or not.
Parameters:
-
clear(bool | None, default:None) –Remove all keys in the DAOS dictionary. Overrides the default value of
clearprovided when theDAOSConnectorwas instantiated.
Source code in proxystore/connectors/daos.py
config
¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
Source code in proxystore/connectors/daos.py
from_config
classmethod
¶
from_config(config: dict[str, Any]) -> DAOSConnector
Create a new connector instance from a configuration.
Parameters:
evict
¶
evict(key: DAOSKey) -> None
Evict the object associated with the key.
Parameters:
-
key(DAOSKey) –Key associated with object to evict.
exists
¶
get
¶
Get the serialized object associated with the key.
Parameters:
-
key(DAOSKey) –Key associated with the object to retrieve.
Returns:
-
BytesLike | None–Serialized object or
Noneif the object does not exist.
Source code in proxystore/connectors/daos.py
get_batch
¶
Get a batch of serialized objects associated with the keys.
Parameters:
Returns:
-
list[BytesLike | None]–List with same order as
keyswith the serialized objects orNoneif the corresponding key does not have an associated object.
Source code in proxystore/connectors/daos.py
new_key
¶
Create a new key.
Parameters:
-
obj(BytesLike | None, default:None) –Optional object which the key will be associated with. Ignored in this implementation.
Returns:
Source code in proxystore/connectors/daos.py
put
¶
put_batch
¶
Put a batch of serialized objects in the store.
Parameters:
Returns:
Source code in proxystore/connectors/daos.py
set
¶
Set the object associated with a key.
Note
The Connector
provides write-once, read-many semantics. Thus,
set()
should only be called once per key, otherwise unexpected behavior
can occur.
Parameters:
-
key(DAOSKey) –Key that the object will be associated with.
-
obj(BytesLike) –Object to associate with the key.