<commit_before>%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2013 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Plugin which extends node manager.
%%% @end
%%%-------------------------------------------------------------------
-module(node_manager_plugin_default).
-author("<NAME>").

-include("global_definitions.hrl").
-include_lib("ctool/include/logging.hrl").
-include_lib("ctool/include/onedata.hrl").

-export([cluster_generations/0]).
-export([oldest_upgradable_cluster_generation/0]).
-export([app_name/0, cm_nodes/0, db_nodes/0]).
-export([renamed_models/0]).
-export([before_init/0]).
-export([before_cluster_upgrade/0]).
-export([upgrade_cluster/1]).
-export([custom_workers/0]).
-export([on_db_and_workers_ready/0]).
-export([listeners/0]).
-export([handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([clear_memory/1]).
-export([modules_with_exometer/0, exometer_reporters/0]).
-export([master_node_down/1, master_node_up/1, master_node_ready/1]).

-type model() :: datastore_model:model().
-type record_version() :: datastore_model:record_version().
-type state() :: term().

%%%===================================================================
%%% node_manager_plugin_behaviour callbacks
%%%===================================================================

%%--------------------------------------------------------------------
%% @doc
%% Returns list of all cluster generations known to this software.
%% Human readable version is included too for easier maintenance and logging purposes.
%% The last generation returned on the list is assumed to be the current software generation.
%% @end
%%--------------------------------------------------------------------
-spec cluster_generations() -> 
    [{node_manager:cluster_generation(), onedata:release_version()}].
cluster_generations() ->
    [{1, ?LINE_19_02}].

%%--------------------------------------------------------------------
%% @doc
%% Returns the oldest upgradable generation - the lowest one that can be directly
%% current cluster generation (the last from the list returned by cluster_generations())
%% @end
%%--------------------------------------------------------------------
-spec oldest_upgradable_cluster_generation() ->
    node_manager:cluster_generation().
oldest_upgradable_cluster_generation() ->
    1.

%%--------------------------------------------------------------------
%% @doc
%% Returns the name of the application that bases on cluster worker.
%% @end
%%--------------------------------------------------------------------
-spec app_name() -> {ok, Name :: atom()}.
app_name() ->
    {ok, cluster_worker}.<commit_msg>VFS-6721 Fixed typo<commit_after>%%%-------------------------------------------------------------------
%%% @author <NAME>
%%% @copyright (C) 2013 ACK CYFRONET AGH
%%% This software is released under the MIT license
%%% cited in 'LICENSE.txt'.
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Plugin which extends node manager.
%%% @end
%%%-------------------------------------------------------------------
-module(node_manager_plugin_default).
-author("<NAME>").

-include("global_definitions.hrl").
-include_lib("ctool/include/logging.hrl").
-include_lib("ctool/include/onedata.hrl").

-export([cluster_generations/0]).
-export([oldest_upgradable_cluster_generation/0]).
-export([app_name/0, cm_nodes/0, db_nodes/0]).
-export([renamed_models/0]).
-export([before_init/0]).
-export([before_cluster_upgrade/0]).
-export([upgrade_cluster/1]).
-export([custom_workers/0]).
-export([on_db_and_workers_ready/0]).
-export([listeners/0]).
-export([handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([clear_memory/1]).
-export([modules_with_exometer/0, exometer_reporters/0]).
-export([master_node_down/1, master_node_up/1, master_node_ready/1]).

-type model() :: datastore_model:model().
-type record_version() :: datastore_model:record_version().
-type state() :: term().

%%%===================================================================
%%% node_manager_plugin_behaviour callbacks
%%%===================================================================

%%--------------------------------------------------------------------
%% @doc
%% Returns list of all cluster generations known to this software.
%% Human readable version is included too for easier maintenance and logging purposes.
%% The last generation returned on the list is assumed to be the current software generation.
%% @end
%%--------------------------------------------------------------------
-spec cluster_generations() -> 
    [{node_manager:cluster_generation(), onedata:release_version()}].
cluster_generations() ->
    [{1, ?LINE_19_02}].

%%--------------------------------------------------------------------
%% @doc
%% Returns the oldest upgradable generation - the lowest one that can be directly
%% upgraded to current cluster generation (the last from the list returned by cluster_generations())
%% @end
%%--------------------------------------------------------------------
-spec oldest_upgradable_cluster_generation() ->
    node_manager:cluster_generation().
oldest_upgradable_cluster_generation() ->
    1.

%%--------------------------------------------------------------------
%% @doc
%% Returns the name of the application that bases on cluster worker.
%% @end
%%--------------------------------------------------------------------
-spec app_name() -> {ok, Name :: atom()}.
app_name() ->
    {ok, cluster_worker}.
{'fraction_non_alphanumeric': 0.3819735006973501, 'fraction_numerical': 0.012203626220362623, 'mean_word_length': 2.0451167728237793, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '359668', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1403, 'n_words': 331}