fuweng11 commented on code in PR #10235:
URL: https://github.com/apache/inlong/pull/10235#discussion_r1604302559
##########
inlong-sort-standalone/sort-standalone-source/src/main/java/org/apache/inlong/sort/standalone/sink/kafka/KafkaIdConfig.java:
##########
@@ -62,112 +57,16 @@ public KafkaIdConfig(Map<String, String> idParam) {
.convert(idParam.getOrDefault(KafkaIdConfig.KEY_DATA_TYPE,
DataTypeEnum.TEXT.getType()));
}
- /**
- * get inlongGroupId
- *
- * @return the inlongGroupId
- */
- public String getInlongGroupId() {
- return inlongGroupId;
- }
-
- /**
- * set inlongGroupId
- *
- * @param inlongGroupId the inlongGroupId to set
- */
- public void setInlongGroupId(String inlongGroupId) {
- this.inlongGroupId = inlongGroupId;
- }
-
- /**
- * get inlongStreamId
- *
- * @return the inlongStreamId
- */
- public String getInlongStreamId() {
- return inlongStreamId;
- }
-
- /**
- * set inlongStreamId
- *
- * @param inlongStreamId the inlongStreamId to set
- */
- public void setInlongStreamId(String inlongStreamId) {
- this.inlongStreamId = inlongStreamId;
- }
-
- /**
- * get uid
- *
- * @return the uid
- */
- public String getUid() {
- return uid;
- }
-
- /**
- * set uid
- *
- * @param uid the uid to set
- */
- public void setUid(String uid) {
- this.uid = uid;
- }
-
- /**
- * get separator
- *
- * @return the separator
- */
- public String getSeparator() {
- return separator;
- }
-
- /**
- * set separator
- *
- * @param separator the separator to set
- */
- public void setSeparator(String separator) {
- this.separator = separator;
- }
-
- /**
- * get topic
- *
- * @return the topic
- */
- public String getTopic() {
- return topic;
- }
-
- /**
- * set topic
- *
- * @param topic the topic to set
- */
- public void setTopic(String topic) {
- this.topic = topic;
- }
-
- /**
- * get dataType
- *
- * @return the dataType
- */
- public DataTypeEnum getDataType() {
- return dataType;
- }
+ public static KafkaIdConfig create(DataFlowConfig dataFlowConfig) {
+ KafkaSinkConfig sinkConfig = (KafkaSinkConfig)
dataFlowConfig.getSinkConfig();
- /**
- * set dataType
- *
- * @param dataType the dataType to set
- */
- public void setDataType(DataTypeEnum dataType) {
- this.dataType = dataType;
+ return KafkaIdConfig.builder()
+ .inlongGroupId(dataFlowConfig.getInlongGroupId())
+ .inlongStreamId(dataFlowConfig.getInlongStreamId())
+ .uid(InlongId.generateUid(dataFlowConfig.getInlongGroupId(),
dataFlowConfig.getInlongStreamId()))
+ .topic(sinkConfig.getTopicName())
+ .dataType(DataTypeEnum.TEXT)
Review Comment:
Please make it configurable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]