From cc4e0adcbfdfde3e4472eb18166beb387d4b0747 Mon Sep 17 00:00:00 2001 From: Zoltan Haindrich Date: Wed, 26 Jun 2024 12:06:50 +0000 Subject: [PATCH] make synch --- .../main/java/org/apache/druid/quidem/QuidemRecorder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quidem-it/src/main/java/org/apache/druid/quidem/QuidemRecorder.java b/quidem-it/src/main/java/org/apache/druid/quidem/QuidemRecorder.java index 4bc149f7c3c..8a06815d651 100644 --- a/quidem-it/src/main/java/org/apache/druid/quidem/QuidemRecorder.java +++ b/quidem-it/src/main/java/org/apache/druid/quidem/QuidemRecorder.java @@ -51,7 +51,7 @@ public class QuidemRecorder implements AutoCloseable, DruidHook } @Override - public void close() + public synchronized void close() { if (printStream != null) { printStream.close(); @@ -61,12 +61,14 @@ public class QuidemRecorder implements AutoCloseable, DruidHook } @Override - public void invoke(HookKey key, String query) + public synchronized void invoke(HookKey key, String query) { if (DruidHook.SQL.equals(key)) { + printStream.println("# " + new Date()); printStream.print(query); printStream.println(";"); printStream.println("!ok"); + printStream.flush(); return; } }