pocozh commented on code in PR #5674: URL: https://github.com/apache/inlong/pull/5674#discussion_r959369953
########## inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/pojo/JobProfileDto.java: ########## @@ -50,6 +50,10 @@ public class JobProfileDto { * kafka source */ public static final String KAFKA_SOURCE = "org.apache.inlong.agent.plugin.sources.KafkaSource"; + /** + * mongo source + */ + public static final String MONGO_SOURCE = "org.apache.inlong.agent.plugin.sources.BinlogSource"; Review Comment: Wrong class name, it should be `MongoDBSource`. ########## inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/MongoDBSource.java: ########## @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.inlong.agent.plugin.sources; + +import org.apache.inlong.agent.conf.JobProfile; +import org.apache.inlong.agent.plugin.Reader; +import org.apache.inlong.agent.plugin.Source; +import org.apache.inlong.agent.plugin.sources.reader.MongoDBReader; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Collections; +import java.util.List; + +/** + * MongoDBSource : mongo source, split mongo source job into multi readers + */ +public class MongoDBSource extends AbstractSource implements Source { Review Comment: No need to implement `Source`. ########## inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/snapshot/SnapshotBase.java: ########## @@ -17,7 +17,33 @@ package org.apache.inlong.agent.plugin.sources.snapshot; +import org.apache.inlong.agent.utils.ThreadUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.OutputStream; +import java.io.ByteArrayOutputStream; +import java.nio.file.Files; +import java.util.Base64; + public interface SnapshotBase { + Logger LOGGER = LoggerFactory.getLogger(SnapshotBase.class); Review Comment: Is it better to create a new `AbstractSnapshot` to implement `SnapshotBase`, and add `file` initialization and these functions in it? Then, sub-snapshots can directly inherit `AbstractSnapshot`. -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org