2015-03-31 07:46:03 +00:00
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
%%
|
|
|
|
%% Copyright (c) 2007-2014 Basho Technologies, Inc. All Rights Reserved.
|
|
|
|
%%
|
|
|
|
%% 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.
|
|
|
|
%%
|
|
|
|
%% -------------------------------------------------------------------
|
|
|
|
|
2015-04-09 03:16:58 +00:00
|
|
|
-ifndef(MACHI_PROJECTION_HRL).
|
|
|
|
-define(MACHI_PROJECTION_HRL, true).
|
|
|
|
|
2015-04-02 07:05:06 +00:00
|
|
|
-type pv1_csum() :: binary().
|
|
|
|
-type pv1_epoch() :: {pv1_epoch_n(), pv1_csum()}.
|
|
|
|
-type pv1_epoch_n() :: non_neg_integer().
|
|
|
|
-type pv1_server() :: atom() | binary().
|
|
|
|
-type pv1_timestamp() :: {non_neg_integer(), non_neg_integer(), non_neg_integer()}.
|
2015-04-02 05:17:57 +00:00
|
|
|
|
2015-04-09 03:16:58 +00:00
|
|
|
-record(p_srvr, {
|
|
|
|
name :: pv1_server(),
|
|
|
|
proto = 'ipv4' :: 'ipv4' | 'disterl', % disterl? Hrm.
|
|
|
|
address :: term(), % Protocol-specific
|
|
|
|
port :: term(), % Protocol-specific
|
|
|
|
props = [] :: list() % proplist for other related info
|
|
|
|
}).
|
|
|
|
|
|
|
|
-type p_srvr() :: #p_srvr{}.
|
2015-04-09 12:32:04 +00:00
|
|
|
-type p_srvr_dict() :: orddict:orddict().
|
2015-04-09 03:16:58 +00:00
|
|
|
|
2015-04-02 09:08:42 +00:00
|
|
|
-define(DUMMY_PV1_EPOCH, {0,<<0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0>>}).
|
|
|
|
|
2015-04-02 07:05:06 +00:00
|
|
|
-record(projection_v1, {
|
|
|
|
epoch_number :: pv1_epoch_n(),
|
|
|
|
epoch_csum :: pv1_csum(),
|
|
|
|
all_members :: [pv1_server()],
|
2015-04-09 03:16:58 +00:00
|
|
|
members_dict :: p_srvr_dict(),
|
2015-04-02 07:05:06 +00:00
|
|
|
down :: [pv1_server()],
|
|
|
|
creation_time :: pv1_timestamp(),
|
|
|
|
author_server :: pv1_server(),
|
|
|
|
upi :: [pv1_server()],
|
|
|
|
repairing :: [pv1_server()],
|
|
|
|
dbg :: list(), %proplist(), is checksummed
|
|
|
|
dbg2 :: list() %proplist(), is not checksummed
|
|
|
|
}).
|
|
|
|
|
|
|
|
-define(MACHI_DEFAULT_TCP_PORT, 50000).
|
|
|
|
|
2015-03-31 07:46:03 +00:00
|
|
|
-define(SHA_MAX, (1 bsl (20*8))).
|
2015-04-09 03:16:58 +00:00
|
|
|
|
|
|
|
-endif. % !MACHI_PROJECTION_HRL
|