Skip to content

Commit 0f42622

Browse files
committed
Allow admin override of node name
1 parent be33ca3 commit 0f42622

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

examples/riakc_nhs.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
{duration, 1440}.
44
{report_interval, 10}.
55

6+
{node_name, testnode1}.
7+
68
{concurrent, 100}.
79

810
{driver, basho_bench_driver_nhs}.

examples/riakc_nhs_clinicals.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
{duration, 1440}.
44
{report_interval, 10}.
55

6+
{node_name, testnode1}.
7+
68
{concurrent, 100}.
79

810
{driver, basho_bench_driver_nhs}.

src/basho_bench_driver_nhs.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ new(Id) ->
126126
{DocSize, DocKeyOrder} =
127127
basho_bench_config:get(unique, {8000, key_order}),
128128

129-
KeyIDint = erlang:phash2(Id) bxor erlang:phash2(node()),
129+
NodeID = basho_bench_config:get(node_name, node()),
130+
131+
KeyIDint = erlang:phash2(Id) bxor erlang:phash2(NodeID),
130132
?INFO("Using Node ID ~w to generate ID ~w\n", [node(), KeyIDint]),
131133

132134
case riakc_pb_socket:start_link(PBTargetIp, PBTargetPort) of

0 commit comments

Comments
 (0)