1/******************************************************
2XtraBackup: hot backup tool for InnoDB
3(c) 2009-2013 Percona LLC and/or its affiliates.
4Originally Created 3/3/2009 Yasufumi Kinoshita
5Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko,
6Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
20
21*******************************************************/
22
23/* Page write filter interface */
24
25#ifndef XB_WRITE_FILT_H
26#define XB_WRITE_FILT_H
27
28#include "fil_cur.h"
29#include "datasink.h"
30
31/* Incremental page filter context */
32typedef struct {
33 ulint delta_buf_size;
34 byte *delta_buf;
35 ulint npages;
36} xb_wf_incremental_ctxt_t;
37
38/* Page filter context used as an opaque structure by callers */
39typedef struct {
40 xb_fil_cur_t *cursor;
41 union {
42 xb_wf_incremental_ctxt_t wf_incremental_ctxt;
43 } u;
44} xb_write_filt_ctxt_t;
45
46
47typedef struct {
48 my_bool (*init)(xb_write_filt_ctxt_t *ctxt, char *dst_name,
49 xb_fil_cur_t *cursor);
50 my_bool (*process)(xb_write_filt_ctxt_t *ctxt, ds_file_t *dstfile);
51 my_bool (*finalize)(xb_write_filt_ctxt_t *, ds_file_t *dstfile);
52 void (*deinit)(xb_write_filt_ctxt_t *);
53} xb_write_filt_t;
54
55extern xb_write_filt_t wf_write_through;
56extern xb_write_filt_t wf_incremental;
57
58#endif /* XB_WRITE_FILT_H */
59