e882f774ef
* Perfile LevelDB instance usage are changed to use single instance per FLU server. * machi_csum_file reference is managed with machi_flu_filename_mgr as an aim to manage filenames with leveldb * Not only chunk checksums, but the list of trimmed files are also stored in LevelDB. * Remove 1024 bytes file header; instead put any metadata into LevelDB if needed. * LevelDB `db_ref()` lifecycle is same as that of `machi_metadata_mgr` * `machi_file_proxy` just uses it as it's passed at process startup * There are several optimization space still left as it is WIP
45 lines
1.8 KiB
Erlang
45 lines
1.8 KiB
Erlang
%% -------------------------------------------------------------------
|
|
%%
|
|
%% Copyright (c) 2007-2015 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.
|
|
%%
|
|
%% -------------------------------------------------------------------
|
|
|
|
%% @doc Now 4GiBytes, could be up to 64bit due to PB message limit of
|
|
%% chunk size
|
|
-define(DEFAULT_MAX_FILE_SIZE, ((1 bsl 32) - 1)).
|
|
-define(MINIMUM_OFFSET, 0).
|
|
|
|
%% 0th draft of checksum typing with 1st byte.
|
|
-define(CSUM_TAG_NONE, 0). % No csum provided by client
|
|
-define(CSUM_TAG_CLIENT_SHA, 1). % Client-generated SHA1
|
|
-define(CSUM_TAG_SERVER_SHA, 2). % Server-genereated SHA1
|
|
-define(CSUM_TAG_SERVER_REGEN_SHA, 3). % Server-regenerated SHA1
|
|
|
|
-define(CSUM_TAG_NONE_ATOM, none).
|
|
-define(CSUM_TAG_CLIENT_SHA_ATOM, client_sha).
|
|
-define(CSUM_TAG_SERVER_SHA_ATOM, server_sha).
|
|
-define(CSUM_TAG_SERVER_REGEN_SHA_ATOM, server_regen_sha).
|
|
|
|
%% Protocol Buffers goop
|
|
-define(PB_MAX_MSG_SIZE, (33*1024*1024)).
|
|
-define(PB_PACKET_OPTS, [{packet, 4}, {packet_size, ?PB_MAX_MSG_SIZE}]).
|
|
|
|
%% TODO: it's used in flu_sup and elsewhere, change this to suitable name
|
|
-define(TEST_ETS_TABLE, test_ets_table).
|
|
|
|
-define(DEFAULT_COC_NAMESPACE, "").
|
|
-define(DEFAULT_COC_LOCATOR, 0).
|