~drizzle-trunk/drizzle/development

1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
5
 *
1039.5.46 by Jay Pipes
Tiny style and comment cleanups.
6
 *  Authors:
7
 *
8
 *  Jay Pipes <joinfu@sun.com>
9
 *
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
10
 *  This program is free software; you can redistribute it and/or modify
11
 *  it under the terms of the GNU General Public License as published by
12
 *  the Free Software Foundation; either version 2 of the License, or
13
 *  (at your option) any later version.
14
 *
15
 *  This program is distributed in the hope that it will be useful,
16
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 *  GNU General Public License for more details.
19
 *
20
 *  You should have received a copy of the GNU General Public License
21
 *  along with this program; if not, write to the Free Software
22
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23
 */
24
25
/**
26
 * @file
27
 *
1143.2.10 by Jay Pipes
Phase 2 new replication work:
28
 * Defines the API of a simple reader of Transaction messages from the
29
 * Transaction log file.  
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
30
 *
31
 * @details
32
 *
33
 * This class is used by other plugins, for instance
1143.2.10 by Jay Pipes
Phase 2 new replication work:
34
 * the async_replication module, in order to read the transaction log and
35
 * return Transaction messages.
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
36
 */
37
1143.2.24 by Jay Pipes
Fixes some stuff from make check (include guards). Also adds stuff for REPLACE logic that does not work.
38
#ifndef PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H
39
#define PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
40
1143.2.10 by Jay Pipes
Phase 2 new replication work:
41
#include <drizzled/plugin/transaction_reader.h>
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
42
1273.22.1 by Jay Pipes
Completes the blueprint for refactoring applier out of log descriptor.
43
class TransactionLog;
44
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
45
/**
1143.2.10 by Jay Pipes
Phase 2 new replication work:
46
 * A class which reads Transaction messages from the Transaction log file
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
47
 */
1143.2.10 by Jay Pipes
Phase 2 new replication work:
48
class TransactionLogReader :public drizzled::plugin::TransactionReader
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
49
{
50
private:
1143.2.10 by Jay Pipes
Phase 2 new replication work:
51
  /** The Transaction log object this reader uses */
52
  const TransactionLog &log;
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
53
public:
1143.2.18 by Jay Pipes
Merge trunk and resolve conflicts.
54
  TransactionLogReader(std::string name_arg, const TransactionLog &in_log)
55
    : drizzled::plugin::TransactionReader(name_arg), log(in_log)
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
56
  {}
57
58
  /** Destructor */
1143.2.10 by Jay Pipes
Phase 2 new replication work:
59
  ~TransactionLogReader() {}
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
60
  /**
1143.2.10 by Jay Pipes
Phase 2 new replication work:
61
   * Read and fill a Transaction message with the supplied
62
   * Transaction message global transaction ID.
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
63
   *
64
   * @param[in] Global transaction ID to find
1143.2.10 by Jay Pipes
Phase 2 new replication work:
65
   * @param[out] Pointer to a transaction message to fill
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
66
   *
67
   * @retval
1143.2.10 by Jay Pipes
Phase 2 new replication work:
68
   *  true if Transaction message was read successfully and the supplied pointer to message was filled
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
69
   * @retval
70
   *  false if not found or read successfully
71
   */
72
  bool read(const drizzled::ReplicationServices::GlobalTransactionId &to_read_trx_id, 
1143.2.10 by Jay Pipes
Phase 2 new replication work:
73
            drizzled::message::Transaction *to_fill);
1039.5.41 by Jay Pipes
Adds a new plugin class interface for a reader of Command messages,
74
};
75
1143.2.23 by Jay Pipes
Merge trunk and resolve all conflicts.
76
#endif /* PLUGIN_TRANSACTION_LOG_TRANSACTION_LOG_READER_H */