diff options
author | Brad Anderson <brad@cloudant.com> | 2010-03-09 09:56:30 -0800 |
---|---|---|
committer | Brad Anderson <brad@cloudant.com> | 2010-05-09 22:56:22 -0400 |
commit | cb079ba3ee4496b97e73e9fa08525878b88de413 (patch) | |
tree | 0710bd070b65bf55701bd98f3b1f0243369cdd9e | |
parent | 651bf4999d89c7375498684e2211bec549e61b29 (diff) |
creating fullmap based on node list
-rw-r--r-- | src/partitions.erl | 9 |
1 files changed, 7 insertions, 2 deletions
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). |