query_buffers: correctly determine timeseries_query_buffers_root_path

This commit is contained in:
Andrei Zavada 2016-12-24 04:49:41 +02:00
parent 3ec4fd93e2
commit da61f5d8b0
2 changed files with 12 additions and 2 deletions

View File

@ -31,3 +31,4 @@
-define(E_QBUF_CREATE_ERROR, 1023). -define(E_QBUF_CREATE_ERROR, 1023).
-define(E_QBUF_LDB_ERROR, 1024). -define(E_QBUF_LDB_ERROR, 1024).
-define(E_QUANTA_LIMIT, 1025). -define(E_QUANTA_LIMIT, 1025).
-define(E_QBUF_INTERNAL_ERROR, 1027).

View File

@ -165,7 +165,7 @@ init_per_testcase(query_orderby_max_data_size_error, Cfg) ->
init_per_testcase(query_orderby_ldb_io_error, Cfg) -> init_per_testcase(query_orderby_ldb_io_error, Cfg) ->
Node = hd(proplists:get_value(cluster, Cfg)), Node = hd(proplists:get_value(cluster, Cfg)),
QBufDir = filename:join([rtdev:node_path(Node), "data/query_buffers"]), QBufDir = get_qbuf_dir(Node),
modify_dir_access(take_away, QBufDir), modify_dir_access(take_away, QBufDir),
Cfg; Cfg;
@ -184,7 +184,7 @@ end_per_testcase(query_orderby_max_data_size_error, Cfg) ->
end_per_testcase(query_orderby_ldb_io_error, Cfg) -> end_per_testcase(query_orderby_ldb_io_error, Cfg) ->
Node = hd(proplists:get_value(cluster, Cfg)), Node = hd(proplists:get_value(cluster, Cfg)),
QBufDir = filename:join([rtdev:node_path(Node), "data/query_buffers"]), QBufDir = get_qbuf_dir(Node),
modify_dir_access(give_back, QBufDir), modify_dir_access(give_back, QBufDir),
ok; ok;
end_per_testcase(_, Cfg) -> end_per_testcase(_, Cfg) ->
@ -337,6 +337,15 @@ col_no({[A|_], _, _}) ->
A - $a + 1. A - $a + 1.
get_qbuf_dir(Node) ->
{ok, QBufDir} = rpc:call(Node, application, get_env, [riak_kv, timeseries_query_buffers_root_path]),
case hd(QBufDir) of
$/ ->
QBufDir;
_ ->
filename:join([rtdev:node_path(Node), QBufDir])
end.
modify_dir_access(take_away, QBufDir) -> modify_dir_access(take_away, QBufDir) ->
ct:pal("take away access to ~s\n", [QBufDir]), ct:pal("take away access to ~s\n", [QBufDir]),
ok = file:rename(QBufDir, QBufDir++".boo"), ok = file:rename(QBufDir, QBufDir++".boo"),