2525#include <fluent-bit/flb_config_map.h>
2626#include <fluent-bit/flb_gzip.h>
2727#include <fluent-bit/flb_base64.h>
28- #include <fluent-bit/flb_sqldb.h>
2928#include <fluent-bit/flb_input_blob.h>
3029#include <fluent-bit/flb_log_event_decoder.h>
3130#include <fluent-bit/flb_plugin.h>
3433#include <msgpack.h>
3534
3635#include "azure_blob.h"
37- #include "azure_blob_db.h"
3836#include "azure_blob_uri.h"
3937#include "azure_blob_conf.h"
4038#include "azure_blob_appendblob.h"
4139#include "azure_blob_blockblob.h"
4240#include "azure_blob_http.h"
4341
42+ #ifdef FLB_HAVE_SQLDB
43+ #include "azure_blob_db.h"
44+ #endif
45+
4446#define CREATE_BLOB 1337
4547
4648/* thread_local_storage for workers */
@@ -151,6 +153,7 @@ static int create_blob(struct flb_azure_blob *ctx, char *name)
151153 return FLB_OK ;
152154}
153155
156+ #ifdef FLB_HAVE_SQLDB
154157static int delete_blob (struct flb_azure_blob * ctx , char * name )
155158{
156159 int ret ;
@@ -225,6 +228,7 @@ static int delete_blob(struct flb_azure_blob *ctx, char *name)
225228 flb_upstream_conn_release (u_conn );
226229 return FLB_OK ;
227230}
231+ #endif
228232
229233static int http_send_blob (struct flb_config * config , struct flb_azure_blob * ctx ,
230234 flb_sds_t ref_name ,
@@ -380,11 +384,13 @@ static int send_blob(struct flb_config *config,
380384 uri = azb_block_blob_uri (ctx , tag , block_id , ms );
381385 ref_name = flb_sds_printf (& ref_name , "file=%s.%" PRIu64 , name , ms );
382386 }
387+ #ifdef FLB_HAVE_SQLDB
383388 else if (event_type == FLB_EVENT_TYPE_BLOBS ) {
384389 block_id = azb_block_blob_id_blob (ctx , name , part_id );
385390 uri = azb_block_blob_uri (ctx , name , block_id , 0 );
386391 ref_name = flb_sds_printf (& ref_name , "file=%s:%" PRIu64 , name , part_id );
387392 }
393+ #endif
388394 }
389395
390396 if (!uri ) {
@@ -416,10 +422,12 @@ static int send_blob(struct flb_config *config,
416422 return FLB_ERROR ;
417423 }
418424 }
425+ #ifdef FLB_HAVE_SQLDB
419426 else if (event_type == FLB_EVENT_TYPE_BLOBS ) {
420427 payload_buf = data ;
421428 payload_size = bytes ;
422429 }
430+ #endif
423431
424432 ret = http_send_blob (config , ctx , ref_name , uri , block_id , event_type , payload_buf , payload_size );
425433 flb_plg_debug (ctx -> ins , "http_send_blob()=%i" , ret );
@@ -635,6 +643,7 @@ static int cb_azure_blob_init(struct flb_output_instance *ins,
635643 return 0 ;
636644}
637645
646+ #ifdef FLB_HAVE_SQLDB
638647static int blob_chunk_register_parts (struct flb_azure_blob * ctx , uint64_t file_id , size_t total_size )
639648{
640649 int ret ;
@@ -1034,6 +1043,7 @@ static int azb_timer_create(struct flb_azure_blob *ctx)
10341043
10351044 return 0 ;
10361045}
1046+ #endif
10371047
10381048static void cb_azure_blob_flush (struct flb_event_chunk * event_chunk ,
10391049 struct flb_output_flush * out_flush ,
@@ -1081,6 +1091,7 @@ static void cb_azure_blob_flush(struct flb_event_chunk *event_chunk,
10811091 }
10821092 }
10831093 }
1094+ #ifdef FLB_HAVE_SQLDB
10841095 else if (event_chunk -> type == FLB_EVENT_TYPE_BLOBS ) {
10851096 /*
10861097 * For Blob types, we use the flush callback to enqueue the file, then cb_azb_blob_file_upload()
@@ -1091,6 +1102,7 @@ static void cb_azure_blob_flush(struct flb_event_chunk *event_chunk,
10911102 FLB_OUTPUT_RETURN (FLB_RETRY );
10921103 }
10931104 }
1105+ #endif
10941106
10951107 /* FLB_RETRY, FLB_OK, FLB_ERROR */
10961108 FLB_OUTPUT_RETURN (ret );
@@ -1129,11 +1141,13 @@ static int cb_worker_init(void *data, struct flb_config *config)
11291141 FLB_TLS_SET (worker_info , info );
11301142 }
11311143
1144+ #ifdef FLB_HAVE_SQLDB
11321145 ret = azb_timer_create (ctx );
11331146 if (ret == -1 ) {
11341147 flb_plg_error (ctx -> ins , "failed to create upload timer" );
11351148 return -1 ;
11361149 }
1150+ #endif
11371151
11381152 return 0 ;
11391153}
0 commit comments