proxystore.connectors.file¶
File system connector implementation.
FileKey ¶
Bases: NamedTuple
Key to objects in a file system directory.
Attributes:
-
filename
(
str
) –Unique object filename.
FileConnector ¶
Connector to shared file system.
Parameters:
-
store_dir
(
str
) –Path to directory to store data in. Note this directory will be deleted upon closing the store.
Source code in proxystore/connectors/file.py
close() ¶
Close the connector and clean up.
Warning
This will delete the store_dir
directory.
Warning
This method should only be called at the end of the program when the connector will no longer be used, for example once all proxies have been resolved.
Source code in proxystore/connectors/file.py
config() ¶
Get the connector configuration.
The configuration contains all the information needed to reconstruct the connector object.
from_config()
classmethod
¶
Create a new connector instance from a configuration.
Parameters:
evict() ¶
Evict the object associated with the key.
Parameters:
-
key
(
FileKey
) –Key associated with object to evict.
exists() ¶
get() ¶
Get the serialized object associated with the key.
Parameters:
-
key
(
FileKey
) –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/file.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 or -
list[bytes | None]
–None
if the corresponding key does not have an associated object.
Source code in proxystore/connectors/file.py
put() ¶
Put a serialized object in the store.
Parameters:
-
obj
(
bytes
) –Serialized object to put in the store.
Returns:
-
FileKey
–Key which can be used to retrieve the object.
Source code in proxystore/connectors/file.py
put_batch() ¶
Put a batch of serialized objects in the store.
Parameters:
Returns:
-
list[FileKey]
–List of keys with the same order as
objs
which can be used to -
list[FileKey]
–retrieve the objects.