<commit_before>/******************************************************************************
 *                    _   _____   __________                                  *
 *                   | | / / _ | / __/_  __/     Visibility                   *
 *                   | |/ / __ |_\ \  / /          Across                     *
 *                   |___/_/ |_/___/ /_/       Space and Time                 *
 *                                                                            *
 * This file is part of VAST. It is subject to the license terms in the       *
 * LICENSE file found in the top-level directory of this distribution and at  *
 * http://vast.io/license. No part of VAST, including this file, may be       *
 * copied, modified, propagated, or distributed except according to the terms *
 * contained in the LICENSE file.                                             *
 ******************************************************************************/

#include <caf/all.hpp>

#include "vast/error.hpp"
#include "vast/logger.hpp"

#include "vast/detail/assert.hpp"
#include "vast/detail/string.hpp"

#include "vast/system/archive.hpp"
#include "vast/system/meta_store.hpp"
#include "vast/system/tracker.hpp"

using namespace caf;

namespace vast {
namespace system {

tracker_type::behavior_type
tracker(tracker_type::stateful_pointer<tracker_state> self, std::string node) {
  self->state.registry.components[node].emplace(
    "tracker", component_state{actor_cast<actor>(self), "tracker"});
  auto extract_name_from_label = [=](auto&& label) {
    auto split = detail::split_to_str(label, "@");
    return split.size() == 1 ? node : split[1];
  };
  auto qualify_label = [=](auto&& label) {
    auto split = detail::split_to_str(label, "@");
    return split[0] + '@' + (split.size() == 1 ? node : split[1]);
  };
  self->set_down_handler(
    [=](const down_msg& msg) {
      auto pred = [&](auto& p) { return p.second.actor == msg.source; };
      for (auto& peer : self->state.registry.components) {
        auto i = std::find_if(peer.second.begin(), peer.second.end(), pred);
        if (i != peer.second.end()) {
          if (i->first == "tracker")
            self->state.registry.components.erase(peer.first);
          else
            peer.second.erase(i);<commit_msg>Remove dead code<commit_after>/******************************************************************************
 *                    _   _____   __________                                  *
 *                   | | / / _ | / __/_  __/     Visibility                   *
 *                   | |/ / __ |_\ \  / /          Across                     *
 *                   |___/_/ |_/___/ /_/       Space and Time                 *
 *                                                                            *
 * This file is part of VAST. It is subject to the license terms in the       *
 * LICENSE file found in the top-level directory of this distribution and at  *
 * http://vast.io/license. No part of VAST, including this file, may be       *
 * copied, modified, propagated, or distributed except according to the terms *
 * contained in the LICENSE file.                                             *
 ******************************************************************************/

#include <caf/all.hpp>

#include "vast/error.hpp"
#include "vast/logger.hpp"

#include "vast/detail/assert.hpp"
#include "vast/detail/string.hpp"

#include "vast/system/archive.hpp"
#include "vast/system/meta_store.hpp"
#include "vast/system/tracker.hpp"

using namespace caf;

namespace vast {
namespace system {

tracker_type::behavior_type
tracker(tracker_type::stateful_pointer<tracker_state> self, std::string node) {
  self->state.registry.components[node].emplace(
    "tracker", component_state{actor_cast<actor>(self), "tracker"});
  self->set_down_handler(
    [=](const down_msg& msg) {
      auto pred = [&](auto& p) { return p.second.actor == msg.source; };
      for (auto& peer : self->state.registry.components) {
        auto i = std::find_if(peer.second.begin(), peer.second.end(), pred);
        if (i != peer.second.end()) {
          if (i->first == "tracker")
            self->state.registry.components.erase(peer.first);
          else
            peer.second.erase(i);
{'fraction_non_alphanumeric': 0.19557109557109556, 'fraction_numerical': 0.0011655011655011655, 'mean_word_length': 2.0454222853087294, 'pattern_counts': {'":': 0, '<': 9, '<?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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6413776', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1137, 'n_words': 264}