Skip to content

Commit

Permalink
feat:add deploy space config
Browse files Browse the repository at this point in the history
  • Loading branch information
songyutong1 committed Dec 9, 2024
1 parent 66402b2 commit 2150f1d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public class LogtailConfig {
private String type;
private Integer appType;

private String deploySpace;

private Integer parseType;
private String tail;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public interface MilogConfigNacosService {

void publishStreamConfig(Long spaceId, Integer type, Integer projectType, String motorRoomEn);

void publishNameSpaceConfig(String motorRoomEn, Long spaceId, Long storeId, Long tailId, Integer type, String changeType);
void publishNameSpaceConfig(String motorRoomEn, Long spaceId, Long storeId, Long tailId,Integer type, String changeType);

void removeStreamConfig(String motorRoomEn, Long id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,11 @@ private StorageInfo buildEsInfo(MilogEsClusterDO clusterDO) {
return new StorageInfo(clusterDO.getId(), clusterDO.getAddr(), clusterDO.getToken(), clusterDO.getDtCatalog(), clusterDO.getDtDatabase());
}

public static void main(String[] args) {
LogtailConfig logtailConfig = new LogtailConfig();
logtailConfig.setDeploySpace("123");
System.out.println(logtailConfig.getDeploySpace());
}

public LogtailConfig assembleLogTailConfigs(Long tailId) {
LogtailConfig logtailConfig = new LogtailConfig();
Expand All @@ -447,6 +452,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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

}
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ private void putCommonData(Map<String, Object> 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<String, Object> dataMap) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ public class SinkJobConfig extends LogConfig {
*/
private String jobType;
private String consumerGroup;
private String deploySpace;
}

0 comments on commit 2150f1d

Please sign in to comment.