2016-07-29 11:26:30 +00:00
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
%%
|
|
|
|
%% Copyright (c) 2016 Basho Technologies, Inc.
|
|
|
|
%%
|
|
|
|
%% This file is provided to you under the Apache License,
|
|
|
|
%% Version 2.0 (the "License"); you may not use this file
|
|
|
|
%% except in compliance with the License. You may obtain
|
|
|
|
%% a copy of the License at
|
|
|
|
%%
|
|
|
|
%% http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
%%
|
|
|
|
%% Unless required by applicable law or agreed to in writing,
|
|
|
|
%% software distributed under the License is distributed on an
|
|
|
|
%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
%% KIND, either express or implied. See the License for the
|
|
|
|
%% specific language governing permissions and limitations
|
|
|
|
%% under the License.
|
|
|
|
%%
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
|
|
|
-ifndef(job_enable_common_included).
|
|
|
|
-define(job_enable_common_included, true).
|
|
|
|
|
2016-09-02 22:13:09 +00:00
|
|
|
-define(APP_CONFIG_KEY, 'job_accept_class').
|
2016-08-04 19:57:41 +00:00
|
|
|
-define(CUTTLEFISH_PREFIX, "cluster.job").
|
2016-09-02 22:13:09 +00:00
|
|
|
-define(CUTTLEFISH_KEY(App, Op),
|
|
|
|
io_lib:format(?CUTTLEFISH_PREFIX ".~s.~s", [App, Op])).
|
2016-07-29 11:26:30 +00:00
|
|
|
|
2016-08-04 19:57:41 +00:00
|
|
|
-define(TOKEN_LIST_BUCKETS, {riak_kv, list_buckets}).
|
|
|
|
-define(TOKEN_LIST_BUCKETS_S, {riak_kv, stream_list_buckets}).
|
2016-08-15 17:50:18 +00:00
|
|
|
-define(TOKEN_LIST_KEYS, {riak_kv, list_keys}).
|
2016-08-04 19:57:41 +00:00
|
|
|
-define(TOKEN_LIST_KEYS_S, {riak_kv, stream_list_keys}).
|
|
|
|
-define(TOKEN_MAP_REDUCE, {riak_kv, map_reduce}).
|
2016-08-15 17:50:18 +00:00
|
|
|
-define(TOKEN_MAP_REDUCE_JS, {riak_kv, map_reduce_js}).
|
|
|
|
-define(TOKEN_SEC_INDEX, {riak_kv, secondary_index}).
|
|
|
|
-define(TOKEN_SEC_INDEX_S, {riak_kv, stream_secondary_index}).
|
2016-08-04 19:57:41 +00:00
|
|
|
-define(TOKEN_OLD_SEARCH, {riak_search, query}).
|
2016-08-15 17:50:18 +00:00
|
|
|
-define(TOKEN_YZ_SEARCH, {yokozuna, query}).
|
|
|
|
|
|
|
|
% Defaults for Riak 2.2
|
|
|
|
% 'true' == 'enabled', 'false' == 'disabled'
|
|
|
|
-define(JOB_CLASS_DEFAULTS, [
|
|
|
|
{?TOKEN_LIST_BUCKETS, true},
|
|
|
|
{?TOKEN_LIST_BUCKETS_S, true},
|
|
|
|
{?TOKEN_LIST_KEYS, true},
|
|
|
|
{?TOKEN_LIST_KEYS_S, true},
|
|
|
|
{?TOKEN_MAP_REDUCE, true},
|
|
|
|
{?TOKEN_MAP_REDUCE_JS, true},
|
|
|
|
{?TOKEN_SEC_INDEX, true},
|
|
|
|
{?TOKEN_SEC_INDEX_S, true},
|
2016-09-09 15:33:00 +00:00
|
|
|
{?TOKEN_OLD_SEARCH, true},
|
2016-08-15 17:50:18 +00:00
|
|
|
{?TOKEN_YZ_SEARCH, true}
|
|
|
|
]).
|
|
|
|
|
|
|
|
-define(COMMON_CONFIG, [
|
|
|
|
{"storage_backend", "leveldb"}, % required by ?TOKEN_SEC_INDEX
|
|
|
|
{"search", "on"} % required by ?TOKEN_YZ_SEARCH
|
|
|
|
]).
|
2016-07-29 11:26:30 +00:00
|
|
|
|
2016-08-04 19:57:41 +00:00
|
|
|
-define(ERRMSG_BIN(Tok), riak_core_util:job_class_disabled_message(binary, Tok)).
|
|
|
|
-define(ERRMSG_TXT(Tok), riak_core_util:job_class_disabled_message(text, Tok)).
|
2016-07-29 11:26:30 +00:00
|
|
|
|
|
|
|
-endif. % job_enable_common_included
|