Skip to content

Commit

Permalink
solved merge problems
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianespejo committed Jan 10, 2020
1 parent 439e10a commit 9861982
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions hecuba_py/hecuba/partitioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,15 @@ def tokens_partitions(self, ksp, table, token_range_size, target_token_range_siz
partitions_per_node = self._compute_partitions_per_node(ksp, table, token_range_size, target_token_range_size)

if self._strategy == "DYNAMIC":
for partition_tokens in self._dynamic_tokens_partitions(partitions_per_node):
for node, partition_tokens in self._dynamic_tokens_partitions(partitions_per_node):
storage_id = uuid.uuid4()
config.session.execute(self._prepared_store_id,
[self._partitioning_uuid, storage_id, config.splits_per_node])
self._n_idle_nodes -= 1
# self._partitions_nodes[storage_id] = node TODO why? where do you get node?
storage_id = uuid.uuid4()
self._partitions_nodes[storage_id] = partition_tokens[0]
yield storage_id, partition_tokens[1]
self._partitions_nodes[storage_id] = node
yield storage_id, partition_tokens
else:
for final_tokens in self._send_final_tasks(partitions_per_node):
for _, final_tokens in self._send_final_tasks(partitions_per_node):
yield uuid.uuid4(), final_tokens

def _compute_partitions_per_node(self, ksp, table, token_range_size, target_token_range_size):
Expand Down Expand Up @@ -231,7 +229,7 @@ def _send_final_tasks(self, partitions_per_node):
for partition in partitions_per_node.values():
group_size = max(len(partition) // config.splits_per_node, 1)
for i in range(0, len(partition), group_size):
yield partition[i:i + group_size]
yield -1, partition[i:i + group_size]

def _at_least_each_granularity_finished(self):
"""
Expand Down

0 comments on commit 9861982

Please sign in to comment.