~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/Defs_ms.h

Added the PBMS daemon plugin.

(Augen zu und durch!)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
 
2
 *
 
3
 * PrimeBase Media Stream for MySQL
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
18
 *
 
19
 * Original author: Paul McCullagh (H&G2JCtL)
 
20
 * Continued development: Barry Leslie
 
21
 *
 
22
 * 2007-07-04
 
23
 *
 
24
 * Global definitions.
 
25
 *
 
26
 */
 
27
 
 
28
#ifndef __DEFS_MS_H__
 
29
#define __DEFS_MS_H__
 
30
 
 
31
#include "CSDefs.h"
 
32
 
 
33
#define MS_IDENTIFIER_CHAR_COUNT        64
 
34
 
 
35
#define MS_IDENTIFIER_NAME_SIZE         ((MS_IDENTIFIER_CHAR_COUNT * 3) + 1)    // The identifier length as UTF-8
 
36
 
 
37
#define MS_TABLE_NAME_SIZE                      MS_IDENTIFIER_NAME_SIZE                                 // The maximum length of a table name 
 
38
#define MS_DATABASE_NAME_SIZE           MS_IDENTIFIER_NAME_SIZE
 
39
 
 
40
#define MS_TABLE_URL_SIZE                       (MS_DATABASE_NAME_SIZE + MS_TABLE_NAME_SIZE)
 
41
 
 
42
#define MS_CONNECTION_THREAD            1000
 
43
#define MS_TEMP_LOG_THREAD                      1001
 
44
#define MS_COMPACTOR_THREAD                     1002
 
45
 
 
46
#ifdef DEBUG
 
47
#define MS_DEFAULT_TEMP_LOG_WAIT        (200*60)
 
48
 
 
49
// Set MS_DEFAULT_TEMP_LOG_WAIT high to prevent 
 
50
// BLOBs from being deleted while walking through 
 
51
// the code in the debugger.
 
52
//#define MS_DEFAULT_TEMP_LOG_WAIT      (200*60) 
 
53
#else
 
54
#define MS_DEFAULT_TEMP_LOG_WAIT        (10*60)
 
55
#endif
 
56
 
 
57
/* Default compactor wait time in seconds! */
 
58
#define MS_COMPACTOR_POLLS
 
59
#ifdef MS_COMPACTOR_POLLS
 
60
#ifdef DEBUG
 
61
#define MS_COMPACTOR_POLL_FREQ          1000            // milli-seconds
 
62
#else
 
63
#define MS_COMPACTOR_POLL_FREQ          3000
 
64
#endif
 
65
#else
 
66
#ifdef DEBUG
 
67
#define MS_DEFAULT_COMPACTOR_WAIT       120
 
68
#else
 
69
#define MS_DEFAULT_COMPACTOR_WAIT       30
 
70
#endif
 
71
#endif
 
72
 
 
73
#ifdef DEBUG
 
74
//#define MS_DEFAULT_GARBAGE_LEVEL      1
 
75
#define MS_DEFAULT_GARBAGE_LEVEL        10
 
76
#else
 
77
#define MS_DEFAULT_GARBAGE_LEVEL        50
 
78
#endif
 
79
 
 
80
#ifdef DEBUG
 
81
#define MS_REPO_THRESHOLD_DEF           "20MB"
 
82
//#define MS_REPO_THRESHOLD_DEF         "32K"
 
83
#else
 
84
#define MS_REPO_THRESHOLD_DEF           "128MB"
 
85
#endif
 
86
 
 
87
#ifdef DEBUG
 
88
#define MS_TEMP_LOG_THRESHOLD_DEF       "32K"
 
89
#else
 
90
#define MS_TEMP_LOG_THRESHOLD_DEF       "32MB"
 
91
#endif
 
92
 
 
93
#define MS_HTTP_METADATA_HEADERS_DEF "Content-Type"
 
94
 
 
95
#ifdef DEBUG
 
96
#define MS_COMPACTOR_BUFFER_SIZE        (4*1024)
 
97
#else
 
98
#define MS_COMPACTOR_BUFFER_SIZE        (64*1024)
 
99
#endif
 
100
 
 
101
#define MS_BACKUP_BUFFER_SIZE MS_COMPACTOR_BUFFER_SIZE
 
102
 
 
103
/*
 
104
 * The time (in seconds) that a connection thread will stay alive, when it is idle:
 
105
 */
 
106
#ifdef DEBUG
 
107
#define MS_IDLE_THREAD_TIMEOUT          (10)
 
108
#else
 
109
#define MS_IDLE_THREAD_TIMEOUT          (40)
 
110
#endif
 
111
 
 
112
/*
 
113
 * The timeout, in milli-seconds, before the HTTP server will close an inactive HTTP connection.
 
114
*/
 
115
#define MS_DEFAULT_KEEP_ALIVE           (10) 
 
116
 
 
117
#ifdef DRIZZLED
 
118
/* Drizzle is stuck at this level: */
 
119
#define MYSQL_VERSION_ID                                        60005
 
120
 
 
121
#define TABLE_LIST                                                      TableList
 
122
#define TABLE                                                           Table
 
123
#define TABLE_SHARE                                                     TableShare
 
124
#define THD                                                                     Session
 
125
#define MYSQL_THD                                                       Session *
 
126
#define THR_THD                                                         THR_Session
 
127
#define STRUCT_TABLE                                            class Table
 
128
#define MY_BITMAP                                                       MyBitmap
 
129
 
 
130
#define MYSQL_TYPE_TIMESTAMP                            DRIZZLE_TYPE_TIMESTAMP
 
131
#define MYSQL_TYPE_LONG                                         DRIZZLE_TYPE_LONG
 
132
#define MYSQL_TYPE_SHORT                                        DRIZZLE_TYPE_LONG
 
133
#define MYSQL_TYPE_STRING                                       DRIZZLE_TYPE_VARCHAR
 
134
#define MYSQL_TYPE_VARCHAR                                      DRIZZLE_TYPE_VARCHAR
 
135
#define MYSQL_TYPE_LONGLONG                                     DRIZZLE_TYPE_LONGLONG
 
136
#define MYSQL_TYPE_BLOB                                         DRIZZLE_TYPE_BLOB
 
137
#define MYSQL_TYPE_LONG_BLOB                            DRIZZLE_TYPE_BLOB
 
138
#define MYSQL_TYPE_ENUM                                         DRIZZLE_TYPE_ENUM
 
139
#define MYSQL_PLUGIN_VAR_HEADER                         DRIZZLE_PLUGIN_VAR_HEADER
 
140
#define MYSQL_SYSVAR_STR                                        DRIZZLE_SYSVAR_STR
 
141
#define MYSQL_SYSVAR_INT                                        DRIZZLE_SYSVAR_INT
 
142
#define MYSQL_SYSVAR                                            DRIZZLE_SYSVAR
 
143
#define MYSQL_SYSVAR_ULONG                                      DRIZZLE_SYSVAR_ULONG
 
144
#define MYSQL_SYSVAR_BOOL                                       DRIZZLE_SYSVAR_BOOL
 
145
#define MYSQL_STORAGE_ENGINE_PLUGIN                     DRIZZLE_STORAGE_ENGINE_PLUGIN
 
146
#define MYSQL_INFORMATION_SCHEMA_PLUGIN         DRIZZLE_INFORMATION_SCHEMA_PLUGIN
 
147
#define memcpy_fixed                                            memcpy
 
148
#define bfill(m, len, ch)                                       memset(m, ch, len)
 
149
 
 
150
#define mx_tmp_use_all_columns(x, y)            (x)->use_all_columns(y)
 
151
#define mx_tmp_restore_column_map(x, y)         (x)->restore_column_map(y)
 
152
 
 
153
#define MX_TABLE_TYPES_T                                        handler::Table_flags
 
154
#define MX_UINT8_T                                                      uint8_t
 
155
#define MX_ULONG_T                                                      uint32_t
 
156
#define MX_ULONGLONG_T                                          uint64_t
 
157
#define MX_LONGLONG_T                                           uint64_t
 
158
#define MX_CHARSET_INFO                                         struct charset_info_st
 
159
#define MX_CONST_CHARSET_INFO                           const struct charset_info_st                    
 
160
#define MX_CONST                                                        const
 
161
#define my_bool                                                         bool
 
162
#define int16                                                           int16_t
 
163
#define int32                                                           int32_t
 
164
#define uint16                                                          uint16_t
 
165
#define uint32                                                          uint32_t
 
166
#define uchar                                                           unsigned char
 
167
#define longlong                                                        int64_t
 
168
#define ulonglong                                                       uint64_t
 
169
 
 
170
#define HAVE_LONG_LONG
 
171
 
 
172
#define my_malloc(x, y)                                         malloc(x)
 
173
#define my_free(x, y)                                           free(x)
 
174
 
 
175
#define HA_CAN_SQL_HANDLER                                      0
 
176
#define HA_CAN_INSERT_DELAYED                           0
 
177
#define HA_BINLOG_ROW_CAPABLE                           0
 
178
 
 
179
#define max                                                                     cmax
 
180
#define min                                                                     cmin
 
181
 
 
182
#define NullS                                                           NULL
 
183
 
 
184
#define current_thd                                                     current_session
 
185
#define thd_charset                                                     session_charset
 
186
#define thd_query                                                       session_query
 
187
#define thd_slave_thread                                        session_slave_thread
 
188
#define thd_non_transactional_update            session_non_transactional_update
 
189
#define thd_binlog_format                                       session_binlog_format
 
190
#define thd_mark_transaction_to_rollback        session_mark_transaction_to_rollback
 
191
#define thd_ha_data                                                     session_ha_data
 
192
#define current_thd                                                     current_session
 
193
#define thd_sql_command                                         session_sql_command
 
194
#define thd_test_options                                        session_test_options
 
195
#define thd_killed                                                      session_killed
 
196
#define thd_tx_isolation                                        session_tx_isolation
 
197
#define thd_in_lock_tables                                      session_in_lock_tables
 
198
#define thd_tablespace_op                                       session_tablespace_op
 
199
#define thd_alloc                                                       session_alloc
 
200
#define thd_make_lex_string                                     session_make_lex_string
 
201
 
 
202
#define my_pthread_setspecific_ptr(T, V)        pthread_setspecific(T, (void*) (V))
 
203
 
 
204
#define mysql_real_data_home                            drizzle_real_data_home
 
205
 
 
206
#else // DRIZZLED
 
207
/* The MySQL case: */
 
208
#define STRUCT_TABLE                                            struct st_table
 
209
 
 
210
#define mx_tmp_use_all_columns                          dbug_tmp_use_all_columns
 
211
#define mx_tmp_restore_column_map(x, y)         dbug_tmp_restore_column_map((x)->read_set, y)
 
212
 
 
213
#define MX_TABLE_TYPES_T                                        ulonglong
 
214
#define MX_UINT8_T                                                      uint8
 
215
#define MX_ULONG_T                                                      ulong
 
216
#define MX_ULONGLONG_T                                          ulonglong
 
217
#define MX_LONGLONG_T                                           longlong
 
218
#define MX_CHARSET_INFO                                         CHARSET_INFO
 
219
#define MX_CONST_CHARSET_INFO                           struct charset_info_st                  
 
220
#define MX_CONST                                                        
 
221
 
 
222
#endif // DRIZZLED
 
223
 
 
224
#endif