1/* Copyright (C) 2013 Codership Oy <info@codership.com>
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License along
13 with this program; if not, write to the Free Software Foundation, Inc.,
14 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
15
16#ifndef WSREP_BINLOG_H
17#define WSREP_BINLOG_H
18
19#include "sql_class.h" // THD, IO_CACHE
20
21#define HEAP_PAGE_SIZE 65536 /* 64K */
22#define WSREP_MAX_WS_SIZE 2147483647 /* 2GB */
23
24/*
25 Write the contents of a cache to a memory buffer.
26
27 This function quite the same as MYSQL_BIN_LOG::write_cache(),
28 with the exception that here we write in buffer instead of log file.
29 */
30int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len);
31
32/*
33 Write the contents of a cache to wsrep provider.
34
35 This function quite the same as MYSQL_BIN_LOG::write_cache(),
36 with the exception that here we write in buffer instead of log file.
37
38 @param len total amount of data written
39 @return wsrep error status
40 */
41int wsrep_write_cache (wsrep_t* const wsrep,
42 THD* const thd,
43 IO_CACHE* const cache,
44 size_t* const len);
45
46/* Dump replication buffer to disk */
47void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len);
48
49/* Dump replication buffer to disk without intermediate buffer */
50void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache);
51
52/* Dump replication buffer along with header to a file */
53void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf,
54 size_t buf_len);
55
56int wsrep_binlog_close_connection(THD* thd);
57int wsrep_binlog_savepoint_set(THD *thd, void *sv);
58int wsrep_binlog_savepoint_rollback(THD *thd, void *sv);
59
60#endif /* WSREP_BINLOG_H */
61