42
42
43
43
#include <fluent-bit/flb_callback.h>
44
44
45
+ #ifdef FLB_SYSTEM_WINDOWS
46
+ #include <winnt.h>
47
+ #endif
48
+
45
49
static int cb_doris_init (struct flb_output_instance * ins ,
46
50
struct flb_config * config , void * data )
47
51
{
@@ -313,7 +317,11 @@ static void cb_doris_flush(struct flb_event_chunk *event_chunk,
313
317
314
318
if (ret != FLB_OK ) {
315
319
if (ret == FLB_ERROR && ctx -> log_progress_interval > 0 ) {
320
+ #ifdef FLB_SYSTEM_WINDOWS
321
+ InterlockedAdd (& ctx -> reporter -> failed_rows , event_chunk -> total_events );
322
+ #else
316
323
__sync_fetch_and_add (& ctx -> reporter -> failed_rows , event_chunk -> total_events );
324
+ #endif
317
325
}
318
326
FLB_OUTPUT_RETURN (ret );
319
327
}
@@ -329,10 +337,19 @@ static void cb_doris_flush(struct flb_event_chunk *event_chunk,
329
337
flb_sds_destroy (out_body );
330
338
331
339
if (ret == FLB_OK && ctx -> log_progress_interval > 0 ) {
340
+ #ifdef FLB_SYSTEM_WINDOWS
341
+ InterlockedAdd (& ctx -> reporter -> total_bytes , out_size );
342
+ InterlockedAdd (& ctx -> reporter -> total_rows , event_chunk -> total_events );
343
+ #else
332
344
__sync_fetch_and_add (& ctx -> reporter -> total_bytes , out_size );
333
345
__sync_fetch_and_add (& ctx -> reporter -> total_rows , event_chunk -> total_events );
346
+ #endif
334
347
} else if (ret == FLB_ERROR && ctx -> log_progress_interval > 0 ) {
348
+ #ifdef FLB_SYSTEM_WINDOWS
349
+ InterlockedAdd (& ctx -> reporter -> failed_rows , event_chunk -> total_events );
350
+ #else
335
351
__sync_fetch_and_add (& ctx -> reporter -> failed_rows , event_chunk -> total_events );
352
+ #endif
336
353
}
337
354
FLB_OUTPUT_RETURN (ret );
338
355
}
0 commit comments