~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/archive/concurrency_test.cc

* Completes the blueprint for splitting the XA Resource Manager
  API from the storage engine API:

We add a new plugin::XaResourceManager abstract interface class
which exposes the X/Open XA distributed transaction protocol for
resource managers.

We add a new plugin::MonitoredInTransaction base class from
which all plugins that need monitored by Drizzle's transaction
manager (drizzled::TransactionServices component) derive.

All plugin::StorageEngine's now derive from plugin::MonitoredInTransaction
since all storage engines a monitored by the transaction manager
and the Session keeps a "slot" available for keeping the engine's
per-session data state.  In a future patch, the transaction log's
XaApplier plugin will also derive from MonitoredInTransaction, as
the transaction log, in XA mode, is also monitored by Drizzle's
transaction manager and automatically enlisted in XA transactions.

* Updates all documentation in /drizzled/transaction_services.cc
  to accurately reflect Drizzle's new transaction management
  process and explicit transaction and statement boundaries.

* Kills off dead code:

  binlog_format_names
  ha_init()
  total_ha, total_ha_2pc (no longer necessary, as the above-mentioned
  abstract base classes provide all of this functionality)
  StorageEngine::slot (now plugin::MonitoredInTransaction::getId())
  TransactionalStorageEngine::two_phase_commit (same as above)

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) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
21
21
  Just a test application for threads.
22
22
  */
23
23
 
24
 
#include <config.h>
 
24
#include "config.h"
25
25
 
26
26
#include "azio.h"
 
27
#include "drizzled/my_getopt.h"
27
28
#include <stdio.h>
28
29
#include <stdlib.h>
29
30
#include <sys/types.h>
37
38
#ifndef __WIN__
38
39
#include <sys/wait.h>
39
40
#endif
40
 
#include <memory>
41
41
 
42
42
#ifdef __WIN__
43
43
#define srandom  srand
45
45
#define snprintf _snprintf
46
46
#endif
47
47
 
48
 
#include <boost/scoped_ptr.hpp>
49
 
 
50
48
#include "azio.h"
51
49
 
52
 
#define DEFAULT_CONCURRENCY     10
53
50
#define DEFAULT_INITIAL_LOAD 10000
54
51
#define DEFAULT_EXECUTE_SECONDS 120
55
52
#define TEST_FILENAME "concurrency_test.az"
140
137
{
141
138
  unsigned int x;
142
139
  uint64_t total;
143
 
  boost::scoped_ptr<azio_stream> writer_handle_ap(new azio_stream);
144
 
  azio_stream &writer_handle= *writer_handle_ap.get();
 
140
  azio_stream writer_handle;
145
141
  thread_context_st *context;
146
142
  pthread_t mainthread;            /* Thread descriptor */
147
143
  pthread_attr_t attr;          /* Thread attributes */
268
264
  uint64_t count;
269
265
  int ret;
270
266
  int error;
271
 
  boost::scoped_ptr<azio_stream> reader_handle_ap(new azio_stream);
272
 
  azio_stream &reader_handle= *reader_handle_ap.get();
 
267
  azio_stream reader_handle;
273
268
 
274
269
  if (!(ret= azopen(&reader_handle, TEST_FILENAME, O_RDONLY,
275
270
                    context->use_aio)))