~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/filtered_replicator/filtered_replicator.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-12-09 06:02:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: james.westby@ubuntu.com-20101209060239-t0ujftvcvd558yno
Tags: upstream-2010.12.05
ImportĀ upstreamĀ versionĀ 2010.12.05

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
#include <vector>
39
39
#include <string>
40
40
 
41
 
class FilteredReplicator: public drizzled::plugin::TransactionReplicator
 
41
namespace drizzle_plugin
 
42
{
 
43
 
 
44
class FilteredReplicator :
 
45
  public drizzled::plugin::TransactionReplicator
42
46
{
43
47
public:
44
48
  FilteredReplicator(std::string name_arg,
45
 
                     const char *in_sch_filters,
46
 
                     const char *in_tab_filters);
 
49
                     const std::string &sch_filter,
 
50
                     const std::string &tab_filter,
 
51
                     const std::string &sch_regex,
 
52
                     const std::string &tab_regex);
47
53
 
48
54
  /** Destructor */
49
55
  ~FilteredReplicator();
84
90
   */
85
91
  const std::string &getSchemaFilter() const
86
92
  {
87
 
    return sch_filter_string;
 
93
    return _sch_filter;
88
94
  }
89
95
 
90
96
  /**
101
107
   */
102
108
  const std::string &getTableFilter() const
103
109
  {
104
 
    return tab_filter_string;
 
110
    return _tab_filter;
105
111
  }
106
112
 
107
113
  /**
112
118
   */
113
119
  void updateTableSysvar(const char **var_ptr)
114
120
  {
115
 
    *var_ptr= tab_filter_string.c_str();
 
121
    *var_ptr= _tab_filter.c_str();
116
122
    pthread_mutex_unlock(&sysvar_tab_lock);
117
123
  }
118
124
 
124
130
   */
125
131
  void updateSchemaSysvar(const char **var_ptr)
126
132
  {
127
 
    *var_ptr= sch_filter_string.c_str();
 
133
    *var_ptr= _sch_filter.c_str();
128
134
    pthread_mutex_unlock(&sysvar_sch_lock);
129
135
  }
130
136
 
199
205
   * Variables to contain the string representation of the
200
206
   * comma-separated lists of schemas and tables to filter.
201
207
   */
202
 
  std::string sch_filter_string;
203
 
  std::string tab_filter_string;
 
208
  std::string _sch_filter;
 
209
  std::string _tab_filter;
 
210
 
 
211
  const std::string _sch_regex;
 
212
  const std::string _tab_regex;
204
213
 
205
214
  /*
206
215
   * We need locks to protect the vectors when they are
220
229
  pthread_mutex_t sysvar_sch_lock;
221
230
  pthread_mutex_t sysvar_tab_lock;
222
231
 
223
 
  bool sch_regex_enabled;
224
 
  bool tab_regex_enabled;
225
 
 
226
232
  pcre *sch_re;
227
233
  pcre *tab_re;
228
234
};
229
235
 
 
236
} /* namespace drizzle_plugin */
 
237
 
230
238
#endif /* PLUGIN_FILTERED_REPLICATOR_FILTERED_REPLICATOR_H */