Namespaces | |
json_server | |
Classes | |
class | FilteredReplicator |
class | Logging_query |
class | AnalysisTableTool |
struct | server_function_context |
class | StatsTableTool |
class | MySQLPassword |
class | ProtocolCounters |
class | ListenMySQLProtocol |
class | ClientMySQLProtocol |
class | NET |
struct | st_drizzleclient_options |
class | Vio |
Virtual I/O layer, only used with TCP/IP sockets at the moment. More... | |
class | rabbitmq_handler_exception |
class | RabbitMQHandler |
wrapper around librabbitmq, hides error handling and reconnections etc TODO: add reconnection handling More... | |
class | RabbitMQLog |
A TransactionApplier that sends the transactions to rabbitmq (or any AMQP 0-8 compliant message queue) More... | |
class | WrapSyslog |
Typedefs | |
typedef drizzled::constrained_check < uint32_t, 300, 1 > | timeout_constraint |
typedef drizzled::constrained_check < uint32_t, 300, 1 > | retry_constraint |
typedef drizzled::constrained_check < uint32_t, 1048576, 1024, 1024 > | buffer_constraint |
Functions | |
static int | init (drizzled::module::Context &context) |
static int | filtered_schemas_validate (Session *, set_var *var) |
static int | filtered_tables_validate (Session *, set_var *var) |
static int | init (module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
static void | quotify (const string &src, string &dst) |
static int | logging_query_plugin_init (drizzled::module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
static int | init (drizzled::module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
memcached_return | server_function (const memcached_st *ptr, memcached_server_st *server, void *context) |
static int | init (drizzled::module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
static bool | net_write_buff (NET *, const void *, uint32_t len) |
static int | drizzleclient_net_real_write (NET *net, const unsigned char *packet, size_t len) |
static bool | drizzleclient_net_realloc (NET *net, size_t length) |
static bool | drizzleclient_net_write (NET *net, const void *packet0, size_t len) |
static bool | drizzleclient_net_write_command (NET *net, unsigned char command, const unsigned char *header, size_t head_len, const unsigned char *packet, size_t len) |
static uint32_t | my_real_read (NET *net, size_t *complen) |
static uint32_t | drizzleclient_net_read (NET *net) |
bool | update_file (Session *, set_var *var) |
Update query_log_file (query_log->sysvar_file). More... | |
void | update_file_enabled (Session *, sql_var_t) |
Update query_log_file_enabled (query_log->sysvar_file_enabled). More... | |
static void | init_options (drizzled::module::option_context &context) |
Initialize query-log command line options. More... | |
static int | init (drizzled::module::Context &context) |
Add query_log plugin to Drizzle and initalize query_log system variables. More... | |
static int | init (drizzled::module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
static int | init (drizzled::module::Context &context) |
static void | init_options (drizzled::module::option_context &context) |
Variables | |
static string | sysvar_filtered_replicator_sch_filters |
static string | sysvar_filtered_replicator_tab_filters |
static FilteredReplicator * | filtered_replicator = NULL |
static bool | sysvar_logging_query_enable = false |
static uint32_constraint | sysvar_logging_query_threshold_slow |
static uint32_constraint | sysvar_logging_query_threshold_big_resultset |
static uint32_constraint | sysvar_logging_query_threshold_big_examined |
static AnalysisTableTool * | analysis_table_tool |
static StatsTableTool * | stats_table_tool |
static std::string | sysvar_memcached_servers |
const char * | MySQLPasswordName = "mysql_password" |
static const unsigned int | PACKET_BUFFER_EXTRA_ALLOC = 1024 |
static port_constraint | port |
static timeout_constraint | connect_timeout |
static timeout_constraint | read_timeout |
static timeout_constraint | write_timeout |
static retry_constraint | retry_count |
static buffer_constraint | buffer_length |
static uint32_t | random_seed1 |
static uint32_t | random_seed2 |
static const uint32_t | random_max = 0x3FFFFFFF |
static const double | random_max_double = (double)0x3FFFFFFF |
static drizzled::plugin::QueryLog * | query_log = NULL |
static QueryLoggerFile * | logger_file = NULL |
const char * | default_file = "drizzled-queries.log" |
Default query log file. More... | |
static port_constraint | sysvar_rabbitmq_port |
static RabbitMQLog * | rabbitmqLogger |
the actual plugin | |
static RabbitMQHandler * | rabbitmqHandler |
the rabbitmq handler | |
static bool | sysvar_logging_enable = false |
static bool | sysvar_errmsg_enable = true |
uint64_constraint | sysvar_logging_threshold_slow |
uint64_constraint | sysvar_logging_threshold_big_resultset |
uint64_constraint | sysvar_logging_threshold_big_examined |
Drizzle Plugin Namespace
|
static |
Read a packet from the client/server and return it without the internal package header.
If the packet is the first packet of a multi-packet packet (which is indicated by the length of the packet = 0xffffff) then all sub packets are read and concatenated.
If the packet was compressed, its uncompressed and the length of the uncompressed packet is returned.
Definition at line 572 of file net_serv.cc.
References my_real_read().
|
static |
Read and write one packet using timeouts. If needed, the packet is compressed before sending.
Definition at line 344 of file net_serv.cc.
References drizzle_plugin::Vio::blocking(), drizzle_plugin::Vio::get_errno(), drizzle_plugin::Vio::should_retry(), and drizzle_plugin::Vio::write().
Referenced by net_write_buff().
|
static |
Realloc the packet buffer.
Definition at line 114 of file net_serv.cc.
Referenced by my_real_read().
|
static |
Write a logical packet with packet header.
Format: Packet length (3 bytes), packet number(1 byte) When compression is used a 3 byte compression length is added
Definition at line 165 of file net_serv.cc.
References net_write_buff().
|
static |
Send a command to the server.
The reason for having both header and packet is so that libdrizzle can easy add a header to a special command (like prepared statements) without having to re-alloc the string.
As the command is part of the first data packet, we have to do some data juggling to put the command in there, without having to create a new packet.
This function will split big packets into sub-packets if needed. (Each sub packet can only be 2^24 bytes)
net | NET handler |
command | Command in MySQL server (enum enum_server_command) |
header | Header to write after command |
head_len | Length of header |
packet | Query or parameter to query |
len | Length of packet |
0 | ok |
1 | error |
Definition at line 220 of file net_serv.cc.
References net_write_buff().
|
static |
Initialize the memcached stats plugin.
[in] | registry | the drizzled::plugin::Registry singleton |
Definition at line 66 of file memcached_stats.cc.
|
static |
Initialize the rabbitmq logger - instanciates the dependencies (the handler) and creates the log handler with the dependency - makes it easier to swap out handler implementation
Definition at line 114 of file rabbitmq_log.cc.
References drizzled::ReplicationServices::attachApplier(), rabbitmqHandler, rabbitmqLogger, and sysvar_rabbitmq_port.
|
static |
Add query_log plugin to Drizzle and initalize query_log system variables.
This is where we plug into Drizzle and register our system variables. Since this is called after init_options(), vm has either values from the command line or defaults. System variables corresponding to command line options use the same public query_log variables so that values from vm (the command line) are automatically reflected in the system variable (SHOW VARIABLES). This also makes changes to certain system variables automatic/instant because when they're updated (e.g. SET GLOBAL query_log_enabled=TRUE|FALSE) Drizzle changes the corresponding public query_log variable. Certain system variables, like query_log_file, require more work to change, so they're handled by update functions like update_file().
0 | Success |
Definition at line 228 of file module.cc.
References QueryLoggerFile::openLogFile(), query_log, drizzled::plugin::QueryLog::sysvar_enabled, update_file(), and update_file_enabled().
|
static |
Initialize query-log command line options.
This function is called first, before init(). We instantiate our one and only QueryLog object (query_log) here so that po (boost::program_options) can store the command line options' values in public query_log variables. This avoids using global variables and keeps (almost) everything encapsulated in query_log.
Definition at line 157 of file module.cc.
References default_file, init_options(), and query_log.
Referenced by init_options().
|
static |
Reads one packet to net->buff + net->where_b. Long packets are handled by drizzleclient_net_read(). This function reallocates the net->buff buffer if necessary.
Definition at line 460 of file net_serv.cc.
References drizzleclient_net_realloc(), drizzle_plugin::Vio::get_errno(), drizzle_plugin::Vio::get_fd(), drizzle_plugin::Vio::read(), drizzle_plugin::Vio::should_retry(), and drizzle_plugin::Vio::was_interrupted().
Referenced by drizzleclient_net_read().
|
static |
Caching the data in a local buffer before sending it.
Fill up net->buffer and send it to the client when full.
If the rest of the to-be-sent-packet is bigger than buffer, send it in one big block (to avoid copying to internal buffer). If not, copy the rest of the data to the buffer and return without sending data.
net | Network handler |
packet | Packet to send |
len | Length of packet |
0 | ok |
1 |
Definition at line 284 of file net_serv.cc.
References drizzleclient_net_real_write().
Referenced by drizzleclient_net_write(), and drizzleclient_net_write_command().
Update query_log_file (query_log->sysvar_file).
Forward declarations. Mac OS X 10.6 with gcc 4.2.1 misses this warning (but still compiles): configure:23893: g++ -c -Werror -pedantic -Wmissing-declarations \ -std=gnu++98 -O0 -DDEBUG conftest.cpp >&5 cc1plus: warnings being treated as errors cc1plus: warning: command line option "-Wmissing-declarations" is valid for C/ObjC but not for C++
When SET GLOBAL query_log_file="new-file.log" is executed by the user, this function is called which checkes that the new file is not NULL or a blank string, then calls logger_file->openLogFile, passing it the new log file name, e.g. "new-file.log". If the new log file is opened, the system variable is updated, else it is not updated and logging continues to the old log file.
true | Error, log file not changed |
false | Success, log file changed |
If the the log file is enabled, then try to open the new log file. If it's not enabled, then just update query_log_file because the user might be trying to: close current log file (SET GLOBAL log_file_enabled=FALSE) switch to new log file (SET GLOBAL log_file="new-file.log") enable new log file (SET GLOBAL log_file_enabled=TRUE) (Maybe they're doing this to rotate the log?) If this is the case, then we don't want to open the new log file before it's enabled, but we also don't want to leave query_log_file set to the old log file name. When the log file is re-enabled later, update_file_enabled() will be called and the new log file will be opened.
If the the log file is enabled, then try to open the new log file. If it's not enabled, then just update query_log_file because the user might be trying to: close current log file (SET GLOBAL log_file_enabled=FALSE) switch to new log file (SET GLOBAL log_file="new-file.log") enable new log file (SET GLOBAL log_file_enabled=TRUE) (Maybe they're doing this to rotate the log?) If this is the case, then we don't want to open the new log file before it's enabled, but we also don't want to leave query_log_file set to the old log file name. When the log file is re-enabled later, update_file_enabled() will be called and the new log file will be opened.
Definition at line 77 of file module.cc.
References QueryLoggerFile::openLogFile(), query_log, drizzled::Item::str_value, and update_file().
Referenced by init(), and update_file().
void drizzle_plugin::update_file_enabled | ( | Session * | , |
sql_var_t | |||
) |
Update query_log_file_enabled (query_log->sysvar_file_enabled).
When SET GLOBAL query_log_file_enabled=... is executed by the user, this function is called after Drizzle updates the variable with the new value, so in this function we have the new/current value. If the log file is enabled, then open query_log_file (query_log->sysvar_file); else, close the log file.
Definition at line 132 of file module.cc.
References QueryLoggerFile::closeLogFile(), QueryLoggerFile::openLogFile(), query_log, and update_file_enabled().
Referenced by init(), and update_file_enabled().
const char* drizzle_plugin::default_file = "drizzled-queries.log" |
Default query log file.
Sensible defaults.
Definition at line 60 of file module.cc.
Referenced by init_options().
|
static |
An instance of our class, QueryLog, which implements the query_log plugin, and an instance of the QueryLoggerClass for logging queries to a file. These objects are global so update_file() and update_file_enabled() can access them. They're instantiated in init_options().
Definition at line 54 of file module.cc.
Referenced by init(), init_options(), update_file(), and update_file_enabled().
|
static |