diff --git a/Code/Pi-Injector-Full/src/main/java/jppf/GridClient.java b/Code/Pi-Injector-Full/src/main/java/jppf/GridClient.java index cdddac8..f4e3600 100644 --- a/Code/Pi-Injector-Full/src/main/java/jppf/GridClient.java +++ b/Code/Pi-Injector-Full/src/main/java/jppf/GridClient.java @@ -8,6 +8,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.TreeMap; import java.util.Map.Entry; @@ -63,7 +64,7 @@ public static GridClient getInstance() { private int iterationEffectuees = 0; private Object lockIterationEffectuees = new Object(); private String name = null; - HashMap mapPourcentage = null; + private Map mapPourcentage = null; public GridClient() { @@ -171,7 +172,7 @@ public void handleNotification( } } } catch (Exception e) { - System.out.println("Exception 2 : " + e); + System.out.println(e); } } } @@ -275,6 +276,7 @@ public void launchScript( for (int i = 0; i < nbInjector; i++) { InjectionTask jppfTask = new InjectionTask(script, nbIteration, notificationInterval); jppfTask.setId(jppfJob.getName() + " - Task " + i); + jppfTask.setResubmit(false); try { jppfJob.add(jppfTask, (Object[])null); System.out.println("Task " + jppfTask.getId() + " added to the job..."); @@ -331,7 +333,7 @@ public long shortAndFindMinCurrentTime() { * shortAndFindMinCurrentTime()). */ public void aggregationData(Long minCurrentTime) { - TreeMap> agregation = new TreeMap>(); + Map> agregation = new TreeMap>(); //on va stocker la liste de nom des taches List listNameTask = new ArrayList(); @@ -361,7 +363,6 @@ public void aggregationData(Long minCurrentTime) { if((nbSec + duration)%1000000000L <= nbSec%1000000000L) { nbRequestSec++; nbSec+=duration; - System.out.println(nbSec); } else { Integer secSearch = new Integer((int) (nbSec/1000000000L)); @@ -395,7 +396,6 @@ public void aggregationData(Long minCurrentTime) { writer = new PrintWriter(".." + File.separator + "tests-results" + File.separator + name + ".csv", "UTF-8"); int agreg; for(Entry> entry : agregation.entrySet()) { - System.out.println(entry.getKey()); StringBuilder str = new StringBuilder(); str.append(entry.getKey()+ ";"); agreg = 0; @@ -431,54 +431,4 @@ public void aggregationData(Long minCurrentTime) { public void shutdown() { jppfClient.close(); } - - /*public static void main(String[] args) { - - System.out.println("Starting..."); - - LDAPScript ldapScript = new LDAPScript("192.168.1.28", 10389); - ldapScript.addBindRequest("uid=admin,ou=system", "secret"); - - GridClient client = new GridClient(); - //client.launchBroadcastScript(ldapScript); - - List scripts = new ArrayList<>(); - scripts.add(ldapScript); - client.launchScriptList(scripts); - - System.out.println("Finishing..."); - }*/ - - - /*public void launchBroadcastScript(AbstractScript script) { - - JPPFJob jppfJob = new JPPFJob(); - jppfJob.setName("LDAP Injection Job"); - jppfJob.getSLA().setBroadcastJob(true); - - InjectionTask jppfTask = new InjectionTask(script); - jppfTask.setId(jppfJob.getName() + " - Task broadcasted"); - - try { - jppfJob.add(jppfTask, (Object[])null); - } catch (JPPFException e1) { - e1.printStackTrace(); - } - - jppfJob.setBlocking(false); - jppfClient.submitJob(jppfJob); - - System.out.println("Job submitted to " + refreshNodesCount() + " nodes."); - - // Do something here... - try { - Thread.sleep(30000L); - } catch (InterruptedException e) { - e.printStackTrace(); - } - - // Test du job cancel pour arrĂȘter les noeuds - jppfJob.cancel(); - jppfJob.awaitResults(); - }*/ }