Skip to content

Commit

Permalink
task: expose new function to check if a chunk comes from the backlog
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <[email protected]>
  • Loading branch information
edsiper committed Feb 7, 2020
1 parent c661963 commit 0e10826
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/fluent-bit/flb_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ struct flb_task_retry *flb_task_retry_create(struct flb_task *task,
void *data);
void flb_task_retry_destroy(struct flb_task_retry *retry);
int flb_task_retry_reschedule(struct flb_task_retry *retry, struct flb_config *config);
int flb_task_from_fs_storage(struct flb_task *task);
int flb_task_retry_count(struct flb_task *task, void *data);
int flb_task_retry_clean(struct flb_task *task, void *data);

Expand Down
13 changes: 13 additions & 0 deletions src/flb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ struct flb_task_retry *flb_task_retry_create(struct flb_task *task,
return retry;
}

/*
* Return FLB_TRUE or FLB_FALSE if the chunk pointed by the task was
* created on this running instance or it comes from a chunk in the
* filesystem from a previous run.
*/
int flb_task_from_fs_storage(struct flb_task *task)
{
struct flb_input_chunk *ic;

ic = (struct flb_input_chunk *) task->ic;
return ic->fs_backlog;
}

int flb_task_retry_count(struct flb_task *task, void *data)
{
struct mk_list *head;
Expand Down

0 comments on commit 0e10826

Please sign in to comment.