You've already forked DataMate
feature: add mysql collection and starrocks collection (#222)
* fix: fix the path for backend-python imaage building * feature: add mysql collection and starrocks collection * feature: add mysql collection and starrocks collection * fix: change the permission of those files which collected from nfs to 754 * fix: delete collected files, config files and log files while deleting collection task * fix: add the collection task detail api * fix: change the log of collecting for dataset * fix: add collection task selecting while creating and updating dataset * fix: set the umask value to 0022 for java process
This commit is contained in:
@@ -69,12 +69,14 @@ public class NfsReader extends Reader {
|
||||
private Configuration jobConfig;
|
||||
private String mountPoint;
|
||||
private Set<String> fileType;
|
||||
private List<String> files;
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
this.jobConfig = super.getPluginJobConf();
|
||||
this.mountPoint = this.jobConfig.getString("mountPoint");
|
||||
this.fileType = new HashSet<>(this.jobConfig.getList("fileType", Collections.emptyList(), String.class));
|
||||
this.files = this.jobConfig.getList("files", Collections.emptyList(), String.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,6 +85,7 @@ public class NfsReader extends Reader {
|
||||
List<String> files = stream.filter(Files::isRegularFile)
|
||||
.filter(file -> fileType.isEmpty() || fileType.contains(getFileSuffix(file)))
|
||||
.map(path -> path.getFileName().toString())
|
||||
.filter(fileName -> this.files.isEmpty() || this.files.contains(fileName))
|
||||
.collect(Collectors.toList());
|
||||
files.forEach(filePath -> {
|
||||
Record record = recordSender.createRecord();
|
||||
|
||||
Reference in New Issue
Block a user