From c101120a85f17f3439cfd18d600a06d7faf025a3 Mon Sep 17 00:00:00 2001 From: songyutong Date: Mon, 9 Dec 2024 14:30:42 +0800 Subject: [PATCH] feat:add deploy space config --- .../main/java/org/apache/ozhera/log/model/LogtailConfig.java | 2 ++ .../log/manager/service/impl/MilogConfigNacosServiceImpl.java | 1 + .../org/apache/ozhera/log/stream/common/LogStreamConstants.java | 1 + .../main/java/org/apache/ozhera/log/stream/job/JobManager.java | 1 + .../java/org/apache/ozhera/log/stream/job/LogDataTransfer.java | 1 + .../java/org/apache/ozhera/log/stream/job/SinkJobConfig.java | 1 + 6 files changed, 7 insertions(+) diff --git a/ozhera-log/log-common/src/main/java/org/apache/ozhera/log/model/LogtailConfig.java b/ozhera-log/log-common/src/main/java/org/apache/ozhera/log/model/LogtailConfig.java index 68a3c6d5..5dbf8aea 100644 --- a/ozhera-log/log-common/src/main/java/org/apache/ozhera/log/model/LogtailConfig.java +++ b/ozhera-log/log-common/src/main/java/org/apache/ozhera/log/model/LogtailConfig.java @@ -38,6 +38,8 @@ public class LogtailConfig { private String type; private Integer appType; + private String deploySpace; + private Integer parseType; private String tail; /** diff --git a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java index eb22b7c9..964ff95b 100644 --- a/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java +++ b/ozhera-log/log-manager/src/main/java/org/apache/ozhera/log/manager/service/impl/MilogConfigNacosServiceImpl.java @@ -447,6 +447,7 @@ public LogtailConfig assembleLogTailConfigs(Long tailId) { logtailConfig.setParseScript(milogLogTail.getParseScript()); logtailConfig.setValueList(milogLogTail.getValueList()); logtailConfig.setAppType(milogLogTail.getAppType()); + logtailConfig.setDeploySpace(milogLogTail.getDeploySpace()); // Query MQ information handleTailConfig(tailId, milogLogTail.getStoreId(), milogLogTail.getSpaceId(), milogLogTail.getMilogAppId(), logtailConfig, milogLogTail.getAppType()); diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/common/LogStreamConstants.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/common/LogStreamConstants.java index 5923260e..a4273edf 100644 --- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/common/LogStreamConstants.java +++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/common/LogStreamConstants.java @@ -38,5 +38,6 @@ public class LogStreamConstants { public static final String LOG_STREAM_SPACE_ID = "spaceId"; public static final String LOG_STREAM_STORE_ID = "storeId"; public static final String LOG_STREAM_TAIL_ID = "tailId"; + public static final String DEPLOY_SPACE = "deploy_space"; } diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/JobManager.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/JobManager.java index 447419d5..ac6fa56d 100644 --- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/JobManager.java +++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/JobManager.java @@ -186,6 +186,7 @@ private SinkJobConfig buildSinkJobConfig(String type, String ak, String sk, Stri .jobType(SinkJobEnum.NORMAL_JOB.name()) .storageType(sinkConfig.getStorageType()) .consumerGroup(logtailConfig.getConsumerGroup()) + .deploySpace(logtailConfig.getDeploySpace()) .build(); sinkJobConfig.setLogTailId(logtailConfig.getLogtailId()); sinkJobConfig.setLogStoreId(sinkConfig.getLogstoreId()); diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/LogDataTransfer.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/LogDataTransfer.java index 1bcdb0b0..d63f3896 100644 --- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/LogDataTransfer.java +++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/LogDataTransfer.java @@ -143,6 +143,7 @@ private void putCommonData(Map dataMap) { dataMap.putIfAbsent(LOG_STREAM_SPACE_ID, sinkJobConfig.getLogSpaceId()); dataMap.putIfAbsent(LOG_STREAM_STORE_ID, sinkJobConfig.getLogStoreId()); dataMap.putIfAbsent(LOG_STREAM_TAIL_ID, sinkJobConfig.getLogTailId()); + dataMap.putIfAbsent(DEPLOY_SPACE, sinkJobConfig.getDeploySpace()); } private void sendMessage(Map dataMap) throws Exception { diff --git a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/SinkJobConfig.java b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/SinkJobConfig.java index ec41152a..476ccc55 100644 --- a/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/SinkJobConfig.java +++ b/ozhera-log/log-stream/src/main/java/org/apache/ozhera/log/stream/job/SinkJobConfig.java @@ -61,4 +61,5 @@ public class SinkJobConfig extends LogConfig { */ private String jobType; private String consumerGroup; + private String deploySpace; }