Skip to content

Commit

Permalink
feat: batchMode parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lmanelphe committed Feb 20, 2024
1 parent 1331e73 commit d83d1cc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arc-core/src/main/resources/BdD/script_global.sql
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ UPDATE arc.parameter set description='parameter.ihm.sandbox.maxNumberOfFilesRegi
INSERT INTO arc.parameter VALUES ('ArcAction.productionEnvironments','["arc_prod"]');
UPDATE arc.parameter set description='parameter.ihm.sandbox.sandboxListWithProductionGUI' where key='ArcAction.productionEnvironments';

INSERT INTO arc.parameter VALUES ('ArcAction.batchMode','[]');
UPDATE arc.parameter set description='parameter.ihm.sandbox.sandboxListWithBatchMode' where key='ArcAction.batchMode';

-- parallelism parameters
INSERT INTO arc.parameter VALUES ('ApiChargementService.MAX_PARALLEL_WORKERS','2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.JSONArray;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

Expand Down Expand Up @@ -182,8 +185,19 @@ public String executerBatch(Model model, TraitementPhase phaseAExecuter) {
// Maximum number of files processed in each phase iteration
int maxFilesPerPhase = new BDParameters(ArcDatabase.COORDINATOR).getInt(null, "LanceurIHM.maxFilesPerPhase", 10000000);

JSONArray j=new JSONArray(new BDParameters(ArcDatabase.COORDINATOR).getString(null, "ArcAction.batchMode", "[]"));
Set<String> found=new HashSet<>();

j.forEach(item -> {
if (item.toString().equals(getBacASable()))
{
found.add(item.toString());
}
});
String batchMode = found.isEmpty() ? null : "1";

ApiServiceFactory.getService(phaseAExecuter, getBacASable(),
maxFilesPerPhase, null
maxFilesPerPhase, batchMode
).invokeApi();
return generateDisplay(model, RESULT_SUCCESS);
}
Expand Down
1 change: 1 addition & 0 deletions arc-web/src/main/resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ MAPPING\u0020KO=Map KO

parameter.ihm.sandbox.maxNumberOfFilesRegisteredAtTheSameTime=Maximum number of file that can be registered by the reception module in the sandbox execution
parameter.ihm.sandbox.sandboxListWithProductionGUI=List of the sandboxes with a production type GUI
parameter.ihm.sandbox.sandboxListWithBatchMode=List of the sandboxes with batch mode
parameter.parallel.numberOfThread.p1.load=Number of threads allocated to the module #1 "Load"
parameter.database.version.global=Current global database version identifier corresponding to the ARC version identifier on git
parameter.parallel.numberOfThread.p2.xmlStructurize=Number of threads allocated to the module #2 "Structurize XML"
Expand Down
1 change: 1 addition & 0 deletions arc-web/src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ MAPPING\u0020KO=Mapping KO

parameter.ihm.sandbox.maxNumberOfFilesRegisteredAtTheSameTime=Nombre maximum de fichiers pouvant \u00eatre enregistr\u00e9s par le module de r\u00e9ception dans l''ex\u00e9cution du sandbox
parameter.ihm.sandbox.sandboxListWithProductionGUI=Liste des bacs \u00e0 sable avec une interface graphique de type production
parameter.ihm.sandbox.sandboxListWithBatchMode=Liste des bacs \u00e0 sable en mode batch
parameter.parallel.numberOfThread.p1.load=Nombre de threads allou\u00e9s au module #1 "Load"
parameter.database.version.global=Identifiant de version de base de donn\u00e9es globale actuelle correspondant \u00e0 l''identifiant de version ARC sur git
parameter.parallel.numberOfThread.p2.xmlStructurize=Nombre de threads allou\u00e9s au module #2 "Structurer XML"
Expand Down

0 comments on commit d83d1cc

Please sign in to comment.