-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Final Review #6
base: main
Are you sure you want to change the base?
Final Review #6
Conversation
1. Insert data into workflowdb dabatase 2. Create output directory (with date/time stamp) 3. Several imrpvements on json and xml parsing. 4. Updated job monitoring 5. Updated iteration strategies 6. Updated arguments to include and workflowId and match with the command line arguments
Updated Moteurlite.java for the review comments
1. Combined setter methods into corresponding getter methods, eliminating the need for class-level variables. 2. The class now directly returns the parsed values when needed.
1. Modified the constructor to directly use the refactored getter methods of BoutiquesService. 2. This makes the class more streamlined by fetching values directly without maintaining class-level variables. 3. createJob method - Instead of passing arguments to this method, created class level fields and used inside the method.
1. Updated the boutiques parsing classes. 2. Updated moteurlite class 3. Updated InputFileParser class
Moteur lite
improve pom + add ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a new review.
Please do a new PR on develop taking it into account.
* | ||
*/ | ||
|
||
public class InputDownloads { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merge the 3 files :
- InputDownloads
- InputParser
- InputsFileParser
into a single Class InputsFileService
} | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not catch all Exception, only the ones necessary.
Either :
- log with a logger and rethrow a custom Exception
- do not catch it and let it bubble up
* This method parses the types of inputs from the XML file and returns a Map where the key is | ||
* the source name and the value is the type of the input (e.g., String, URI). | ||
*/ | ||
public static Map<String, String> parseInputType(String fileName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used, can be deleted
return inputsMap; | ||
} | ||
|
||
public Map<String, String> getInputTypeMap() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 3 last methods are not used and can be deleted.
} | ||
|
||
// Fetch download files using InputsFileParser | ||
List<URI> downloads = InputsFileParser.getDownloadFiles(inputsMap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of parsing each value for a specific regex, we should rely on the File
types in the boutiques files to build the list of downloads.
value = new File(System.getProperty("user.dir")).toURI().relativize(new File(value).toURI()).getPath(); | ||
URI uri = new URI(value); | ||
String basename = Paths.get(uri.getPath()).getFileName().toString(); | ||
jsonNode.put(key, basename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get that we want to extract the filename from value.
I would do Paths.get(new URI(value).getPath()).getFileName()
. To test
else { | ||
URI uri = new URI(value); | ||
String basename = Paths.get(uri.getPath()).getFileName().toString(); | ||
jsonNode.put(key, basename); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally the else case here is for simple Strings. Why not put the value in the jsonNode ?
String type = map2.get(key); | ||
|
||
if ("Integer".equals(type) || "Number".equals(type)) { | ||
jsonNode.put(key, Integer.parseInt(value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boutiques only support Number, and that can be a float.
URI resultsDirectoryURI = new URI(inputsMap.get("results-directory")); | ||
|
||
// Use BoutiquesService to fetch the input types | ||
String invocationString = CreateInvocation.convertMapToJson(invocation, boutiquesService.getInputType(descriptor)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we can move the convertMapToJson method in this class. It will be short.
src/main/java/fr/insalyon/creatis/moteurlite/WorkflowsDbRepository.java
Outdated
Show resolved
Hide resolved
Moteurlite support
No description provided.