Skip to content
Snippets Groups Projects
Commit a986312d authored by Rafal Mucha's avatar Rafal Mucha
Browse files

Merge branch 'NXCALS-7569-fix-generating-tmp-working-dir' into 'develop'

NXCALS-7569 Improve generation of tmp working dir for compactor jobs

Closes NXCALS-7569

See merge request !1942
parents d9325069 69f154c5
No related branches found
No related tags found
1 merge request!1942NXCALS-7569 Improve generation of tmp working dir for compactor jobs
......@@ -37,6 +37,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
......@@ -78,8 +79,8 @@ public abstract class BaseJobProcessor<T extends DataProcessingJob> implements J
private final LoadingCache<Long, String> timestampFieldsCache;
protected BaseJobProcessor(@NonNull FileSystem fileSystem, @NonNull Lazy<SparkSession> ctx,
@NonNull InternalSystemSpecService systemService,
@NonNull @Value("${compactor.work.dir}") String compactionDir) {
@NonNull InternalSystemSpecService systemService,
@NonNull @Value("${compactor.work.dir}") String compactionDir) {
this.fs = fileSystem;
this.sparkSessionLazy = ctx;
this.systemService = systemService;
......@@ -199,7 +200,7 @@ public abstract class BaseJobProcessor<T extends DataProcessingJob> implements J
protected Path createTempCompactionPath(T job, String filePrefix) {
return new Path(compactionDir + Path.SEPARATOR + "compaction" + job.getDestinationDir().getPath()
.replace(Path.SEPARATOR_CHAR, '-') + "-" + filePrefix + System.currentTimeMillis());
.replace(Path.SEPARATOR_CHAR, '-') + "-" + filePrefix + UUID.randomUUID());
}
private void startLog(T job) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment