This function reads a specified log file or pipe and iterates over its contents using a user-defined callback.
MCO_RET mco_translog_iterate (char const *file_path,
mco_db_h db,
mco_trans_iterator_callback_t iteration_proc,
void *user_ctx,
mco_dictionary_h dict,
void *mem_ptr,
mco_size_t mem_size);
file_path
db
iteration_proc
user_ctx
dict
mem_ptr
malloc() complies with this requirement.mem_size
This function reads a specified log file or pipe and, if the log file is compatible, iterates over its contents by calling the user-defined callback.
MCO_S_OK
MCO_S_OKIf the user-defined callback returns any value other than MCO_S_OK, the function
mco_translog_iterate() aborts and returns this code as its own return code.
This is the correct way to break the iteration loop if an error condition occurs inside
the user-defined iteration callback.
MCO_E_TL_INVAL
MCO_E_TL_NOT_ITERABLE
MCO_TRANSLOG_ITERABLE.MCO_E_TL_LOG_NOT_OPENED
MCO_E_TL_IO_ERROR
MCO_E_VERS_MISMATCH
MCO_E_TL_INVFORMAT
MCO_S_TL_INVDATA
MCO_E_TL_PIPE_USED
mco_translog_iterate().MCO_E_TL_PIPE_TERM
Logging was terminated during the previous call to mco_translog_iterate() but has not
yet been reinitialized by the writer. This error code indicates a possible loss of consistency
in the transferred data and prevents any transaction commit that cannot be transferred to
the secondary database. Logging must therefore be restarted and the transaction recommitted
after every failure.
Consequently, the error code MCO_E_TL_PIPE_TERM is not implemented in dynamic pipes,
which do not check for data consistency (the reader can attach to and detach from a pipe
at any arbitrary moment).
MCO_E_TL_PIPE_LOST
MCO_E_NOMEM
mem_size.