9 #ifndef luasandbox_heka_sandbox_h_ 10 #define luasandbox_heka_sandbox_h_ 15 #include "../../luasandbox.h" 17 #include "../util/heka_message.h" 20 #ifdef luasandboxheka_EXPORTS 21 #define LSB_HEKA_EXPORT __declspec(dllexport) 23 #define LSB_HEKA_EXPORT __declspec(dllimport) 27 #define LSB_HEKA_EXPORT __attribute__ ((visibility ("default"))) 29 #define LSB_HEKA_EXPORT 33 #define LSB_HEKA_MAX_MESSAGE_SIZE "max_message_size" 34 #define LSB_HEKA_UPDATE_CHECKPOINT "update_checkpoint" 35 #define LSB_HEKA_THIS_PTR "lsb_heka_this_ptr" 75 #include "../lauxlib.h" 102 const char *cp_string);
143 const char *lua_file,
144 const char *state_file,
167 const char *cp_string,
185 const char *lua_file,
186 const char *state_file,
225 const char *lua_file,
226 const char *state_file,
249 const char *lua_file,
250 const char *state_file,
LSB_HEKA_EXPORT int lsb_heka_timer_event(lsb_heka_sandbox *hsb, time_t t, bool shutdown)
Host access to the timer_event API.
LSB_HEKA_EXPORT lsb_heka_sandbox * lsb_heka_create_input(void *parent, const char *lua_file, const char *state_file, const char *lsb_cfg, lsb_logger *logger, lsb_heka_im_input im)
Create a sandbox supporting the Heka Input Plugin API.
LSB_HEKA_EXPORT lsb_heka_sandbox * lsb_heka_create_analysis(void *parent, const char *lua_file, const char *state_file, const char *lsb_cfg, lsb_logger *logger, lsb_heka_im_analysis im)
Create a sandbox supporting the Heka Analysis Plugin API.
int(* lsb_heka_im_analysis)(void *parent, const char *pb, size_t pb_len)
inject_message callback function provided by the host.
LSB_HEKA_EXPORT lsb_heka_sandbox * lsb_heka_create_output_im(void *parent, const char *lua_file, const char *state_file, const char *lsb_cfg, lsb_logger *logger, lsb_heka_update_checkpoint ucp, lsb_heka_im_analysis im)
Create a sandbox supporting the Heka Output Plugin API with inject_message support.
struct lsb_heka_stats lsb_heka_stats
unsigned long long ins_max
LSB_HEKA_EXPORT void lsb_heka_terminate_sandbox(lsb_heka_sandbox *hsb, const char *err)
Terminates the sandbox as if it had a fatal error (not thread safe).
unsigned long long out_max
LSB_HEKA_EXPORT void lsb_heka_stop_sandbox(lsb_heka_sandbox *hsb)
Aborts the running sandbox from a different thread of execution.
struct lsb_heka_sandbox lsb_heka_sandbox
LSB_HEKA_EXPORT int lsb_heka_pm_analysis(lsb_heka_sandbox *hsb, lsb_heka_message *msg, bool profile)
Host access to the analysis sandbox process_message API.
int(* lsb_heka_update_checkpoint)(void *parent, void *sequence_id)
update_checkpoint callback function provided by the host.
LSB_HEKA_EXPORT lsb_state lsb_heka_get_state(lsb_heka_sandbox *hsb)
Queries the state of the sandbox.
LSB_HEKA_EXPORT const char * lsb_heka_get_lua_file(lsb_heka_sandbox *hsb)
Returns the filename of the Lua source.
unsigned long long mem_cur
LSB_HEKA_EXPORT const char * lsb_heka_get_error(lsb_heka_sandbox *hsb)
Return the last error in human readable form.
unsigned long long im_cnt
LSB_HEKA_EXPORT int lsb_heka_pm_output(lsb_heka_sandbox *hsb, lsb_heka_message *msg, void *sequence_id, bool profile)
Host access to the output sandbox process_message API.
LSB_HEKA_EXPORT bool lsb_heka_is_running(lsb_heka_sandbox *hsb)
Convenience function to test if a sandbox is running.
LSB_HEKA_EXPORT lsb_err_id LSB_ERR_HEKA_INPUT
unsigned long long mem_max
LSB_HEKA_EXPORT lsb_heka_sandbox * lsb_heka_create_output(void *parent, const char *lua_file, const char *state_file, const char *lsb_cfg, lsb_logger *logger, lsb_heka_update_checkpoint ucp)
Create a sandbox supporting the Heka Output Plugin API.
unsigned long long pm_failures
LSB_HEKA_EXPORT lsb_heka_stats lsb_heka_get_stats(lsb_heka_sandbox *hsb)
Retrieve the sandbox profiling/monitoring statistics.
int(* lsb_heka_im_input)(void *parent, const char *pb, size_t pb_len, double cp_numeric, const char *cp_string)
inject_message callback function provided by the host.
unsigned long long pm_cnt
LSB_HEKA_EXPORT const lsb_heka_message * lsb_heka_get_message(lsb_heka_sandbox *hsb)
Retrieve the currently active sandbox message.
LSB_HEKA_EXPORT char lsb_heka_get_type(lsb_heka_sandbox *hsb)
Retrieve the sandbox type.
LSB_HEKA_EXPORT char * lsb_heka_destroy_sandbox(lsb_heka_sandbox *hsb)
Frees all memory associated with the sandbox; hsb cannont be used after this point and the host shoul...
LSB_HEKA_EXPORT int lsb_heka_pm_input(lsb_heka_sandbox *hsb, double cp_numeric, const char *cp_string, bool profile)
Host access to the input sandbox process_message API.
unsigned long long im_bytes
LSB_HEKA_EXPORT void lsb_heka_stop_sandbox_clean(lsb_heka_sandbox *hsb)
Requests a long running input sandbox to stop.