yuqi1129 commented on code in PR #7936:
URL: https://github.com/apache/gravitino/pull/7936#discussion_r2253499996
##########
core/src/main/java/org/apache/gravitino/job/JobManager.java:
##########
@@ -103,6 +127,32 @@ public JobManager(Config config, EntityStore entityStore,
IdGenerator idGenerato
String.format("Failed to create staging directory %s",
stagingDirPath));
}
}
+
+ this.jobStagingDirKeepTimeInMs =
config.get(Configs.JOB_STAGING_DIR_KEEP_TIME_IN_MS);
+ this.cleanUpExecutor =
+ Executors.newSingleThreadScheduledExecutor(
+ runnable -> {
+ Thread thread = new Thread(runnable, "job-staging-dir-cleanup");
+ thread.setDaemon(true);
+ return thread;
+ });
+ long scheduleInterval = jobStagingDirKeepTimeInMs / 10;
Review Comment:
You'd better add a check that `jobStagingDirKeepTimeInMs` is larger than 10;
##########
core/src/main/java/org/apache/gravitino/job/JobManager.java:
##########
@@ -470,7 +620,7 @@ static String replacePlaceholder(String inputString,
Map<String, String> replace
return inputString; // Return as is if the input string is blank
}
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
Review Comment:
Is there any thread-race problem for `StringBuffer` here?
--
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]