Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
we're not rotating by DbName any more
  • Loading branch information
Robert Newson authored and rnewson committed Jul 23, 2014
1 parent f2edc41 commit 0efb85e2d0f96004758a637b5ba764e1fc0e07a5
Showing 1 changed file with 3 additions and 3 deletions.
@@ -265,10 +265,10 @@ choose_ushards(DbName, Shards) ->
Groups1 = [rotate_list(DbName, order_shards(G)) || G <- Groups0],
[hd(G) || G <- Groups1].

rotate_list(_DbName, []) ->
rotate_list(_Key, []) ->
[];
rotate_list(DbName, List) ->
{H, T} = lists:split(erlang:crc32(DbName) rem length(List), List),
rotate_list(Key, List) ->
{H, T} = lists:split(erlang:crc32(Key) rem length(List), List),
T ++ H.

order_shards([#ordered_shard{}|_]=OrderedShards) ->

0 comments on commit 0efb85e

Please sign in to comment.