Skip to content

Commit

Permalink
[#9] Implement configurable and dynamic pick/compute shard and node f…
Browse files Browse the repository at this point in the history
…unctions.
  • Loading branch information
cabol committed May 31, 2016
1 parent 534948b commit b08e583
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 326 deletions.
4 changes: 2 additions & 2 deletions c_src/jumping_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jumping_hash (unsigned long long key, unsigned int num_buckets) {
}

static ERL_NIF_TERM
calculate (ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
compute (ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
unsigned long key;
unsigned int num_buckets;

Expand All @@ -30,7 +30,7 @@ calculate (ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {
}

static ErlNifFunc nif_funcs[] = {
{"calculate", 2, calculate}
{"compute", 2, compute}
};

ERL_NIF_INIT (jumping_hash, nif_funcs, NULL, NULL, NULL, NULL);
4 changes: 2 additions & 2 deletions src/hash/jumping_hash.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-module(jumping_hash).

-export([calculate/2]).
-export([compute/2]).
-on_load(init/0).

-define(APPNAME, shards).
Expand All @@ -11,7 +11,7 @@
%%%===================================================================

%% @hidden
calculate(_, _) ->
compute(_, _) ->
not_loaded(?LINE).

%% @private
Expand Down
Loading

0 comments on commit b08e583

Please sign in to comment.