From cb079ba3ee4496b97e73e9fa08525878b88de413 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Tue, 9 Mar 2010 09:56:30 -0800 Subject: creating fullmap based on node list --- src/partitions.erl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/partitions.erl b/src/partitions.erl index 942968e1..27d2a5a1 100644 --- a/src/partitions.erl +++ b/src/partitions.erl @@ -12,8 +12,8 @@ -author('cliff@powerset.com'). %% API --export([partition_range/1, create_partitions/3, map_partitions/2, - diff/2, pp_diff/1, int_to_partition/2, +-export([partition_range/1, create_partitions/2, create_partitions/3, + diff/2, pp_diff/1, int_to_partition/2, map_partitions/2, join/3, leave/3, hash/1, hash_to_partition/2, item_to_nodepart/1, shard_name/2, hash_to_hex/2]). @@ -33,6 +33,11 @@ partition_range(Q) -> trunc( ?RINGTOP / math:pow(2,Q) ). % SHA-1 space / 2^Q + +create_partitions(Q, Node) -> + create_partitions(Q, Node, []). + + create_partitions(Q, Node, _Nodes) -> fresh(trunc(math:pow(2,Q)), Node). % map_partitions(Table, Nodes). -- cgit v1.2.3