2007-08-10 21:15:17 +00:00
|
|
|
#include "yerror.h"
|
|
|
|
#include <stdio.h>
|
2007-09-28 17:11:22 +00:00
|
|
|
#include "log.h"
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2007-08-10 21:15:17 +00:00
|
|
|
|
2007-10-19 17:05:10 +00:00
|
|
|
#define LOGGER_BUF_SIZE (1<<24)
|
2007-08-10 19:24:45 +00:00
|
|
|
struct tokulogger {
|
|
|
|
enum typ_tag tag;
|
|
|
|
char *directory;
|
2007-08-10 21:39:55 +00:00
|
|
|
int fd;
|
|
|
|
int n_in_file;
|
|
|
|
long long next_log_file_number;
|
2007-11-14 17:58:38 +00:00
|
|
|
LSN lsn;
|
2007-08-10 19:24:45 +00:00
|
|
|
char buf[LOGGER_BUF_SIZE];
|
|
|
|
int n_in_buf;
|
|
|
|
};
|
2007-08-10 21:15:17 +00:00
|
|
|
|
|
|
|
int tokulogger_find_next_unused_log_file(const char *directory, long long *result);
|
2007-09-28 17:11:22 +00:00
|
|
|
|
2007-11-21 13:07:49 +00:00
|
|
|
enum lt_command {
|
2007-11-14 17:58:38 +00:00
|
|
|
LT_COMMIT = 'C',
|
|
|
|
LT_DELETE = 'D',
|
2007-11-19 23:47:44 +00:00
|
|
|
LT_FCREATE = 'F',
|
2007-11-21 13:07:49 +00:00
|
|
|
LT_FHEADER = 'H',
|
2007-11-14 17:58:38 +00:00
|
|
|
LT_INSERT_WITH_NO_OVERWRITE = 'I',
|
2007-11-20 21:20:05 +00:00
|
|
|
LT_FOPEN = 'O',
|
2007-11-14 17:58:38 +00:00
|
|
|
LT_CHECKPOINT = 'P',
|
2007-11-18 12:48:36 +00:00
|
|
|
LT_BLOCK_RENAME = 'R',
|
|
|
|
LT_UNLINK = 'U'
|
2007-11-14 17:58:38 +00:00
|
|
|
};
|
2007-09-28 17:11:22 +00:00
|
|
|
|
|
|
|
struct tokutxn {
|
|
|
|
u_int64_t txnid64;
|
|
|
|
TOKULOGGER logger;
|
2007-10-19 17:05:10 +00:00
|
|
|
TOKUTXN parent;
|
2007-09-28 17:11:22 +00:00
|
|
|
};
|