From: Sébastien Miquée Date: Mon, 8 Feb 2010 11:59:43 +0000 (+0100) Subject: Correction of some messages and comments. X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/jaceP2P.git/commitdiff_plain/90623bf0db7a268b9c697e64f1bb6be61545af31?ds=sidebyside Correction of some messages and comments. --- diff --git a/src/jaceP2P/BackupsManager.java b/src/jaceP2P/BackupsManager.java index 8b96e2f..429fce3 100644 --- a/src/jaceP2P/BackupsManager.java +++ b/src/jaceP2P/BackupsManager.java @@ -399,10 +399,10 @@ public class BackupsManager { } else { is = existBackupTaskOfRank(rank, tag); if (is != -1) { - // System.out.println("chercher un backup normale"); + // System.out.println("chercher un backup normal"); return (Backup) liste.get(is); } else { - System.out.println("cette tache ou ce backup existe po"); + System.out.println("cette tache ou ce backup existe pas"); return null; } } @@ -415,7 +415,7 @@ public class BackupsManager { // System.out.println("chercher un backup convg"); return (Backup) liste_Convg.get(is); } else { - System.out.println("cette tache ou ce backup existe po"); + System.out.println("cette tache ou ce backup existe pas"); return null; } } diff --git a/src/jaceP2P/HeartBeatThread.java b/src/jaceP2P/HeartBeatThread.java index 9e88be2..058f15f 100644 --- a/src/jaceP2P/HeartBeatThread.java +++ b/src/jaceP2P/HeartBeatThread.java @@ -107,7 +107,7 @@ public class HeartBeatThread extends Thread { count = 0; } else System.out - .println("The server returned a null register oh nooooooooooooooooooo"); + .println("The server returned a null register !"); } catch (Exception e2) { System.err .println("Unable to contact the Spawner :" diff --git a/src/jaceP2P/JaceP2P.java b/src/jaceP2P/JaceP2P.java index b3554d5..b089874 100644 --- a/src/jaceP2P/JaceP2P.java +++ b/src/jaceP2P/JaceP2P.java @@ -49,7 +49,7 @@ public class JaceP2P { algoMapping = new Integer(args[7]).intValue(); paramAlgo = new Double(args[8]).doubleValue(); } catch (NumberFormatException e) { - System.out.println("the number of Daemons per spawner and the number of daemons per thread must be integers: " + System.err.println("The number of Daemons per spawner and the number of daemons per thread must be integers: " + e); System.exit(0); } @@ -76,8 +76,8 @@ public class JaceP2P { try { beat = new Integer(args[4]).intValue(); } catch (NumberFormatException e) { - System.out - .println("the beat number must be an integer: " + System.err + .println("The beat number must be an integer: " + e); System.exit(0); } diff --git a/src/jaceP2P/JaceServer.java b/src/jaceP2P/JaceServer.java index d7aaeea..8b973ef 100644 --- a/src/jaceP2P/JaceServer.java +++ b/src/jaceP2P/JaceServer.java @@ -33,7 +33,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface { JaceSuperNodeInterface snodeStub, int rank, int heartTime, int tag, int nbdc, int nbsdc, int nbDaemonPerSpawner, int nbDaemonPerThread) throws RemoteException { - System.out.println("beginning the transformation ........."); + System.out.println("Beginning the transformation ..."); // @SuppressWarnings("unused") // JaceSpawner spawner = new JaceSpawner(params, appliName, reg, nbTasks, // snodeStub, rank, heartTime, tag, nbdc, nbsdc, @@ -59,7 +59,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface { // 1 - replace the old Register by the new one System.out.println(" \n\n NEW REGISTER \n\n"); // if(Register.Instance().getVersion()<=newReg.getVersion()){ - System.out.println("replacing Register !!!!!!$$$$$$$$******"); + System.out.println("Replacing Register ..."); Register.Instance().replaceBy(newReg); Register.Instance().viewAll(); // } @@ -107,7 +107,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface { myTaskId.setHostStub(node.getStub()); } catch (Exception e) { - System.out.println("error in updateregister :" + e); + System.err.println("Error in updateregister :" + e); // e.printStackTrace(); } } @@ -128,7 +128,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface { } public void suicide(String debugMsg) throws RemoteException { - System.out.println("suiciiiiiiiiiiiide : "/* + debugMsg */); +// System.out.println("suiciiiiiiiiiiiide : "/* + debugMsg */); new ReinitDaemon().start(); } @@ -260,7 +260,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface { ScanThread.Instance().notify(); } } catch (Exception e) { - System.out.println("error in setScanning: " + e); + System.err.println("Error in setScanning: " + e); } // System.out.println("before notify!!!!!!!!!"); // try{ScanThread.Instance().notify();} diff --git a/src/jaceP2P/JaceSession.java b/src/jaceP2P/JaceSession.java index 48c3881..ae36e6b 100644 --- a/src/jaceP2P/JaceSession.java +++ b/src/jaceP2P/JaceSession.java @@ -51,17 +51,17 @@ public class JaceSession { System.out.println("I m going to kill the thread"); // taskThread.join(); taskThread.stop(); - System.out.println("thread stopped without pb!!!!!!!"); + System.out.println("Thread stopped without problem."); taskThread = null; } catch (Exception e) { - System.out.println("ERROR : thread not join : " + e); - System.out.println("I m going to kill the thread"); + System.err.println("ERROR : thread not join : " + e); + System.err.println("I m going to kill the thread"); try { taskThread.stop(); - System.out.println("thread stopped after a problem !!!!!!!"); + System.out.println("Thread stopped after a problem !"); taskThread = null; } catch (Exception e2) { - System.out.println("ERROR thread not killed : " + e); + System.err.println("ERROR thread not killed : " + e); } } diff --git a/src/jaceP2P/JaceSpawnerServer.java b/src/jaceP2P/JaceSpawnerServer.java index 502c059..9528cf0 100644 --- a/src/jaceP2P/JaceSpawnerServer.java +++ b/src/jaceP2P/JaceSpawnerServer.java @@ -63,7 +63,7 @@ public class JaceSpawnerServer extends UnicastRemoteObject implements res = RunningApplication.Instance().getChrono().getValue(); // System.out.println("temps chrono : " + res + " ms\n"); } else { - System.out.println("pas d'appli de ce nom sur ce spawner"); + System.err.println("No application of name "+appliName+" on this Spawner !"); } return res; } @@ -88,7 +88,7 @@ public class JaceSpawnerServer extends UnicastRemoteObject implements public void signalDeadNode(JaceInterface host, int rankOfDead) throws RemoteException { - System.out.println("signalDeadNode of rank " + rankOfDead); + System.out.println("SignalDeadNode of rank " + rankOfDead); JaceSpawner.Instance().signalDeadNode(host, rankOfDead); } @@ -139,7 +139,7 @@ public class JaceSpawnerServer extends UnicastRemoteObject implements myTaskId.setHostStub(node.getStub()); // Register.Instance().setVersion(Register.Instance().getVersion()+1); RunningApplication.Instance().incrementNumberOfDisconnections(); - System.out.println("replacing node: " + oldNode.getName() + " with: " + System.out.println("Replacing node: " + oldNode.getName() + " with: " + node.getName()); // Register.Instance().getListeOfTasks().viewAll(); } diff --git a/src/jaceP2P/ListeTask.java b/src/jaceP2P/ListeTask.java index fbaf60f..fdc76ad 100644 --- a/src/jaceP2P/ListeTask.java +++ b/src/jaceP2P/ListeTask.java @@ -36,8 +36,8 @@ public class ListeTask implements java.io.Serializable, java.lang.Cloneable { if (is != -1) { return (TaskId) liste.get(is); } else { - System.out - .println("There is no task affected to this host stub !!!!! "); + System.err + .println("There is no task affected to this host stub !"); return null; } } @@ -52,7 +52,7 @@ public class ListeTask implements java.io.Serializable, java.lang.Cloneable { if (is != -1) { return (TaskId) liste.get(is); } else { - System.out.println("TaskId of rank=" + rank + " doesn't exist"); + System.err.println("TaskId of rank=" + rank + " doesn't exist"); viewAll(); return null; } diff --git a/src/jaceP2P/MsgQueue.java b/src/jaceP2P/MsgQueue.java index b726451..39bdbd0 100644 --- a/src/jaceP2P/MsgQueue.java +++ b/src/jaceP2P/MsgQueue.java @@ -132,7 +132,7 @@ public class MsgQueue { // tmp.getSender().getHostIP()); return tmp; } else { - // System.out.println("existe po :(((( "+tag+"---"+id); + // System.out.println("existe pas :(((( "+tag+"---"+id); return null; } } @@ -159,7 +159,7 @@ public class MsgQueue { } } - // les reception bloqunte + // les reception bloquantes /* * public synchronized Message getBl(int id) { int is = -1; // * System.out.println("Taille de la file: "+liste.size()); if diff --git a/src/jaceP2P/Register.java b/src/jaceP2P/Register.java index 55600ac..e6f88cf 100644 --- a/src/jaceP2P/Register.java +++ b/src/jaceP2P/Register.java @@ -41,8 +41,9 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { public synchronized int existNode(Node node) { if (node == null) { - System.out - .println("!!!!!!!!!!!!!!!!!!!!!!!!! node est null ds existNode"); + System.err + .println("Node est null dans existNode"); + return -1 ; } int existe = -1; int index = 0; @@ -64,8 +65,8 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { public synchronized void addNode(Node host) { int is = -1; if (host == null) { - System.out - .println("ds Register.addNode : host.getIP() == null !!!!!!!!!!!!!!!"); + System.err + .println("In Register.addNode : host.getIP() == null !"); } is = existNodeOfStub(host.getStub()); if (is != -1) { @@ -86,8 +87,9 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { public synchronized int existNodeOfStub(JaceInterface stub) { // System.out.println("remote " + stub + "\n\n"); if (stub == null) { - System.out - .println("!!!!!!!!!!!!!!!!!!!!!!!!! stub = NULL ds existNodeOfStub = "); + System.err + .println("Stub = NULL in existNodeOfStub"); + return -1 ; } int existe = -1; int index = 0; @@ -107,8 +109,8 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { return null; } else { if (stub == null) { - System.out - .println("ds Register.getNodeOfStub : stub == null !!!!!!!!!!!!!!!"); + System.err + .println("In Register.getNodeOfStub : stub == null !"); } is = existNodeOfStub(stub); if (is != -1) { @@ -126,8 +128,8 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { return null; } else { if (name == null) - System.out - .println("ds Register.getNodeOfName : name == null !!!!!!!!!!!!!!!"); + System.err + .println("In Register.getNodeOfName : name == null !"); int index = 0; while ((is == -1) && (index < liste.size())) { @@ -224,7 +226,7 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { try { ((Node) liste.elementAt(i)).getOutputStream().close(); } catch (Exception e) { - System.out.println("unable to close outputStream :" + e); + System.err.println("Unable to close outputStream :" + e); } } liste.clear(); @@ -258,7 +260,7 @@ public class Register implements java.io.Serializable, java.lang.Cloneable { String inter = "\n\t"; String count = ""; if (liste.isEmpty()) { - System.out.println("My Register is empty !!!!!"); + System.err.println("My Register is empty !!!!!"); } else { for (int i = 0; i < liste.size(); i++) { noeud = getNodeAt(i); diff --git a/src/jaceP2P/ScanThreadSpawner.java b/src/jaceP2P/ScanThreadSpawner.java index 412c0d7..b1b6969 100644 --- a/src/jaceP2P/ScanThreadSpawner.java +++ b/src/jaceP2P/ScanThreadSpawner.java @@ -35,7 +35,7 @@ public class ScanThreadSpawner extends Thread { public static ScanThreadSpawner Instance() { if (Instance == null) { - System.out.println("creating new ScanThreadSpawner "); + System.out.println("Creating new ScanThreadSpawner "); Instance = new ScanThreadSpawner(); } return Instance; @@ -53,7 +53,7 @@ public class ScanThreadSpawner extends Thread { @SuppressWarnings("static-access") public void run() { - System.out.println("start ScanThreadSpawner......."); + System.out.println("Start ScanThreadSpawner......."); while (running) { // System.out.println("ScanThread alive......."); try { @@ -92,10 +92,10 @@ public class ScanThreadSpawner extends Thread { boolean response = false; try { response = previousSpawner.ping(); - System.out.println("previous spawner is still alive"); + System.out.println("Previous spawner is still alive"); } catch (Exception e) { System.out - .println("the previous spawner is officially dead " + .println("The previous spawner is officially dead " + e); } if (response == false) { @@ -104,7 +104,7 @@ public class ScanThreadSpawner extends Thread { } } } catch (Exception e) { - System.out.println("error in test neighbor: " + e); + System.err.println("Error in test neighbor: " + e); } } } diff --git a/src/jaceP2P/ScanThreadSuperNode.java b/src/jaceP2P/ScanThreadSuperNode.java index 373d1bb..1f3dad6 100644 --- a/src/jaceP2P/ScanThreadSuperNode.java +++ b/src/jaceP2P/ScanThreadSuperNode.java @@ -22,7 +22,7 @@ public class ScanThreadSuperNode extends Thread { public static ScanThreadSuperNode Instance() { if (Instance == null) { - System.out.println("creating new ScanThreadSuperNode "); + System.out.println("Creating new ScanThreadSuperNode "); Instance = new ScanThreadSuperNode(); } return Instance; @@ -47,7 +47,7 @@ public class ScanThreadSuperNode extends Thread { // } @SuppressWarnings("static-access") public void run() { - System.out.println("start ScanThread for SuperNode......."); + System.out.println("Start ScanThread for SuperNode......."); while (true) { // System.out.println("ScanThread alive......."); /* @@ -90,7 +90,7 @@ public class ScanThreadSuperNode extends Thread { index = SuperNodeListe.Instance().getListe().size() - 1; SuperNodeData data; synchronized (SuperNodeListe.Instance()) { - System.out.println("removing " + System.out.println("Removing " + ((SuperNodeData) SuperNodeListe.Instance() .getListe().elementAt(index)).getIP()); data = (SuperNodeData) SuperNodeListe.Instance().getListe() @@ -110,8 +110,8 @@ public class ScanThreadSuperNode extends Thread { .getListe().elementAt(i)).getStub() .removeSuperNode(data); } catch (Exception e2) { - System.out - .println("error diffusing the message concerning a dead superNode: " + System.err + .println("Error diffusing the message concerning a dead superNode: " + e2); } if (token == true) { @@ -132,7 +132,7 @@ public class ScanThreadSuperNode extends Thread { } } catch (Exception e) { - System.out.println("error in testNeighbor: " + e); + System.err.println("Error in testNeighbor: " + e); } } diff --git a/src/jaceP2P/SendVerdictThread.java b/src/jaceP2P/SendVerdictThread.java index 794cbda..ee8d4f5 100644 --- a/src/jaceP2P/SendVerdictThread.java +++ b/src/jaceP2P/SendVerdictThread.java @@ -21,8 +21,8 @@ public class SendVerdictThread extends Thread { sendId, verifNum, verdict); JaceSession.Instance().getTaskObject().broadcastTasks(3); } catch (Exception e) { - System.out - .println("le message de verdict n'est pas recu :" + e); + System.err + .println("The verdict message is not received: " + e); try { Thread.sleep(500); } catch (Exception ex) { diff --git a/src/jaceP2P/SendVerifThread.java b/src/jaceP2P/SendVerifThread.java index ef89b35..92da23e 100644 --- a/src/jaceP2P/SendVerifThread.java +++ b/src/jaceP2P/SendVerifThread.java @@ -20,7 +20,7 @@ public class SendVerifThread extends Thread { sendId, verifNum); JaceSession.Instance().getTaskObject().broadcastTasks(3); } catch (Exception e) { - System.out.println("le message de verif n'est pas recu :" + e); + System.err.println("The verification message is not received: " + e); try { Thread.sleep(500); } catch (Exception ex) { diff --git a/src/jaceP2P/Sender.java b/src/jaceP2P/Sender.java index a057e10..f14d44a 100644 --- a/src/jaceP2P/Sender.java +++ b/src/jaceP2P/Sender.java @@ -52,11 +52,11 @@ public class Sender extends Thread { msg = buffer.get(); if (msg.getReceiver() == null) { - System.out.println("In jaceSend recv = null !!!!!"); + System.err.println("In jaceSend recv = null !!!!!"); // System.out.println("msg.getReceiver() : " + // msg.getReceiver()); - System.out.println(" recv is null in msg of SENDER " + System.err.println("Rkecv is null in msg of SENDER " + LocalHost.Instance().getName()); } diff --git a/src/jaceP2P/SenderRmi.java b/src/jaceP2P/SenderRmi.java index 3e4bd71..a0e03d4 100644 --- a/src/jaceP2P/SenderRmi.java +++ b/src/jaceP2P/SenderRmi.java @@ -65,7 +65,7 @@ public class SenderRmi extends Sender { yield(); } catch (Exception e) { - System.out + System.err .println("Can't send the messgae to " + msg.getReceiver().getHostName() + ". Error: " + e); diff --git a/src/jaceP2P/SenderSocket.java b/src/jaceP2P/SenderSocket.java index 5b50440..f0366de 100644 --- a/src/jaceP2P/SenderSocket.java +++ b/src/jaceP2P/SenderSocket.java @@ -95,8 +95,8 @@ public class SenderSocket extends Sender { msgIsSent = true; yield(); } catch (Exception e) { - System.out - .println("error in SenderSocket run method :" + e); + System.err + .println("Error in SenderSocket run method :" + e); // System.out.println("SENDER : the node of task " + // msg.getReceiver().getHostIP() + " is dead !!!! " + e); diff --git a/src/jaceP2P/SuperNodeListe.java b/src/jaceP2P/SuperNodeListe.java index fc4a23c..8dfbe8b 100644 --- a/src/jaceP2P/SuperNodeListe.java +++ b/src/jaceP2P/SuperNodeListe.java @@ -46,6 +46,9 @@ public class SuperNodeListe implements Cloneable { // TODO change to have non-static list // using a config file // in order to discover new superNodes dynamicaly + + /* Sébastien Miquée -- ajout de la lecture du fichier de config **/ + @SuppressWarnings("unchecked") public void staticInitialization() { String adr = ""; @@ -64,7 +67,7 @@ public class SuperNodeListe implements Cloneable { br.close(); } catch (Exception e) { - System.out.println(e.toString()); + System.err.println(e.toString()); } // String adr1 = @@ -137,8 +140,8 @@ public class SuperNodeListe implements Cloneable { if (is != -1) { ((SuperNodeData) liste.elementAt(is)).setStub(stub); } else { - System.out.println("this superNode does not exist : " + snode); - System.out.println("add the new SuperNode"); + System.err.println("This superNode does not exist : " + snode); + System.out.println("Add the new SuperNode"); SuperNodeData data = new SuperNodeData(snode, port); data.setStub(stub); data.setNbOfNodes(0); @@ -163,14 +166,14 @@ public class SuperNodeListe implements Cloneable { return null; } else { if (superNode == null) { - System.out + System.err .println("In Register.getNode : host == null !!!!!!!!!!!!!!!"); } is = existSuperNode(superNode); if (is != -1) { return ((SuperNodeData) liste.get(is)).getStub(); } else { - System.out.println("this superNode does not exist"); + System.err.println("This superNode does not exist"); return null; } } @@ -178,8 +181,8 @@ public class SuperNodeListe implements Cloneable { public synchronized int existSuperNode(String snode) { if (snode == null) { - System.out - .println("!!!!!!!!!!!!!!!!!!!!!!!!! hostIP in existNode = " + System.err + .println("HostIP in existNode = " + snode); } int existe = -1; @@ -224,7 +227,7 @@ public class SuperNodeListe implements Cloneable { SuperNodeData d = (SuperNodeData) liste.elementAt(is); d.setNbOfNodes(nb); } else { - System.out.println("ce superNode existe pas ds ma liste : " + IP); + System.err.println("This SuperNode does not exists in my list: " + IP); } } @@ -272,7 +275,7 @@ public class SuperNodeListe implements Cloneable { System.out.println("size:" + liste.size()); viewAll(); } catch (Exception e) { - System.out.println("SuperNode " + remoteIP + System.err.println("SuperNode " + remoteIP + " is down or not already launched: " + e); } } else @@ -289,8 +292,8 @@ public class SuperNodeListe implements Cloneable { liste.add(data); TokenThread.Instance().setToken(); } else { - System.out - .println("no superNode alive in the static List, closing application"); + System.err + .println("No superNode alive in the static List, closing application"); System.exit(1); } @@ -315,7 +318,7 @@ public class SuperNodeListe implements Cloneable { // System.out.println("je remove le noeud de rang " + i); liste.remove(i); } else { - System.out.println("super node existe pas"); + System.err.println("The SuperNode does not exists!"); } } diff --git a/src/jaceP2P/Task.java b/src/jaceP2P/Task.java index 30a3240..7dfd861 100644 --- a/src/jaceP2P/Task.java +++ b/src/jaceP2P/Task.java @@ -82,7 +82,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // if no stub there is a problem if (stub == null) { - System.out.println("unable to SEND backup on task of rank " + rank); + System.err.println("Unable to send backup on task of rank " + rank); } else { // if there is a stub, send the stream to that node try { @@ -103,7 +103,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { } } } catch (Exception e) { - System.out.println("error in getBackupForNewNode :" + e); + System.err.println("Error in getBackupForNewNode :" + e); e.printStackTrace(System.out); } } @@ -132,11 +132,11 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { jaceSize = Register.Instance().getNbOfTasks(); } catch (Exception e) { try { - System.out.println("setId is bad !! " + e + " " + System.err.println("SetId is bad !! " + e + " " + LocalHost.Instance().getName()); // jaceSize = Register.Instance().getListeOfTasks().getSize(); } catch (Exception e2) { - System.out.println("not localised the spawner : " + e2); + System.err.println("Not localised the spawner : " + e2); } } } @@ -191,15 +191,15 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { public void jaceFinalize() { finalize = true; - System.out.println("ready to Death Task:" + jaceMyId); + System.out.println("Ready to Death Task:" + jaceMyId); try { Register.Instance().getSpawnerStub().killApplication( LocalHost.Instance().getStub()); } catch (Exception e) { - System.out - .println("pas reussit a joindre Spawner pr killApplication : " + System.err + .println("Cannot join the Spawner to kill application: " + e); } @@ -217,7 +217,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { reinitializeVectors(); } catch (Exception e) { - System.out.println("erreur ds jaceP2P_reinitConv():" + e); + System.err.println("Error in jaceP2P_reinitConv():" + e); } pseudoPerBeg = false; pseudoPerEnd = false; @@ -245,7 +245,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { result = Register.Instance().getSpawnerStub().getChronoValue( Register.Instance().getAppliName()); } catch (Exception e) { - System.out + System.err .println("JaceP2P_Error in Task.jaceP2P_getChronoValue() on SuperNode : " + e); } @@ -276,7 +276,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { recev = Register.Instance().getListeOfTasks().getTaskIdOfRank(dest); if (recev == null) { - System.out.println("In jaceSend recv = null !"); + System.err.println("In jaceSend recv = null !"); try { JaceSession.Instance().getTaskThread().sleep(10); JaceSession.Instance().getTaskThread().yield(); @@ -287,7 +287,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // TODO : virer ce else, mais chercher pkoi recev est null des fois else { if (recev.getRank() != dest) { - System.out.println("Problem !! pas le meme dest que ds les param"); + System.err.println("Problem !! pas le meme dest que ds les param"); } // creer le Message @@ -320,7 +320,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // SenderSocket.Instance().getBuffer().add(msg); } } catch (Exception e) { - System.out.println("unable to send data message to " + dest + System.err.println("Unable to send data message to " + dest + ": " + e); } // System.out.println("TASK : g mis un msg qui doit etre envoye"); @@ -339,7 +339,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { } } catch (Exception e) { if (Register.Instance().getListeOfTasks() == null) - System.out.println("Liste des taches est nulle: " + e); + System.err.println("Tasks list is null: " + e); } } @@ -386,8 +386,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { } } catch (Exception e) { - System.out.println("error jaceReceive :" + e); - System.out.println("sender=" + sender); + System.err.println("Error jaceReceive :" + e); + System.err.println("Sender=" + sender); } return (tmp.getData()); } else { @@ -397,7 +397,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // + ") taille MsgQueue : " + MsgQueue.Instance().getSize()); } catch (Exception e) { if (Register.Instance().getListeOfTasks() == null) - System.out.println("Liste des taches est nulle: " + e); + System.err.println("Tasks list is null: " + e); } try { JaceSession.Instance().getTaskThread().sleep(10); @@ -487,8 +487,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { .getTaskIdOfRank(saveTab[i]); // ///////////////////////////pb stub = task.getHostStub(); } catch (Exception e) { - System.out - .println("pb in the broadcast, ligne d'assignation de task ds broadcats: " + System.err + .println("Problem in the broadcast, ligne d'assignation de task ds broadcats: " + e); } @@ -532,8 +532,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { .getTaskIdOfRank(saveTab[i]); // ///////////////////////////pb stub = task.getHostStub(); } catch (Exception e) { - System.out - .println("pb in the broadcast, ligne d'assignation de task ds broadcats: " + System.err + .println("Problem in the broadcast, ligne d'assignation de task ds broadcats: " + e); } @@ -574,7 +574,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { fluxOut.writeObject(t); fluxOut.close(); } catch (Exception e) { - System.out + System.err .println("JaceP2P_Error in Task.jaceP2P_ReinitConv() when converting Task in Stream : " + e); } @@ -592,7 +592,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { fluxOut.writeObject(t); fluxOut.close(); } catch (Exception e) { - System.out + System.err .println("JaceP2P_Error in Task.jaceP2P_ReinitConv() when converting Task in Stream : " + e); } @@ -647,7 +647,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { sauv.lastSave = lastSave; } } catch (Exception e) { - System.out.println("probleme ds rmi"); + System.err.println("Problem with RMI !"); } return sauv; @@ -684,7 +684,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { } sauvConvg.initialized = true; } catch (Exception e) { - System.out.println("probleme ds rmi" + e); + System.err.println("Problem with RMI:" + e); } return sauvConvg; @@ -741,11 +741,11 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { .println("I got a null register from the spawner"); broadcastTasks(tag); System.out - .println("sleeping till acknowledge saved"); + .println("Sleeping till acknowledge saved"); count = 0; } catch (Exception e2) { - System.out - .println("unable to get register from spawner :" + System.err + .println("Unable to get register from spawner :" + e2); e2.printStackTrace(System.out); } @@ -786,7 +786,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { printResp(); printDep(); } catch (Exception e) { - System.out.println("error printing status in Task :" + e); + System.err.println("Error printing status in Task :" + e); } Thread.yield(); if (action.equals("sendVerif") && state.equals("VERIF") @@ -829,8 +829,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { state = "VERIF"; broadcastTasks(3); } catch (Exception e) { - System.out - .println("le message de verification n'est pas recu: " + System.err + .println("The verification message is not received: " + e); Register.Instance().viewAll(); } @@ -855,8 +855,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { broadcastTasks(3); } } catch (Exception e) { - System.out - .println("unable to decrease the number of neighbors not converged on node :" + System.err + .println("Unable to decrease the number of neighbors not converged on node :" + recev.getHostName() + " count =" + count @@ -879,8 +879,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { count = 0; } catch (Exception e2) { - System.out - .println("unable to contact the spawner :" + System.err + .println("Unable to contact the spawner: " + e2); } } @@ -900,8 +900,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { broadcastTasks(3); } catch (Exception e) { - System.out - .println("le message de verification n'est pas recu:" + System.err + .println("The verification message is not received:" + e); } } else if (jaceMyId > neighId) { @@ -913,8 +913,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { state = "VERIF"; broadcastTasks(3); } catch (Exception e) { - System.out - .println("le message de verification n'est pas recu:" + System.err + .println("The verification message is not received: " + e); } } @@ -955,7 +955,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { waitForAck(1); } } catch (Exception e) { - System.out.println("erreur: " + e); + System.err.println("Error: " + e); } } } else if (pseudoPerEnd == true) { @@ -987,8 +987,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { reinitializePPEr(); broadcastTasks(3); } catch (Exception e) { - System.out - .println("unable to broadcast a negative verdict :" + System.err + .println("Unable to broadcast a negative verdict :" + e); } } @@ -1012,8 +1012,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { broadcastTasks(3); } catch (Exception e) { - System.out - .println("response not received:" + e); + System.err + .println("Response not received:" + e); Register.Instance().viewAll(); } } @@ -1043,7 +1043,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { broadcastTasks(3); } catch (Exception e) { - System.out.println("response not received by " + System.err.println("Response not received by " + rank + ": " + e); Register.Instance().viewAll(); } @@ -1069,7 +1069,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { spawnerStub.setOver(true); // localStub.setState("FINISHED"); } catch (Exception e) { - System.out.println("erreur erreur" + e); + System.err.println("Error" + e); } } else if (!respSent) { int index = recievedAllRespMinusOne(); @@ -1093,7 +1093,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // System.out.println("send response to"+rank); } } catch (Exception e) { - System.out.println("reponse non recue" + e); + System.err.println("Response not received" + e); } } } @@ -1112,7 +1112,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { postReloading = false; } catch (Exception e) { - System.out.println(" Exception in Global Convergence :" + e); + System.err.println("Exception in Global Convergence :" + e); e.printStackTrace(System.out); Register.Instance().viewAll(); } @@ -1519,8 +1519,8 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { .getTaskIdOfRank(taskRankDest); // ///////////////////////////pb stub = task.getHostStub(); } catch (Exception e) { - System.out - .println("problem in SaveTaskThread on assignation line in save : " + System.err + .println("Problem in SaveTaskThread on assignation line in save : " + e); } // System.out.println("ite " + jaceP2P_Iteration + @@ -1549,7 +1549,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { sent = true; } catch (Exception e) { - System.out + System.err .println("JaceP2P_Error in Task.jaceP2P_Save() when saving stream: " + e); j++; @@ -1567,7 +1567,7 @@ public class Task implements Runnable, Cloneable, java.io.Serializable { // 5 - if stream not sent at all, do something (WHAT ???) if (j > saveTab.length) { - System.out + System.err .println("No more alive neighbors for storing the Backup"); // TODO : what to do if no BackupNode has answered ??? } @@ -1622,9 +1622,10 @@ class BroadcastTaskThread extends Thread { } } catch (Exception e) { - System.out - .println("node not reachable by JaceServer.saveTask() in BroadcastTaskThread :" + System.err + .println("Node not reachable by JaceServer.saveTask() in BroadcastTaskThread :" + e); } } } + diff --git a/src/jaceP2P/TaskLauncher.java b/src/jaceP2P/TaskLauncher.java index 19d150e..70eb239 100644 --- a/src/jaceP2P/TaskLauncher.java +++ b/src/jaceP2P/TaskLauncher.java @@ -30,7 +30,7 @@ public class TaskLauncher { // instanciate the appli (the .class of the user) and load it tsk = ((Task) c.newInstance()); } catch (Exception e) { - System.out.println("unable to instanciate the class :" + e); + System.err.println("Unable to instanciate the class :" + e); } try { if (b != null) { @@ -48,7 +48,7 @@ public class TaskLauncher { stream.close(); } catch (Exception e) { - System.out + System.err .println("JaceP2P_Error ds TaskLauncher.loadOrReloadTask() " + "when converting the stream in Task : " + e); @@ -61,12 +61,12 @@ public class TaskLauncher { tsk.setParam(Register.Instance().getParams()); // assign // jaceArgs - System.out.println("PAS de backup"); + System.out.println("No backup"); } // insert Task in taskObject, the attribute of the JaceSession class JaceSession.Instance().addTaskObject(tsk); - System.out.println("after add task"); +// System.out.println("After add task"); if (b != null) { int it = b.getIteration(); @@ -88,7 +88,7 @@ public class TaskLauncher { tsk.nb_not_recv = tskConvg.nb_not_recv; tsk.electedNode = tskConvg.electedNode; tsk.respSent = tskConvg.respSent; - System.out.println("avant le copiage des vecteurs"); +// System.out.println("avant la copie des vecteurs"); tsk.neighbors = (Vector) (tskConvg.neighbors) .clone(); @@ -98,7 +98,7 @@ public class TaskLauncher { tsk.reduceAll = (Vector) (tskConvg.reduceAll) .clone(); tsk.resp = (Vector) (tskConvg.resp).clone(); - System.out.println("apres le copiage des vecteurs"); +// System.out.println("apres la copie des vecteurs"); tsk.underTh = tskConvg.underTh; tsk.verifNum = tskConvg.verifNum; tsk.sendId = tskConvg.sendId; @@ -115,17 +115,17 @@ public class TaskLauncher { } } - System.out.println("ReinitTask!!!!"); + System.out.println("Reinit Task"); tsk.jaceP2P_ReinitTask(); tsk.postReloading = true; tsk.reloading = false; } else { // initialize the task with the appli specific data (Method // jaceP2P_InitTask() overloaded in the appli code by the user) - System.out.println("before Init task"); +// System.out.println("Before Init task"); tsk.jaceP2P_InitTask(); - System.out.println("after Init task"); +// System.out.println("After Init task"); } if (LocalHost.Instance().getStartedThreads() == false) { @@ -158,7 +158,7 @@ public class TaskLauncher { Thread.currentThread().yield(); } catch (Exception e) { - System.out.println("PB in TaskLauncher.loadOrReloadTask() : " + e); + System.err.println("Problem in TaskLauncher.loadOrReloadTask() : " + e); e.printStackTrace(System.out); } } diff --git a/src/jaceP2P/TokenThread.java b/src/jaceP2P/TokenThread.java index 08c4195..531a009 100644 --- a/src/jaceP2P/TokenThread.java +++ b/src/jaceP2P/TokenThread.java @@ -44,13 +44,13 @@ public class TokenThread extends Thread { public void setToken() { token = true; ScanThreadSuperNode.Instance().setToken(false); - System.out.println("the token is put to true in the tokenthread"); + System.out.println("The token is put to true in the tokenthread"); try { synchronized (TokenThread.Instance()) { TokenThread.Instance().notify(); } } catch (Exception e) { - System.out.println("unable to notify :" + e); + System.err.println("Unable to notify :" + e); } // System.out.println("finished set token"); } @@ -104,8 +104,8 @@ public class TokenThread extends Thread { new ForwardCount().start(); } catch (Exception e) { - System.out - .println("unable to send surplus to " + System.err + .println("Unable to send surplus to " + ((SuperNodeData) liste .get(i)).getIP() + " :" + e); @@ -135,7 +135,7 @@ public class TokenThread extends Thread { System.out.println("Passing token to " + index); } catch (Exception e) { try { - System.out.println("Unable to send Token to " + System.err.println("Unable to send Token to " + ((SuperNodeData) liste.elementAt(index)).getIP() + " :" + e); /* diff --git a/src/jaceP2P/UpdateRegisterConcernedThread.java b/src/jaceP2P/UpdateRegisterConcernedThread.java index fc5f6f4..d214061 100644 --- a/src/jaceP2P/UpdateRegisterConcernedThread.java +++ b/src/jaceP2P/UpdateRegisterConcernedThread.java @@ -73,13 +73,12 @@ class UpdateRegisterConcernedThread extends Thread { .intValue()).getHostName(); try { - // whatever the case, uate the Register on each Node + // whatever the case, update the Register on each Node // JaceSpawnerInterface // ja=Register.Instance().getSpawnerStub(); // System.out.println("avant update register"); - // 0 l'applejaacoja commence stub.updateRegister(g, stubVoisin, 0); // System.out.println(" after update register"); @@ -93,7 +92,7 @@ class UpdateRegisterConcernedThread extends Thread { } } catch (Exception e) { - System.out + System.err .println(name + " (" + LocalHost.Instance() @@ -119,7 +118,7 @@ class UpdateRegisterConcernedThread extends Thread { JaceInterface stub = id.getHostStub(); stub.updateRegister(oldNode, node); } catch (Exception e) { - System.out + System.err .println(name + " (" + LocalHost.Instance().resolve(name) @@ -132,7 +131,7 @@ class UpdateRegisterConcernedThread extends Thread { } } } catch (Exception e2) { - System.out.println("error in updateRegisterConcernedThread :" + System.err.println("Error in updateRegisterConcernedThread :" + e2); } } diff --git a/src/jaceP2P/UpdateRegisterThread.java b/src/jaceP2P/UpdateRegisterThread.java index cb3996e..7b71d58 100644 --- a/src/jaceP2P/UpdateRegisterThread.java +++ b/src/jaceP2P/UpdateRegisterThread.java @@ -107,7 +107,7 @@ class UpdateRegisterThread extends Thread { } } catch (Exception e) { - System.out.println(name + " (" + System.err.println(name + " (" + LocalHost.Instance().resolve(name) + " rank=" + index + ") cannot be reached by UpdateRegisterThread " + " size : " + Register.Instance().getSize() + " :"