Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

out_s3: added blob handling feature #9907

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion include/fluent-bit/flb_aws_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ int flb_aws_is_auth_error(char *payload, size_t payload_size);

int flb_read_file(const char *path, char **out_buf, size_t *out_size);

//* Constructs S3 object key as per the format. */
/* Constructs S3 object key as per the format. */
flb_sds_t flb_get_s3_key(const char *format, time_t time, const char *tag,
char *tag_delimiter, uint64_t seq_index);

/* Constructs S3 object key as per the blob format. */
flb_sds_t flb_get_s3_blob_key(const char *format, const char *tag,
char *tag_delimiter, const char *blob_path);

/*
* This function is an extension to strftime which can support milliseconds with %3N,
* support nanoseconds with %9N or %L. The return value is the length of formatted
Expand Down
454 changes: 454 additions & 0 deletions include/fluent-bit/flb_blob_db.h

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions include/fluent-bit/flb_sqldb.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <sqlite3.h>
#include <fluent-bit.h>
#include <fluent-bit/flb_lock.h>

struct flb_sqldb {
char *path; /* physical path of the database */
Expand All @@ -30,6 +31,7 @@ struct flb_sqldb {
int users; /* number of active users */
void *parent; /* if shared, ref to parent */
sqlite3 *handler; /* SQLite3 handler */
flb_lock_t lock; /* thread safety mechanism */
struct mk_list _head; /* Link to config->sqldb_list */
};

Expand All @@ -40,6 +42,11 @@ int flb_sqldb_close(struct flb_sqldb *db);
int flb_sqldb_query(struct flb_sqldb *db, const char *sql,
int (*callback) (void *, int, char **, char **),
void *data);

int64_t flb_sqldb_last_id(struct flb_sqldb *db);

int flb_sqldb_lock(struct flb_sqldb *db);

int flb_sqldb_unlock(struct flb_sqldb *db);

#endif
Loading
Loading