~ubuntu-branches/ubuntu/maverick/drizzle/maverick

« back to all changes in this revision

Viewing changes to plugin/transaction_log/transaction_log_applier.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems
 
5
 *  Copyright (c) 2010 Jay Pipes <jaypipes@gmail.com>
 
6
 *
 
7
 *  Authors:
 
8
 *
 
9
 *  Jay Pipes <jaypipes@gmail.com.com>
 
10
 *
 
11
 *  This program is free software; you can redistribute it and/or modify
 
12
 *  it under the terms of the GNU General Public License as published by
 
13
 *  the Free Software Foundation; either version 2 of the License, or
 
14
 *  (at your option) any later version.
 
15
 *
 
16
 *  This program is distributed in the hope that it will be useful,
 
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
 *  GNU General Public License for more details.
 
20
 *
 
21
 *  You should have received a copy of the GNU General Public License
 
22
 *  along with this program; if not, write to the Free Software
 
23
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
24
 */
 
25
 
 
26
/**
 
27
 * @file
 
28
 *
 
29
 * Defines the API of the transaction log applier.
 
30
 *
 
31
 * @see drizzled/plugin/replicator.h
 
32
 * @see drizzled/plugin/applier.h
 
33
 */
 
34
 
 
35
#ifndef PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_APPLIER_H
 
36
#define PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_APPLIER_H
 
37
 
 
38
#include <drizzled/replication_services.h>
 
39
#include <drizzled/plugin/transaction_applier.h>
 
40
 
 
41
#include "transaction_log_entry.h"
 
42
 
 
43
#include <vector>
 
44
#include <string>
 
45
 
 
46
class TransactionLog;
 
47
 
 
48
class TransactionLogApplier: public drizzled::plugin::TransactionApplier 
 
49
{
 
50
public:
 
51
  TransactionLogApplier(const std::string name_arg,
 
52
                        TransactionLog &in_transaction_log,
 
53
                        bool in_do_checksum);
 
54
 
 
55
  /** Destructor */
 
56
  ~TransactionLogApplier();
 
57
 
 
58
  /**
 
59
   * Applies a Transaction to the serial log
 
60
   *
 
61
   * @note
 
62
   *
 
63
   * It is important to note that memory allocation for the 
 
64
   * supplied pointer is not guaranteed after the completion 
 
65
   * of this function -- meaning the caller can dispose of the
 
66
   * supplied message.  Therefore, appliers which are
 
67
   * implementing an asynchronous replication system must copy
 
68
   * the supplied message to their own controlled memory storage
 
69
   * area.
 
70
   *
 
71
   * @param Transaction message to be replicated
 
72
   */
 
73
  void apply(const drizzled::message::Transaction &to_apply);
 
74
private:
 
75
  /* Don't allows these */
 
76
  TransactionLogApplier();
 
77
  TransactionLogApplier(const TransactionLogApplier &other);
 
78
  TransactionLogApplier &operator=(const TransactionLogApplier &other);
 
79
  TransactionLog &transaction_log;
 
80
  bool do_checksum; ///< Do a CRC32 checksum when writing Transaction message to log?
 
81
};
 
82
 
 
83
#endif /* PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_APPLIER_H */