1 | /****************************************************** |
2 | XtraBackup: hot backup tool for InnoDB |
3 | (c) 2009-2013 Percona LLC and/or its affiliates. |
4 | Originally Created 3/3/2009 Yasufumi Kinoshita |
5 | Written by Alexey Kopytov, Aleksandr Kuzminsky, Stewart Smith, Vadim Tkachenko, |
6 | Yasufumi Kinoshita, Ignacio Nin and Baron Schwartz. |
7 | |
8 | This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; version 2 of the License. |
11 | |
12 | This program is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU General Public License |
18 | along with this program; if not, write to the Free Software |
19 | Foundation, 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 */ |
32 | typedef 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 */ |
39 | typedef 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 | |
47 | typedef 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 | |
55 | extern xb_write_filt_t wf_write_through; |
56 | extern xb_write_filt_t wf_incremental; |
57 | |
58 | #endif /* XB_WRITE_FILT_H */ |
59 | |