proxystore.endpoint.storage¶
Blob storage interface for endpoints.
Storage
¶
Bases: Protocol
Endpoint storage protocol for blobs.
exists
async
¶
get
async
¶
Get a blob from storage.
Parameters:
-
key
(str
) –Key associated with the blob to get.
-
default
(bytes | None
, default:None
) –Default return value if the blob does not exist.
Returns:
-
bytes | None
–The blob associated with the key or the value of
default
.
Source code in proxystore/endpoint/storage.py
set
async
¶
Store the blob associated with a key.
Parameters:
Raises:
-
ObjectSizeExceededError
–If the max object size is configured and the data exceeds that size.
Source code in proxystore/endpoint/storage.py
DictStorage
¶
DictStorage(
*, max_object_size: int | None = MAX_OBJECT_SIZE_DEFAULT
)
Simple dictionary-based storage for blobs.
Parameters:
-
max_object_size
(int | None
, default:MAX_OBJECT_SIZE_DEFAULT
) –Optional max size in bytes for any single object stored by the endpoint. If exceeded, an error is raised.
Source code in proxystore/endpoint/storage.py
exists
async
¶
get
async
¶
Get a blob from storage.
Parameters:
-
key
(str
) –Key associated with the blob to get.
-
default
(bytes | None
, default:None
) –Default return value if the blob does not exist.
Returns:
-
bytes | None
–The blob associated with the key or the value of
default
.
Source code in proxystore/endpoint/storage.py
set
async
¶
Store the blob associated with a key.
Parameters:
Raises:
-
ObjectSizeExceededError
–If the max object size is configured and the data exceeds that size.
Source code in proxystore/endpoint/storage.py
SQLiteStorage
¶
SQLiteStorage(
database_path: str | Path = ":memory:",
*,
max_object_size: int | None = MAX_OBJECT_SIZE_DEFAULT
)
SQLite storage protocol for blobs.
Parameters:
-
database_path
(str | Path
, default:':memory:'
) –Path to database file.
-
max_object_size
(int | None
, default:MAX_OBJECT_SIZE_DEFAULT
) –Optional max size in bytes for any single object stored by the endpoint. If exceeded, an error is raised.
Source code in proxystore/endpoint/storage.py
db
async
¶
Get the database connection object.
Source code in proxystore/endpoint/storage.py
evict
async
¶
evict(key: str) -> None
exists
async
¶
Check if a blob exists in the storage.
Parameters:
-
key
(str
) –Key associated with the blob to check.
Returns:
-
bool
–If a blob associated with the key exists.
Source code in proxystore/endpoint/storage.py
get
async
¶
Get a blob from storage.
Parameters:
-
key
(str
) –Key associated with the blob to get.
-
default
(bytes | None
, default:None
) –Default return value if the blob does not exist.
Returns:
-
bytes | None
–The blob associated with the key or the value of
default
.
Source code in proxystore/endpoint/storage.py
set
async
¶
Store the blob associated with a key.
Parameters:
Raises:
-
ObjectSizeExceededError
–If the max object size is configured and the data exceeds that size.