proxystore.connectors.connector¶
Connector protocol.
Connector ¶
Bases: Protocol[KeyT]
Connector protocol for interfacing with external object storage.
The Connector protocol defines the interface for interacting with a byte-level object store.
close() ¶
config() ¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
Returns:
from_config()
classmethod
¶
Create a new connector instance from a configuration.
Parameters:
Returns:
Source code in proxystore/connectors/connector.py
evict() ¶
Evict the object associated with the key.
Parameters:
-
key
(
KeyT
) –Key associated with object to evict.
exists() ¶
Check if an object associated with the key exists.
Parameters:
-
key
(
KeyT
) –Key potentially associated with stored object.
Returns:
-
bool
–If an object associated with the key exists.
get() ¶
Get the serialized object associated with the key.
Parameters:
-
key
(
KeyT
) –Key associated with the object to retrieve.
Returns:
-
bytes | None
–Serialized object or
None
if the object does not exist.
Source code in proxystore/connectors/connector.py
get_batch() ¶
Get a batch of serialized objects associated with the keys.
Parameters:
-
keys
(
Sequence[KeyT]
) –Sequence of keys associated with objects to retrieve.
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/connector.py
put() ¶
Put a serialized object in the store.
Parameters:
-
obj
(
bytes
) –Serialized object to put in the store.
Returns:
-
KeyT
–Key which can be used to retrieve the object.