<commit_before>%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2021 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Macros used in modules that implement archives functionality.
%%% @end
%%%-------------------------------------------------------------------

-ifndef(ARCHIVE_HRL).
-define(ARCHIVE_HRL, 1).

% TODO VFS-7616 refine archives' attributes, describe and explain following macros

% Macros defining possible states of an archive
-define(ARCHIVE_PENDING, pending).
-define(ARCHIVE_BUILDING, building).
-define(ARCHIVE_PRESERVED, preserved).
-define(ARCHIVE_FAILED, failed).
-define(ARCHIVE_PURGING, purging).


% Macros defining possible layouts of files and directories in an archive
-define(ARCHIVE_PLAIN_LAYOUT, plain).
-define(ARCHIVE_BAGIT_LAYOUT, bagit).
-define(ARCHIVE_LAYOUTS, [?ARCHIVE_PLAIN_LAYOUT, ?ARCHIVE_BAGIT_LAYOUT]).

-define(SUPPORTED_INCREMENTAL_ENABLE_VALUES, [false, true]).
% TODO VFS-7653 add true to the below list
-define(SUPPORTED_INCLUDE_DIP_VALUES, [false]).

-define(DEFAULT_LAYOUT, ?ARCHIVE_PLAIN_LAYOUT).
-define(DEFAULT_INCLUDE_DIP, false).
-define(DEFAULT_INCREMENTAL, #{<<"enable">> => false}).
-define(DEFAULT_BASE_ARCHIVE, null).
-define(DEFAULT_ARCHIVE_DESCRIPTION, <<>>).
-define(DEFAULT_CREATE_NESTED_ARCHIVES, false).

-record(archive_config, {
    incremental = ?DEFAULT_INCREMENTAL :: archive_config:incremental(),
    % This flag determines whether dissemination information package (DIP) is created alongside with
    % archival information package (AIP), on the storage.
    include_dip = ?DEFAULT_INCLUDE_DIP :: archive_config:include_dip(),
    layout :: archive_config:layout(),
    % this flag determines whether archives of nested datasets should be created
    % during archivisation of a dataset
    create_nested_archives = ?DEFAULT_CREATE_NESTED_ARCHIVES :: boolean()
}).

-record(archive_stats, {
    files_archived = 0 :: non_neg_integer(),
    files_failed = 0 :: non_neg_integer(),<commit_msg>VFS-7780 Fixed tests<commit_after>%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2021 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Macros used in modules that implement archives functionality.
%%% @end
%%%-------------------------------------------------------------------

-ifndef(ARCHIVE_HRL).
-define(ARCHIVE_HRL, 1).

% TODO VFS-7616 refine archives' attributes, describe and explain following macros

% Macros defining possible states of an archive
-define(ARCHIVE_PENDING, pending).
-define(ARCHIVE_BUILDING, building).
-define(ARCHIVE_PRESERVED, preserved).
-define(ARCHIVE_FAILED, failed).
-define(ARCHIVE_PURGING, purging).


% Macros defining possible layouts of files and directories in an archive
-define(ARCHIVE_PLAIN_LAYOUT, plain).
-define(ARCHIVE_BAGIT_LAYOUT, bagit).
-define(ARCHIVE_LAYOUTS, [?ARCHIVE_PLAIN_LAYOUT, ?ARCHIVE_BAGIT_LAYOUT]).

-define(SUPPORTED_INCREMENTAL_ENABLE_VALUES, [false, true]).
% TODO VFS-7653 add true to the below list
-define(SUPPORTED_INCLUDE_DIP_VALUES, [false]).

-define(DEFAULT_LAYOUT, ?ARCHIVE_PLAIN_LAYOUT).
-define(DEFAULT_INCLUDE_DIP, false).
-define(DEFAULT_INCREMENTAL, #{<<"enabled">> => false}).
-define(DEFAULT_BASE_ARCHIVE, null).
-define(DEFAULT_ARCHIVE_DESCRIPTION, <<>>).
-define(DEFAULT_CREATE_NESTED_ARCHIVES, false).

-record(archive_config, {
    incremental = ?DEFAULT_INCREMENTAL :: archive_config:incremental(),
    % This flag determines whether dissemination information package (DIP) is created alongside with
    % archival information package (AIP), on the storage.
    include_dip = ?DEFAULT_INCLUDE_DIP :: archive_config:include_dip(),
    layout :: archive_config:layout(),
    % this flag determines whether archives of nested datasets should be created
    % during archivisation of a dataset
    create_nested_archives = ?DEFAULT_CREATE_NESTED_ARCHIVES :: boolean()
}).

-record(archive_stats, {
    files_archived = 0 :: non_neg_integer(),
    files_failed = 0 :: non_neg_integer(),
{'fraction_non_alphanumeric': 0.20087638376383765, 'fraction_numerical': 0.007841328413284132, 'mean_word_length': 3.4436475409836067, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6869603', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1258, 'n_words': 317}