From b6a1fe153ef6f5638119cb1bae47dc52900c1cec Mon Sep 17 00:00:00 2001 From: xiaofeng24 <54708546+xiaofeng24@users.noreply.github.com> Date: Wed, 28 Jun 2023 18:45:17 +0800 Subject: [PATCH] format stream load response message --- .../plugin/writer/doriswriter/DorisStreamLoadObserver.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java b/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java index 6f7e9a5a..18162a21 100644 --- a/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java +++ b/doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisStreamLoadObserver.java @@ -61,18 +61,18 @@ public class DorisStreamLoadObserver { .toString(); LOG.info("Start to join batch data: rows[{}] bytes[{}] label[{}].", data.getRows().size(), data.getBytes(), data.getLabel()); Map loadResult = put(loadUrl, data.getLabel(), addRows(data.getRows(), data.getBytes().intValue())); - LOG.info("StreamLoad response :{}",JSON.toJSONString(loadResult)); + LOG.info("StreamLoad response :{}",JSON.toJSONString(loadResult, JSONWriter.Feature.PrettyFormat)); final String keyStatus = "Status"; if (null == loadResult || !loadResult.containsKey(keyStatus)) { throw new IOException("Unable to flush data to Doris: unknown result status."); } - LOG.debug("StreamLoad response:{}",JSON.toJSONString(loadResult)); + LOG.debug("StreamLoad response:{}",JSON.toJSONString(loadResult, JSONWriter.Feature.PrettyFormat)); if (RESULT_FAILED.equals(loadResult.get(keyStatus))) { throw new IOException( new StringBuilder("Failed to flush data to Doris.\n").append(JSON.toJSONString(loadResult)).toString() ); } else if (RESULT_LABEL_EXISTED.equals(loadResult.get(keyStatus))) { - LOG.debug("StreamLoad response:{}",JSON.toJSONString(loadResult)); + LOG.debug("StreamLoad response:{}",JSON.toJSONString(loadResult, JSONWriter.Feature.PrettyFormat)); checkStreamLoadState(host, data.getLabel()); } }