Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/oxia/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def put(self, key: str, value: object,
ephemeral: bool = False,
sequence_keys_deltas: list[int] = None,
secondary_indexes: dict[str, str] = None,
) -> (str, Version):
) -> tuple[str, Version]:
"""
Associates a value with a key

Expand Down Expand Up @@ -302,7 +302,7 @@ def get(self, key: str,
comparison_type: ComparisonType = ComparisonType.EQUAL,
include_value: bool = True,
use_index: str = None,
) -> (str, str, Version):
) -> tuple[str, bytes, Version]:
"""
Returns the value associated with the specified key.

Expand Down Expand Up @@ -348,7 +348,7 @@ def _get_single_shard(shard: int, stub,
key: str,
comparison_type: ComparisonType,
include_value: bool,
use_index: str) -> (str, str, Version):
use_index: str) -> tuple[str, bytes, Version]:
gr = pb.GetRequest(key=key,
comparison_type=comparison_type,
include_value=include_value,
Expand Down Expand Up @@ -404,7 +404,7 @@ def range_scan(self,
max_key_exclusive: str,
partition_key: str = None,
use_index: str = None,
) -> Iterator[tuple[str, str, Version]]:
) -> Iterator[tuple[str, bytes, Version]]:
"""
perform a scan for existing records with any keys within the specified range.

Expand All @@ -429,7 +429,7 @@ def range_scan(self,

@staticmethod
def _range_scan_single_shard(shard, stub, min_key_inclusive: str, max_key_exclusive: str, use_index: str) \
-> Iterator[tuple[str, str, Version]]:
-> Iterator[tuple[str, bytes, Version]]:
it = stub.range_scan(pb.RangeScanRequest(shard=shard,
start_inclusive=min_key_inclusive,
end_exclusive=max_key_exclusive,
Expand Down
2 changes: 1 addition & 1 deletion src/oxia/internal/service_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_stub(self, shard: int) -> pb.OxiaClientStub:
return self._connection_pool.get(s.leader)
raise Exception(f'No stub found for shard {shard}')

def get_leader(self, key: str, partition_key: str) -> (int, pb.OxiaClientStub):
def get_leader(self, key: str, partition_key: str) -> tuple[int, pb.OxiaClientStub]:
hashing_key = partition_key if partition_key else key
s = self.get_shard(hashing_key)
return s.shard, self._connection_pool.get(s.leader)
Expand Down
Loading