forked from mydumper/mydumper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
myloader.h
81 lines (70 loc) · 2.08 KB
/
myloader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Authors: Domas Mituzas, Facebook ( domas at fb dot com )
Mark Leith, Oracle Corporation (mark dot leith at oracle
dot com) Andrew Hutchings, SkySQL (andrew at skysql dot com)
*/
#ifndef _myloader_h
#define _myloader_h
enum restore_job_type { JOB_RESTORE_FILENAME, JOB_RESTORE_SCHEMA_STRING, JOB_RESTORE_STRING };
enum job_type { JOB_RESTORE, JOB_WAIT, JOB_SHUTDOWN};
enum purge_mode { NONE, DROP, TRUNCATE, DELETE };
struct configuration {
GAsyncQueue *pre_queue;
GAsyncQueue *queue;
GAsyncQueue *post_queue;
GAsyncQueue *ready;
GAsyncQueue *constraints_queue;
GList *table_list;
GList *schema_view_list;
GList *schema_triggers_list;
GList *schema_post_list;
GList *schema_create_list;
GList *checksum_list;
GMutex *mutex;
int done;
};
struct thread_data {
struct configuration *conf;
guint thread_id;
};
struct job {
enum job_type type;
void *job_data;
struct configuration *conf;
};
struct restore_job {
enum restore_job_type type;
struct db_table * dbt;
char *filename;
GString *statement;
guint part;
};
struct db_table {
char *database;
char *real_database;
char *table;
char *real_table;
guint64 rows;
GAsyncQueue * queue;
GList * restore_job_list;
guint current_threads;
guint max_threads;
GMutex *mutex;
GString *indexes;
GString *constraints;
guint count;
GDateTime * start_time;
GDateTime * start_index_time;
GDateTime * finish_time;
};
#endif