blob: 55c95f83eacc1cd86353da9570c7b7a61e6842f8 [file] [log] [blame]
% Licensed 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.
-define(DEFAULT_PRIORITY, 1.0).
-define(BAD_MAGIC_NUM, -12341234).
%% Dispatch Strategies
-define(DISPATCH_RANDOM, "random").
-define(DISPATCH_FD_HASH, "fd_hash").
-define(DISPATCH_SINGLE_SERVER, "single_server").
-define(DISPATCH_SERVER_PER_SCHEDULER, "server_per_scheduler").
-define(DEFAULT_CLASS_PRIORITIES, [
{customer, 1.0},
{internal_repl, 0.001},
{view_compact, 0.0001},
{db_compact, 0.0001},
{low, 0.0001},
{db_meta, 1.0},
{db_update, 1.0},
{view_update, 1.0},
{other, 1.0},
{interactive, 1.0}
]).
-record(ioq_request, {
fd,
msg,
key,
init_priority = 1.0,
fin_priority,
ref,
from,
t0,
tsub,
shard,
user,
db,
class,
ddoc
}).
-type io_priority() :: db_compact
| db_update
| interactive
| internal_repl
| other
| customer
| db_meta
| low.
-type view_io_priority() :: view_compact
| view_update.
-type dbcopy_string() :: string(). %% "dbcopy"
-type dbname() :: binary() | dbcopy_string().
-type group_id() :: any().
-type io_dimensions() :: {io_priority(), dbname()}
| {view_io_priority(), dbname(), group_id()}.
-type ioq_request() :: #ioq_request{}.