~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/transaction_log/transaction_log.cc

  • Committer: lbieber
  • Date: 2010-08-23 22:45:16 UTC
  • mfrom: (1727.2.1 staging)
  • Revision ID: lbieber@orisndriz03-20100823224516-k12j5r4znqnznr9d
Merge Vijay - bug 621866 - Changed --transaction-log.sync-method to --transaction-log.flush-frequency
Merge Lee - bug 622005 updateing test results that need to sorted by adding --sorted_result - 
Merge Andrew - bug #617537 re-connect connectionID is wrong 
Merge Andrew - bug #617534 incorrect error when reconnecting

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
TransactionLog *transaction_log= NULL; /* The singleton transaction log */
97
97
 
98
98
TransactionLog::TransactionLog(const string in_log_file_path,
99
 
                               uint32_t in_sync_method,
 
99
                               uint32_t in_flush_frequency,
100
100
                               bool in_do_checksum) : 
101
101
    state(OFFLINE),
102
102
    log_file_path(in_log_file_path),
103
103
    has_error(false),
104
104
    error_message(),
105
 
    sync_method(in_sync_method),
 
105
    flush_frequency(in_flush_frequency),
106
106
    do_checksum(in_do_checksum)
107
107
{
108
108
  /* Setup our log file and determine the next write offset... */
241
241
 
242
242
int TransactionLog::syncLogFile()
243
243
{
244
 
  switch (sync_method)
 
244
  switch (flush_frequency)
245
245
  {
246
 
  case SYNC_METHOD_EVERY_WRITE:
 
246
  case FLUSH_FREQUENCY_EVERY_WRITE:
247
247
    return internal::my_sync(log_file, 0);
248
 
  case SYNC_METHOD_EVERY_SECOND:
 
248
  case FLUSH_FREQUENCY_EVERY_SECOND:
249
249
    {
250
250
      time_t now_time= time(NULL);
251
251
      if (last_sync_time <= (now_time - 1))
255
255
      }
256
256
      return 0;
257
257
    }
258
 
  case SYNC_METHOD_OS:
 
258
  case FLUSH_FREQUENCY_OS:
259
259
  default:
260
260
    return 0;
261
261
  }