<commit_before>#include "datatypes.h"
#include "settings.h"

#include "../../template_db/file_blocks.h"
#include "../../template_db/file_blocks_index.h"
#include "../../template_db/random_file_index.h"

#include <cstdio>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <sys/types.h>
#include <unistd.h>

template < typename TVal >
struct OSM_File_Properties : public File_Properties
{
  OSM_File_Properties(string file_base_name_, uint32 block_size_,
		      uint32 map_block_size_)
    : file_base_name(file_base_name_), block_size(block_size_),
      map_block_size(map_block_size_ > 0 ? map_block_size_*TVal::max_size_of() : 0) {}
  
  string get_file_name_trunk() const { return file_base_name; }
  
  string get_index_suffix() const { return basic_settings().INDEX_SUFFIX; }
  string get_data_suffix() const { return basic_settings().DATA_SUFFIX; }
  string get_id_suffix() const { return basic_settings().ID_SUFFIX; }  
  string get_shadow_suffix() const { return basic_settings().SHADOW_SUFFIX; }
  
  uint32 get_block_size() const { return block_size; }
  uint32 get_map_block_size() const { return map_block_size; }
  
  vector< bool > get_data_footprint(const string& db_dir) const
  {
    return get_data_index_footprint< TVal >(*this, db_dir);
  }
  
  vector< bool > get_map_footprint(const string& db_dir) const
  {
    return get_map_index_footprint(*this, db_dir);
  }
  
  uint32 id_max_size_of() const
  {
    return TVal::max_size_of();
  }
  
  File_Blocks_Index_Base* new_data_index
      (bool writeable, bool use_shadow, string db_dir, string file_name_extension)
      const
  {
    return new File_Blocks_Index< TVal >
        (*this, writeable, use_shadow, db_dir, file_name_extension);
  }

  string file_base_name;
  uint32 block_size;
  uint32 map_block_size;
};

//-----------------------------------------------------------------------------

Basic_Settings::Basic_Settings()
:
  DATA_SUFFIX(".bin"),
  INDEX_SUFFIX(".idx"),
  ID_SUFFIX(".map"),
  SHADOW_SUFFIX(".shadow"),

  base_directory("./"),
  logfile_name("transactions.log"),
  shared_name_base("/osm3s_v0.6.90")
{}

Basic_Settings& basic_settings()
{<commit_msg>Incremented version counter for shared name.<commit_after>#include "datatypes.h"
#include "settings.h"

#include "../../template_db/file_blocks.h"
#include "../../template_db/file_blocks_index.h"
#include "../../template_db/random_file_index.h"

#include <cstdio>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <sys/types.h>
#include <unistd.h>

template < typename TVal >
struct OSM_File_Properties : public File_Properties
{
  OSM_File_Properties(string file_base_name_, uint32 block_size_,
		      uint32 map_block_size_)
    : file_base_name(file_base_name_), block_size(block_size_),
      map_block_size(map_block_size_ > 0 ? map_block_size_*TVal::max_size_of() : 0) {}
  
  string get_file_name_trunk() const { return file_base_name; }
  
  string get_index_suffix() const { return basic_settings().INDEX_SUFFIX; }
  string get_data_suffix() const { return basic_settings().DATA_SUFFIX; }
  string get_id_suffix() const { return basic_settings().ID_SUFFIX; }  
  string get_shadow_suffix() const { return basic_settings().SHADOW_SUFFIX; }
  
  uint32 get_block_size() const { return block_size; }
  uint32 get_map_block_size() const { return map_block_size; }
  
  vector< bool > get_data_footprint(const string& db_dir) const
  {
    return get_data_index_footprint< TVal >(*this, db_dir);
  }
  
  vector< bool > get_map_footprint(const string& db_dir) const
  {
    return get_map_index_footprint(*this, db_dir);
  }
  
  uint32 id_max_size_of() const
  {
    return TVal::max_size_of();
  }
  
  File_Blocks_Index_Base* new_data_index
      (bool writeable, bool use_shadow, string db_dir, string file_name_extension)
      const
  {
    return new File_Blocks_Index< TVal >
        (*this, writeable, use_shadow, db_dir, file_name_extension);
  }

  string file_base_name;
  uint32 block_size;
  uint32 map_block_size;
};

//-----------------------------------------------------------------------------

Basic_Settings::Basic_Settings()
:
  DATA_SUFFIX(".bin"),
  INDEX_SUFFIX(".idx"),
  ID_SUFFIX(".map"),
  SHADOW_SUFFIX(".shadow"),

  base_directory("./"),
  logfile_name("transactions.log"),
  shared_name_base("/osm3s_v0.6.91")
{}

Basic_Settings& basic_settings()
{
{'fraction_non_alphanumeric': 0.15199279441567215, 'fraction_numerical': 0.009457329430308489, 'mean_word_length': 3.9410456062291437, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '6867577', 'n_tokens_mistral': 1592, 'n_tokens_neox': 1552, 'n_words': 287}