Skip to content

Commit

Permalink
Nettoyage des syso dans GridClient.
Browse files Browse the repository at this point in the history
  • Loading branch information
Garath21 committed Jan 29, 2015
1 parent 46e35f1 commit 7ba84ea
Showing 1 changed file with 5 additions and 55 deletions.
60 changes: 5 additions & 55 deletions Code/Pi-Injector-Full/src/main/java/jppf/GridClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -63,7 +64,7 @@ public static GridClient getInstance() {
private int iterationEffectuees = 0;
private Object lockIterationEffectuees = new Object();
private String name = null;
HashMap<String, Double> mapPourcentage = null;
private Map<String, Double> mapPourcentage = null;


public GridClient() {
Expand Down Expand Up @@ -171,7 +172,7 @@ public void handleNotification(
}
}
} catch (Exception e) {
System.out.println("Exception 2 : " + e);
System.out.println(e);
}
}
}
Expand Down Expand Up @@ -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...");
Expand Down Expand Up @@ -331,7 +333,7 @@ public long shortAndFindMinCurrentTime() {
* shortAndFindMinCurrentTime()).
*/
public void aggregationData(Long minCurrentTime) {
TreeMap<Integer, List<DataByInjector>> agregation = new TreeMap<Integer, List<dataExtraction.DataByInjector>>();
Map<Integer, List<DataByInjector>> agregation = new TreeMap<Integer, List<dataExtraction.DataByInjector>>();

//on va stocker la liste de nom des taches
List<String> listNameTask = new ArrayList<String>();
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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<Integer, List<DataByInjector>> entry : agregation.entrySet()) {
System.out.println(entry.getKey());
StringBuilder str = new StringBuilder();
str.append(entry.getKey()+ ";");
agreg = 0;
Expand Down Expand Up @@ -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<AbstractScript> 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();
}*/
}

0 comments on commit 7ba84ea

Please sign in to comment.