package jaceP2P;
-import java.util.Vector;
+import java.util.ArrayList;
+//import java.util.Vector;
class UpdateRegisterConcernedThread extends Thread {
Register reg = null;
int requete;
int i, rank;
Task tache = null;
- @SuppressWarnings("unchecked")
- Vector neighbors;
+ ArrayList<Integer> neighbors;
int nbOfDeamonsPerThread;
Node oldNode, node;
- @SuppressWarnings("unchecked")
- public UpdateRegisterConcernedThread(Vector neighbors, Register r, int i,
+
+ public UpdateRegisterConcernedThread(ArrayList<Integer> neighbors, Register r, int i,
int rank, Node noeud, Node tmpNode) {
this.reg = r;
// while( retry )
// {
try {
- if (((Integer) neighbors.elementAt(index)).intValue() == rank) {
+ if (((Integer) neighbors.get(index)).intValue() == rank) {
Register g = new Register();
ListeTask newListOfTasks = new ListeTask();
g.setAppliName(reg.getAppliName());
for (int j = 0; j < neighbors.size(); j++) {
TaskId id = listOfTasks
.getTaskIdOfRank(((Integer) neighbors
- .elementAt(j)).intValue()) ;
+ .get(j)).intValue()) ;
newListOfTasks.addTask( id ) ;
if( id.getHostStub() != null ) {
Node noeud = reg.getNodeOfStub( id.getHostStub() ) ;
TaskId neighborTask = listOfTasks
.getTaskIdOfRank((((Integer) neighbors
- .elementAt(index)).intValue() + 1)
+ .get(index)).intValue() + 1)
% listOfTasks.getSize());
JaceInterface stubVoisin = neighborTask.getHostStub();
JaceInterface stub = listOfTasks.getTaskIdOfRank(
- ((Integer) neighbors.elementAt(index)).intValue())
+ ((Integer) neighbors.get(index)).intValue())
.getHostStub();
if( stub == null || stubVoisin == null )
{
System.out.println("stub NULL");
} else {
name = listOfTasks.getTaskIdOfRank(
- ((Integer) neighbors.elementAt(index))
+ ((Integer) neighbors.get(index))
.intValue()).getHostName();
Node noeud = null ;
//int tag;
TaskId id = listOfTasks
.getTaskIdOfRank(((Integer) neighbors
- .elementAt(index)).intValue());
+ .get(index)).intValue());
name = id.getHostName();
try {
}
@SuppressWarnings("unused")
- private Vector<Integer> getDependencies(int id, int jaceSize) {
+ private ArrayList<Integer> getDependencies(int id, int jaceSize) {
// get computing dependencies
- Vector<Integer> neighbors = new Vector<Integer>();
+ ArrayList<Integer> neighbors = new ArrayList<Integer>();
int[] dep = tache.getDependencies(id);
for (int z = 0; z < taille(dep); z++)
neighbors.add(dep[z]);
neighbors.add(rankOfBackTask);
}
// adds itself
- neighbors.add(id);
- return neighbors;
-
+ neighbors.add( id ) ;
+
+ return neighbors ;
}
public static int taille(int[] vect) {