~dshrews/drizzle/bug656474

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: lbieber
  • Date: 2010-10-06 19:12:01 UTC
  • mfrom: (1817.1.3 build)
  • Revision ID: lbieber@orisndriz08-20101006191201-fp7wgds0ykr14d21
Merge Monty - First pass at our own custom config file parser to work around bugs in the ubuntu lucid version of boost
Merge Patrick G. - Fix to compile on OS X
Merge Joe - make transaction_message_threshold configurable on the command line

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <stdexcept>
32
32
 
33
33
#include <boost/program_options.hpp>
 
34
#include "drizzled/program_options/config_file.h"
34
35
#include <boost/thread/recursive_mutex.hpp>
35
36
#include <boost/thread/mutex.hpp>
36
37
#include <boost/thread/condition_variable.hpp>
139
140
using namespace std;
140
141
namespace fs=boost::filesystem;
141
142
namespace po=boost::program_options;
 
143
namespace dpo=drizzled::program_options;
142
144
 
143
145
 
144
146
namespace drizzled
1058
1060
  global_system_variables.tmp_table_size= in_tmp_table_size;
1059
1061
}
1060
1062
 
 
1063
static void check_limits_transaction_message_threshold(size_t in_transaction_message_threshold)
 
1064
{
 
1065
  global_system_variables.transaction_message_threshold= 1024*1024;
 
1066
  if ((int64_t) in_transaction_message_threshold < 128*1024 || (int64_t)in_transaction_message_threshold > 1024*1024)
 
1067
  {
 
1068
    cout << N_("Error: Invalid Value for transaction_message_threshold valid values are between 131072 - 1048576 bytes");
 
1069
    exit(-1);
 
1070
  }
 
1071
  global_system_variables.transaction_message_threshold= in_transaction_message_threshold;
 
1072
}
 
1073
 
1061
1074
static pair<string, string> parse_size_suffixes(string s)
1062
1075
{
1063
1076
  size_t equal_pos= s.find("=");
1135
1148
    ifstream input_defaults_file(file_location.c_str());
1136
1149
    
1137
1150
    po::parsed_options file_parsed=
1138
 
      po::parse_config_file(input_defaults_file, full_options, true);
 
1151
      dpo::parse_config_file(input_defaults_file, full_options, true);
1139
1152
    vector<string> file_unknown= 
1140
1153
      po::collect_unrecognized(file_parsed.options, po::include_positional);
1141
1154
 
1300
1313
  N_("Path for temporary files."))
1301
1314
  ("transaction-isolation", po::value<string>(),
1302
1315
  N_("Default transaction isolation level."))
 
1316
  ("transaction-message-threshold", po::value<size_t>(&global_system_variables.transaction_message_threshold)->default_value(1024*1024)->notifier(&check_limits_transaction_message_threshold),
 
1317
  N_("Max message size written to transaction log, valid values 131072 - 1048576 bytes."))
1303
1318
  ("user,u", po::value<string>(),
1304
1319
  N_("Run drizzled daemon as user."))  
1305
1320
  ("version,V",