proxystore.connectors.local¶
In-process local storage connector implementation.
LocalKey
¶
Bases: NamedTuple
Key to objects store in a LocalConnector
.
Attributes:
-
id
(str
) –Unique object ID.
LocalConnector
¶
LocalConnector(
store_dict: dict[LocalKey, bytes] | None = None,
*,
include_data_in_config: bool = False
)
Connector that store objects in the local process's memory.
Warning
This connector exists primarily for testing purposes.
Parameters:
-
store_dict
(dict[LocalKey, bytes] | None
, default:None
) –Dictionary to store data in. If not specified, a new empty dict will be generated.
-
include_data_in_config
(bool
, default:False
) –Include the data in the connector in the connector's state. This is very innefficient and only useful for testing.
Source code in proxystore/connectors/local.py
close
¶
config
¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
Source code in proxystore/connectors/local.py
from_config
classmethod
¶
from_config(config: dict[str, Any]) -> LocalConnector
Create a new connector instance from a configuration.
Parameters:
evict
¶
evict(key: LocalKey) -> None
Evict the object associated with the key.
Parameters:
-
key
(LocalKey
) –Key associated with object to evict.
exists
¶
get
¶
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/connectors/local.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/connectors/local.py
put
¶
put_batch
¶
Put a batch of serialized objects in the store.
Parameters:
Returns:
-
list[LocalKey]
–List of keys with the same order as
objs
which can be used to retrieve the objects.
Source code in proxystore/connectors/local.py
set
¶
Set the object associated with a key.
Parameters: