Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for riak-java-client HTTP transport

  • Loading branch information...
commit 9607df097d3de6a75dc545df8faeafeb1c3655c8 1 parent 13abff5
@russelldb russelldb authored
View
12 examples/riakc_java.config
@@ -19,10 +19,20 @@
%% {node(), inet:ip4_address(), inet:port_number()}
%% Were host is the Jinterface node and
%% ip and port form the address of the
-%% Riak PB interface that Java client should call
+%% Riak interface that Java client should call
{riakc_java_nodes, [{'java@127.0.0.1', {127,0,0,1}, 8087}]}.
+%% The transport you want the java client to use
+%% ether pb (for protocol buffers) or http.
+
+{riakc_java_transport, pb}.
+
+%% The size for the protocol buffers client
+%% socket buffers, in kb.
+
+{riakc_java_pbc_buffer, 16}.
+
{riakc_java_replies, 1}.
{operations, [{get, 1}, {update, 1}]}.
View
3  src/basho_bench_driver_riakc_java.erl
@@ -47,6 +47,7 @@ new(Id) ->
DW = basho_bench_config:get(riakc_java_dw, Replies),
RW = basho_bench_config:get(riakc_java_rw, Replies),
Bucket = basho_bench_config:get(riakc_java_bucket, <<"test">>),
+ Transport = basho_bench_config:get(riakc_java_transport, pb),
PBBuffer = basho_bench_config:get(riakc_java_pbc_buffer, 16),
%% Choose the node using our ID as a modulus
@@ -62,7 +63,7 @@ new(Id) ->
ok
end,
- case basho_bench_java_client:new(TargetNode, Ip, Port, PBBuffer) of
+ case basho_bench_java_client:new(TargetNode, Ip, Port, PBBuffer, Transport) of
{ok, Pid} ->
{ok, #state { pid = Pid,
bucket = Bucket,
View
6 src/basho_bench_java_client.erl
@@ -21,11 +21,11 @@
%% -------------------------------------------------------------------
-module(basho_bench_java_client).
--export([new/4, get/4, put/6, create_update/7, update/7, delete/4]).
+-export([new/5, get/4, put/6, create_update/7, update/7, delete/4]).
%%% Ask the java node to create a new process, and link to it
-new(Node, Ip, Port, PBBuffer) ->
- erlang:send({factory, Node}, {self(), {Ip, Port, PBBuffer}}),
+new(Node, Ip, Port, PBBuffer, Transport) ->
+ erlang:send({factory, Node}, {self(), {Ip, Port, PBBuffer, Transport}}),
receive
Pid when is_pid(Pid) ->
Please sign in to comment.
Something went wrong with that request. Please try again.