Partition¶
-
class
PartitionService
(internal_partition_service, serialization_service)¶ Bases:
object
Allows to retrieve information about the partition count, the partition owner or the partitionId of a key.
-
get_partition_owner
(partition_id)¶ Returns the owner of the partition if it’s set,
None
otherwise.- Parameters
partition_id (int) – The partition id.
- Returns
Owner of the partition
- Return type
uuid.UUID
-
get_partition_id
(key)¶ Returns the partition id for a key data.
- Parameters
key – The given key.
- Returns
The partition id.
- Return type
int
-
get_partition_count
()¶ Returns partition count of the connected cluster.
If partition table is not fetched yet, this method returns
0
.- Returns
The partition count
- Return type
int
-