Skip to content

Commit

Permalink
Merge pull request basho#388 from basho/feature/er/hide-update-handler
Browse files Browse the repository at this point in the history
Hide solr path under internal_solr

Reviewed-by: rzezeski
  • Loading branch information
borshop committed May 23, 2014
2 parents 356fe3a + a7f26f7 commit 5d9c999
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions include/yokozuna.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@

-define(RS_SVC, riak_search).

-define(SOLR_HOST_CONTEXT, "/internal_solr").

%%%===================================================================
%%% Anti Entropy
%%%===================================================================
Expand Down
2 changes: 1 addition & 1 deletion riak_test/yz_index_admin.erl
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ field_exists(Index, Field, ConnInfo) ->
end.

field_url({Host,Port}, Index, FieldName) ->
?FMT("http://~s:~B/solr/~s/schema/fields/~s", [Host, Port, Index, FieldName]).
?FMT("http://~s:~B"++?SOLR_HOST_CONTEXT++"/~s/schema/fields/~s", [Host, Port, Index, FieldName]).

host_entries(ClusterConnInfo) ->
[proplists:get_value(http, I) || {_,I} <- ClusterConnInfo].
Expand Down
3 changes: 2 additions & 1 deletion riak_test/yz_rs_migration_test.erl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-module(yz_rs_migration_test).
-compile(export_all).
-include("yokozuna.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("kernel/include/file.hrl").

Expand Down Expand Up @@ -220,7 +221,7 @@ create_pb_conn(Node) ->
load_data(Cluster, YZBenchDir, NumKeys) ->
{ExitCode, _} = yz_rt:load_data(Cluster, ?FRUIT_BUCKET, YZBenchDir, NumKeys),
?assertEqual(0,ExitCode),
%% Sleep for soft-commit.
% Sleep for soft-commit.
timer:sleep(1100).

query_data(Cluster, YZBenchDir, NumKeys, Time, DefaultField) ->
Expand Down
2 changes: 1 addition & 1 deletion riak_test/yz_rt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ search(Type, {Host, Port}, Index, Name0, Term0) ->
Term = quote_unicode(Term0),
FmtStr = case Type of
solr ->
"http://~s:~s/solr/~s/select?q=~s:~s&wt=json";
"http://~s:~s/internal_solr/~s/select?q=~s:~s&wt=json";
yokozuna ->
"http://~s:~s/search/~s?q=~s:~s&wt=json"
end,
Expand Down
4 changes: 2 additions & 2 deletions src/yz_solr.erl
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ search(Core, Headers, Params) ->

%% @doc Get the base URL.
base_url() ->
"http://localhost:" ++ integer_to_list(port()) ++ "/solr".
"http://localhost:" ++ integer_to_list(port()) ++ ?SOLR_HOST_CONTEXT.

%% @private
%%
Expand Down Expand Up @@ -429,4 +429,4 @@ make_ed(More, Continuation, Pairs) ->

-spec shard_frag(index_name(), {string(), string()}) -> string().
shard_frag(Core, {Host, Port}) ->
?FMT("~s:~s/solr/~s", [Host, Port, Core]).
?FMT("~s:~s"++?SOLR_HOST_CONTEXT++"/~s", [Host, Port, Core]).
3 changes: 2 additions & 1 deletion src/yz_solr_proc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ build_cmd(JavaPath, SolrPort, SolrJMXPort, Dir) ->
{ok, Etc} = application:get_env(riak_core, platform_etc_dir),
Headless = "-Djava.awt.headless=true",
SolrHome = "-Dsolr.solr.home=" ++ filename:absname(Dir),
HostContext = "-DhostContext=" ++ ?SOLR_HOST_CONTEXT,
JettyHome = "-Djetty.home=" ++ YZPrivSolr,
Port = "-Djetty.port=" ++ integer_to_list(SolrPort),
CP = "-cp",
Expand All @@ -197,7 +198,7 @@ build_cmd(JavaPath, SolrPort, SolrJMXPort, Dir) ->
JMX = [JMXPortArg, JMXAuthArg, JMXSSLArg]
end,

Args = [Headless, JettyHome, Port, SolrHome, CP, CP2, Logging, LibDir]
Args = [Headless, JettyHome, Port, SolrHome, HostContext, CP, CP2, Logging, LibDir]
++ string:tokens(solr_jvm_opts(), " ") ++ JMX ++ [Class],
{JavaPath, Args}.

Expand Down

0 comments on commit 5d9c999

Please sign in to comment.