proxystore_ex.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.
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
namespace
whenclose()
is called. This will delete keys regardless of if they were created by ProxyStore or not.
Source code in proxystore_ex/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
clear
provided when theDAOSConnector
was instantiated.
Source code in proxystore_ex/connectors/daos.py
config
¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
Source code in proxystore_ex/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:
-
bytes | None
–Serialized object or
None
if the object does not exist.
Source code in proxystore_ex/connectors/daos.py
get_batch
¶
Get a batch of serialized objects associated with the keys.
Parameters:
Returns:
-
list[bytes | None]
–List with same order as
keys
with the serialized objects orNone
if the corresponding key does not have an associated object.
Source code in proxystore_ex/connectors/daos.py
new_key
¶
Create a new key.
Parameters:
-
obj
(bytes | None
, default:None
) –Optional object which the key will be associated with. Ignored in this implementation.
Returns:
Source code in proxystore_ex/connectors/daos.py
put
¶
Put a serialized object in the store.
Parameters:
-
obj
(bytes
) –Serialized object to put in the store.
Returns:
-
DAOSKey
–Key which can be used to retrieve the object.
Source code in proxystore_ex/connectors/daos.py
put_batch
¶
Put a batch of serialized objects in the store.
Parameters:
Returns:
Source code in proxystore_ex/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.
Warning
This method is not required to be atomic and could therefore
result in race conditions with calls to
get()
.
Parameters:
-
key
(DAOSKey
) –Key that the object will be associated with.
-
obj
(bytes
) –Object to associate with the key.