pocozh commented on code in PR #5261:
URL: https://github.com/apache/inlong/pull/5261#discussion_r934507923
##########
inlong-agent/agent-core/src/main/java/org/apache/inlong/agent/core/trigger/TriggerManager.java:
##########
@@ -120,9 +120,13 @@ public boolean submitTrigger(TriggerProfile
triggerProfile) {
*/
public void preprocessTrigger(TriggerProfile profile) {
String syncType = profile.get(JobConstants.JOB_FILE_COLLECT_TYPE, "");
- if (FileCollectType.FULL.equals(syncType)) {
- LOGGER.info("Initialize submit full path. trigger {} ",
profile.getTriggerId());
- manager.getJobManager().submitFileJobProfile(profile);
+ switch (FileConstants.valueOf(syncType)) {
+ case FULL:
+ case INCREMENT:
Review Comment:
Why `INCREMENT` mode needs being preprocessed here?
##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/reader/TextFileReader.java:
##########
@@ -140,7 +161,26 @@ public void setWaitMillisecond(long millis) {
@Override
public String getSnapshot() {
- return StringUtils.EMPTY;
+ if (Objects.nonNull(localSnapshot)) {
+ return file.getPath() + JOB_OFFSET_DELIMITER_TASK +
localSnapshot.getSnapshot();
Review Comment:
It's better to add ut to verify offsets of multi tasks while custom
end-of-line symbols
##########
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/sources/TextFileSource.java:
##########
@@ -76,6 +84,28 @@ public List<Reader> split(JobProfile jobConf) {
return result;
}
+ @Override
+ public void initSourceMeta(JobProfile jobProfile) {
+ this.sourceMetas = MetaDataUtils.getSourceMeta(jobProfile);
+ }
+
+ private int getSeekPosition(JobProfile jobConf, File file) {
+ int seekPosition;
+ if (jobConf.hasKey(JobConstants.JOB_FILE_COLLECT_TYPE) &&
FileConstants.INCREMENT.name()
Review Comment:
What about `FULL` mode?
--
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]