Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneskoester committed Oct 6, 2023
1 parent ba9b0fb commit d2364dc
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion snakemake_storage_plugin_s3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
IOCacheStorageInterface,
get_constant_prefix,
)
from snakemake_interface_storage_plugins.common import Operation


# Optional:
Expand Down Expand Up @@ -145,6 +146,24 @@ def __post_init__(self):
verify=False, # TODO required?
)

def use_rate_limiter(self) -> bool:
"""Return False if no rate limiting is needed for this provider."""
return False

def default_max_requests_per_second(self) -> float:
"""Return the default maximum number of requests per second for this storage
provider."""
...

def rate_limiter_key(self, query: str, operation: Operation):
"""Return a key for identifying a rate limiter given a query and an operation.
This is used to identify a rate limiter for the query.
E.g. for a storage provider like http that would be the host name.
For s3 it might be just the endpoint URL.
"""
...

@classmethod
def is_valid_query(cls, query: str) -> StorageQueryValidationResult:
"""Return whether the given query is valid for this storage provider."""
Expand Down Expand Up @@ -229,7 +248,7 @@ def get_inventory_parent(self) -> Optional[str]:
def local_suffix(self) -> str:
return self._local_suffix

def close(self):
def cleanup(self):
# Close any open connections, unmount stuff, etc.
pass

Expand Down

0 comments on commit d2364dc

Please sign in to comment.