~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/xa_resource_manager.h

  • Committer: Djellel E. Difallah
  • Date: 2010-03-27 10:10:49 UTC
  • mto: This revision was merged to the branch mainline in revision 1429.
  • Revision ID: ded@ubuntu-20100327101049-oo3arvatjoyku124
merge my_decimal and decimal

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
 
 *  Copyright (C) 2010 Jay Pipes <jaypipes@gmail.com>
 
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *  Copyright (c) 2010 Jay Pipes <jaypipes@gmail.com>
6
6
 *
7
7
 *  This program is free software; you can redistribute it and/or modify
8
8
 *  it under the terms of the GNU General Public License as published by
21
21
#ifndef DRIZZLED_PLUGIN_XA_RESOURCE_MANAGER_H
22
22
#define DRIZZLED_PLUGIN_XA_RESOURCE_MANAGER_H
23
23
 
24
 
#include <boost/unordered_set.hpp>
25
 
 
26
 
#include <drizzled/visibility.h>
27
 
 
28
24
namespace drizzled
29
25
{
30
26
 
37
33
 * An abstract interface class which exposes the participation
38
34
 * of implementing classes in distributed transactions in the XA protocol.
39
35
 */
40
 
class DRIZZLED_API XaResourceManager
 
36
class XaResourceManager
41
37
{
42
38
public:
43
39
  XaResourceManager() {}
73
69
    return doXaRecover(append_to, len);
74
70
  }
75
71
 
76
 
  uint64_t getCurrentTransactionId(Session *session)
77
 
  {
78
 
    return doGetCurrentTransactionId(session);
79
 
  }
80
 
 
81
 
  uint64_t getNewTransactionId(Session *session)
82
 
  {
83
 
    return doGetNewTransactionId(session);
84
 
  }
85
 
 
86
 
  typedef ::boost::unordered_set<my_xid> commit_list_set;
87
72
  /** 
88
73
   * The below static class methods wrap the interaction
89
74
   * of the vector of registered XA storage engines.
90
75
   */
91
76
  static int commitOrRollbackXID(XID *xid, bool commit);
92
 
  static int recoverAllXids();
93
 
  static int recoverAllXids(const commit_list_set& commit_list);
 
77
  static int recoverAllXids(HASH *commit_list);
94
78
 
95
79
  /* Class Methods for operating on plugin */
96
80
  static bool addPlugin(plugin::XaResourceManager *manager);
129
113
   *  for this engine.
130
114
   */
131
115
  virtual int doXaRecover(XID * append_to, size_t len)= 0;
132
 
 
133
 
  virtual uint64_t doGetCurrentTransactionId(Session *session)= 0;
134
 
 
135
 
  virtual uint64_t doGetNewTransactionId(Session *session)= 0;
136
116
};
137
117
 
138
118
} /* namespace plugin */