<commit_before>// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef SERIALIZER_LOG_LOG_SERIALIZER_HPP_
#define SERIALIZER_LOG_LOG_SERIALIZER_HPP_

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

#include <map>
#include <string>
#include <vector>

#include "serializer/serializer.hpp"
#include "serializer/log/config.hpp"
#include "utils.hpp"
#include "concurrency/mutex.hpp"

#include "serializer/log/metablock_manager.hpp"
#include "serializer/log/extent_manager.hpp"
#include "serializer/log/lba/lba_list.hpp"
#include "serializer/log/data_block_manager.hpp"

#include "serializer/log/stats.hpp"

class cond_t;
struct block_magic_t;
class io_backender_t;
class log_serializer_t;

/**
 * This is the log-structured serializer, the holiest of holies of
 * RethinkDB. Please treat it with courtesy, professionalism, and
 * respect that it deserves.
 */

struct log_serializer_metablock_t {
    extent_manager_t::metablock_mixin_t extent_manager_part;
    lba_list_t::metablock_mixin_t lba_index_part;
    data_block_manager_t::metablock_mixin_t data_block_manager_part;
    block_sequence_id_t block_sequence_id;
};

//  Data to be serialized to disk with each block.  Changing this changes the disk format!
// TODO: This header data should maybe go to the cache
typedef metablock_manager_t<log_serializer_metablock_t> mb_manager_t;

// Used internally
struct ls_block_writer_t;
struct ls_read_fsm_t;
struct ls_start_new_fsm_t;
struct ls_start_existing_fsm_t;

class log_serializer_t :
#ifndef SEMANTIC_SERIALIZER_CHECK
    public serializer_t,
#else
    public home_thread_mixin_debug_t,
#endif  // SEMANTIC_SERIALIZER_CHECK
    private data_block_manager_t::shutdown_callback_t,
    private lba_list_t::shutdown_callback_t
{
    friend struct ls_block_writer_t;
    friend struct ls_read_fsm_t;
    friend struct ls_start_new_fsm_t;
    friend struct ls_start_existing_fsm_t;
    friend class data_block_manager_t;
    friend class dbm_read_ahead_fsm_t;
    friend class ls_block_token_pointee_t;

public:
    /* Serializer configuration. dynamic_config_t is everything that can be changed from run
    to run; static_config_t is the parameters that are set when the database is created and
    cannot be changed after that. */
    typedef log_serializer_private_dynamic_config_t private_dynamic_config_t;
    typedef log_serializer_dynamic_config_t dynamic_config_t;
    typedef log_serializer_static_config_t static_config_t;

    struct log_serializer_config_t {
        dynamic_config_t dynamic_config;
        private_dynamic_config_t private_dynamic_config;
        static_config_t static_config;

        explicit log_serializer_config_t(const std::string& file_name)
            : private_dynamic_config(file_name)
        { }
<commit_msg>Removed declarations of long-removed classes.<commit_after>// Copyright 2010-2012 RethinkDB, all rights reserved.
#ifndef SERIALIZER_LOG_LOG_SERIALIZER_HPP_
#define SERIALIZER_LOG_LOG_SERIALIZER_HPP_

#include <map>
#include <string>
#include <vector>

#include "serializer/serializer.hpp"
#include "serializer/log/config.hpp"
#include "utils.hpp"
#include "concurrency/mutex.hpp"

#include "serializer/log/metablock_manager.hpp"
#include "serializer/log/extent_manager.hpp"
#include "serializer/log/lba/lba_list.hpp"
#include "serializer/log/data_block_manager.hpp"

#include "serializer/log/stats.hpp"

class cond_t;
struct block_magic_t;
class io_backender_t;
class log_serializer_t;

/**
 * This is the log-structured serializer, the holiest of holies of
 * RethinkDB. Please treat it with courtesy, professionalism, and
 * respect that it deserves.
 */

struct log_serializer_metablock_t {
    extent_manager_t::metablock_mixin_t extent_manager_part;
    lba_list_t::metablock_mixin_t lba_index_part;
    data_block_manager_t::metablock_mixin_t data_block_manager_part;
    block_sequence_id_t block_sequence_id;
};

//  Data to be serialized to disk with each block.  Changing this changes the disk format!
// TODO: This header data should maybe go to the cache
typedef metablock_manager_t<log_serializer_metablock_t> mb_manager_t;

// Used internally
struct ls_start_existing_fsm_t;

class log_serializer_t :
#ifndef SEMANTIC_SERIALIZER_CHECK
    public serializer_t,
#else
    public home_thread_mixin_debug_t,
#endif  // SEMANTIC_SERIALIZER_CHECK
    private data_block_manager_t::shutdown_callback_t,
    private lba_list_t::shutdown_callback_t
{
    friend struct ls_start_existing_fsm_t;
    friend class data_block_manager_t;
    friend class dbm_read_ahead_fsm_t;
    friend class ls_block_token_pointee_t;

public:
    /* Serializer configuration. dynamic_config_t is everything that can be changed from run
    to run; static_config_t is the parameters that are set when the database is created and
    cannot be changed after that. */
    typedef log_serializer_private_dynamic_config_t private_dynamic_config_t;
    typedef log_serializer_dynamic_config_t dynamic_config_t;
    typedef log_serializer_static_config_t static_config_t;

    struct log_serializer_config_t {
        dynamic_config_t dynamic_config;
        private_dynamic_config_t private_dynamic_config;
        static_config_t static_config;

        explicit log_serializer_config_t(const std::string& file_name)
            : private_dynamic_config(file_name)
        { }

{'fraction_non_alphanumeric': 0.06298031865042174, 'fraction_numerical': 0.002999062792877226, 'mean_word_length': 5.2924528301886795, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '509602', 'n_tokens_mistral': 1832, 'n_tokens_neox': 1785, 'n_words': 403}