static void afmongodb_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { MongoDBDestDriver *self = (MongoDBDestDriver *)s; gboolean queue_was_empty; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); g_mutex_lock(self->queue_mutex); self->last_msg_stamp = cached_g_current_time_sec (); queue_was_empty = log_queue_get_length(self->queue) == 0; g_mutex_unlock(self->queue_mutex); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); g_mutex_lock(self->suspend_mutex); if (queue_was_empty && !self->writer_thread_suspended) { g_mutex_lock(self->queue_mutex); log_queue_set_parallel_push(self->queue, 1, afmongodb_dd_queue_notify, self, NULL); g_mutex_unlock(self->queue_mutex); } g_mutex_unlock(self->suspend_mutex); log_dest_driver_queue_method(s, msg, path_options, user_data); }
static void afamqp_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { AMQPDestDriver *self = (AMQPDestDriver *) s; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, msg, path_options); log_dest_driver_queue_method(s, msg, path_options, user_data); }
static void afmongodb_dd_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { MongoDBDestDriver *self = (MongoDBDestDriver *)s; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); self->last_msg_stamp = cached_g_current_time_sec (); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); log_dest_driver_queue_method(s, msg, path_options, user_data); }
static void log_threaded_dest_driver_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options, gpointer user_data) { LogThrDestDriver *self = (LogThrDestDriver *)s; LogPathOptions local_options; if (!path_options->flow_control_requested) path_options = log_msg_break_ack(msg, path_options, &local_options); if (self->queue_method) self->queue_method(self); log_msg_add_ack(msg, path_options); log_queue_push_tail(self->queue, log_msg_ref(msg), path_options); log_dest_driver_queue_method(s, msg, path_options, user_data); }
/* NOTE: runs in the reader thread */ static void log_writer_queue(LogPipe *s, LogMessage *lm, const LogPathOptions *path_options, gpointer user_data) { LogWriter *self = (LogWriter *) s; LogPathOptions local_options; if (!path_options->flow_control_requested && (self->suspended || !(self->flags & LW_SOFT_FLOW_CONTROL))) { /* NOTE: this code ACKs the message back if there's a write error in * order not to hang the client in case of a disk full */ path_options = log_msg_break_ack(lm, path_options, &local_options); } if (self->options->suppress > 0 && log_writer_last_msg_check(self, lm, path_options)) return; stats_counter_inc(self->processed_messages); log_queue_push_tail(self->queue, lm, path_options); }
/* NOTE: runs in the reader thread */ static void log_writer_queue(LogPipe *s, LogMessage *lm, const LogPathOptions *path_options, gpointer user_data) { LogWriter *self = (LogWriter *) s; LogPathOptions local_options; gint mark_mode = self->options->mark_mode; if (!path_options->flow_control_requested && (self->suspended || !(self->flags & LW_SOFT_FLOW_CONTROL))) { /* NOTE: this code ACKs the message back if there's a write error in * order not to hang the client in case of a disk full */ path_options = log_msg_break_ack(lm, path_options, &local_options); } if (log_writer_is_msg_suppressed(self, lm)) { log_msg_drop(lm, path_options); return; } if (mark_mode != MM_INTERNAL && (lm->flags & LF_INTERNAL) && (lm->flags & LF_MARK)) { /* drop MARK messages generated by internal() in case our mark-mode != internal */ log_msg_drop(lm, path_options); return; } if (mark_mode == MM_DST_IDLE || (mark_mode == MM_HOST_IDLE && !(lm->flags & LF_LOCAL))) { /* in dst-idle and host-idle most, messages postpone the MARK itself */ log_writer_postpone_mark_timer(self); } stats_counter_inc(self->processed_messages); log_queue_push_tail(self->queue, lm, path_options); }