proxystore.connectors.endpoint¶
Endpoint connector implementation.
EndpointKey ¶
Bases: NamedTuple
Key to object in an Endpoint.
Attributes:
-
object_id
(
str
) –Unique object ID.
-
endpoint_id
(
str | None
) –Endpoint UUID where object is stored.
EndpointConnector ¶
Connector to ProxyStore Endpoints.
Warning
Specifying a custom proxystore_dir
can cause problems if the
proxystore_dir
is not the same on all systems that a proxy
created by this store could end up on. It is recommended to leave
the proxystore_dir
unspecified so the correct default directory
will be used.
Parameters:
-
endpoints
(
Sequence[str | UUID]
) –Sequence of valid and running endpoint UUIDs to use. At least one of these endpoints must be accessible by this process.
-
proxystore_dir
(
str | None
) –Optionally specify the proxystore home directory. Defaults to
home_dir()
.
Raises:
-
ValueError
–If endpoints is an empty list.
-
EndpointConnectorError
–If unable to connect to one of the endpoints provided.
Source code in proxystore/connectors/endpoint.py
close() ¶
config() ¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
Source code in proxystore/connectors/endpoint.py
from_config()
classmethod
¶
Create a new connector instance from a configuration.
Parameters:
Source code in proxystore/connectors/endpoint.py
evict() ¶
Evict the object associated with the key.
Parameters:
-
key
(
EndpointKey
) –Key associated with object to evict.
Source code in proxystore/connectors/endpoint.py
exists() ¶
Check if an object associated with the key exists.
Parameters:
-
key
(
EndpointKey
) –Key potentially associated with stored object.
Returns:
-
bool
–If an object associated with the key exists.
Source code in proxystore/connectors/endpoint.py
get() ¶
Get the serialized object associated with the key.
Parameters:
-
key
(
EndpointKey
) –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/endpoint.py
get_batch() ¶
Get a batch of serialized objects associated with the keys.
Parameters:
-
keys
(
Sequence[EndpointKey]
) –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/endpoint.py
put() ¶
Put a serialized object in the store.
Parameters:
-
obj
(
bytes
) –Serialized object to put in the store.
Returns:
-
EndpointKey
–Key which can be used to retrieve the object.
Source code in proxystore/connectors/endpoint.py
put_batch() ¶
Put a batch of serialized objects in the store.
Parameters:
Returns:
-
list[EndpointKey]
–List of keys with the same order as
objs
which can be used to retrieve the objects.