forked from TrueCloudLab/frostfs-testlib
79 lines
2.3 KiB
Python
79 lines
2.3 KiB
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from frostfs_testlib.storage.cluster import Cluster, ClusterNode
|
|
from frostfs_testlib.storage.dataclasses.storage_object_info import Chunk, NodeNetmapInfo
|
|
|
|
|
|
class ChunksInterface(ABC):
|
|
@abstractmethod
|
|
def search_node_without_chunks(self, chunks: list[Chunk], cluster: Cluster, endpoint: str = None) -> list[ClusterNode]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_chunk_node(self, cluster: Cluster, chunk: Chunk) -> tuple[ClusterNode, NodeNetmapInfo]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_shard_chunk(self, node: ClusterNode, chunk: Chunk) -> str:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_all(
|
|
self,
|
|
rpc_endpoint: str,
|
|
cid: str,
|
|
oid: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
bearer: Optional[str] = None,
|
|
generate_key: Optional[bool] = None,
|
|
trace: bool = False,
|
|
root: bool = False,
|
|
verify_presence_all: bool = False,
|
|
json: bool = True,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> list[Chunk]:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_parity(
|
|
self,
|
|
rpc_endpoint: str,
|
|
cid: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
bearer: Optional[str] = None,
|
|
generate_key: Optional[bool] = None,
|
|
oid: Optional[str] = None,
|
|
trace: bool = False,
|
|
root: bool = False,
|
|
verify_presence_all: bool = False,
|
|
json: bool = True,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> Chunk:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def get_first_data(
|
|
self,
|
|
rpc_endpoint: str,
|
|
cid: str,
|
|
wallet: Optional[str] = None,
|
|
address: Optional[str] = None,
|
|
bearer: Optional[str] = None,
|
|
generate_key: Optional[bool] = None,
|
|
oid: Optional[str] = None,
|
|
trace: bool = False,
|
|
root: bool = False,
|
|
verify_presence_all: bool = False,
|
|
json: bool = True,
|
|
ttl: Optional[int] = None,
|
|
xhdr: Optional[dict] = None,
|
|
timeout: Optional[str] = None,
|
|
) -> Chunk:
|
|
pass
|