~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.h

  • Committer: Jay Pipes
  • Date: 2010-04-08 16:27:25 UTC
  • mfrom: (1405.6.10 replication-pairs)
  • mto: This revision was merged to the branch mainline in revision 1457.
  • Revision ID: jpipes@serialcoder-20100408162725-sugbgn38oxjqclq2
Merge trunk and replication-pairs with conflict resolution

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#ifndef DRIZZLED_TRANSACTION_SERVICES_H
26
26
#define DRIZZLED_TRANSACTION_SERVICES_H
27
27
 
 
28
#include "drizzled/atomics.h"
28
29
#include "drizzled/message/transaction.pb.h"
29
30
 
30
31
namespace drizzled
49
50
{
50
51
public:
51
52
  static const size_t DEFAULT_RECORD_SIZE= 100;
 
53
  typedef uint64_t TransactionId;
52
54
  /**
53
55
   * Constructor
54
56
   */
55
 
  TransactionServices() {}
 
57
  TransactionServices()
 
58
  {
 
59
    /**
 
60
     * @todo set transaction ID to the last one from an applier...
 
61
     */
 
62
    current_transaction_id= 0;
 
63
  }
56
64
 
57
65
  /**
58
66
   * Singleton method
388
396
                                      plugin::MonitoredInTransaction *monitored,
389
397
                                      plugin::TransactionalStorageEngine *engine,
390
398
                                      plugin::XaResourceManager *resource_manager);
 
399
  TransactionId getNextTransactionId()
 
400
  {
 
401
    return current_transaction_id.increment();
 
402
  }
 
403
  TransactionId getCurrentTransactionId()
 
404
  {
 
405
    return current_transaction_id;
 
406
  }
 
407
  /**
 
408
   * DEBUG ONLY.  See plugin::TransactionLog::truncate()
 
409
   */
 
410
  void resetTransactionId()
 
411
  {
 
412
    current_transaction_id= 0;
 
413
  }
 
414
private:
 
415
  atomic<TransactionId> current_transaction_id;
391
416
};
392
417
 
393
418
} /* namespace drizzled */