- Now we do not block the SuperNode itself when it uses functions
modifying gnodes.
- Correction of some function declarations in order to launch "rmic"
correctly.
PACKAGE=jaceP2P
BIN=bin
JAR=JaceP2P.jar
PACKAGE=jaceP2P
BIN=bin
JAR=JaceP2P.jar
+MAPPING=/home/miquee/lib/Mapping.jar
+CLASSPATH=.:$(MAPPING)
all: compile jar
compile:clean
javac -d ./$(BIN) ./$(SRC)/$(PACKAGE)/*.java
all: compile jar
compile:clean
javac -d ./$(BIN) ./$(SRC)/$(PACKAGE)/*.java
- rmic -d ./$(BIN) jaceP2P.JaceServer
- rmic -d ./$(BIN) jaceP2P.JaceSuperNodeServer
+ rmic -classpath $(CLASSPATH):$(BIN) -d ./$(BIN) jaceP2P.JaceServer
+ rmic -classpath $(CLASSPATH):$(BIN) -d ./$(BIN) jaceP2P.JaceSuperNodeServer
- rmic -d ./$(BIN) jaceP2P.JaceServer
- rmic -d ./$(BIN) jaceP2P.JaceSuperNodeServer
+ rmic -classpath $(CLASSPATH):$(BIN) -d ./$(BIN) jaceP2P.JaceServer
+ rmic -classpath $(CLASSPATH):$(BIN) -d ./$(BIN) jaceP2P.JaceSuperNodeServer
jar:
jar cvfm ./$(JAR) Manifest -C ./$(BIN) $(PACKAGE)
jar:
jar cvfm ./$(JAR) Manifest -C ./$(BIN) $(PACKAGE)
centralServer = (JaceSuperNodeInterface) Naming.lookup("rmi://"
+ superNode_IP + ":" + superNode_port
+ "/JaceSuperNode");
centralServer = (JaceSuperNodeInterface) Naming.lookup("rmi://"
+ superNode_IP + ":" + superNode_port
+ "/JaceSuperNode");
- System.out.println("succesfully located " + superNode_IP);
+ System.out.println("Succesfully located " + superNode_IP);
// add stub and IP in LocalHost to store it until super node
// death
// add stub and IP in LocalHost to store it until super node
// death
public void removeGNode( GNode _g ) throws RemoteException ;
public void removeGNode( GNode _g ) throws RemoteException ;
+ public boolean blockForMapping() throws RemoteException ;
+
public void setMapping( Algo al ) throws RemoteException ;
public void setMapping( Algo al ) throws RemoteException ;
-
- public boolean blockForMapping();
-
private ArrayList<GNode> gnodes = null;
private Algo al = null ;
private int count = 0 ;
private ArrayList<GNode> gnodes = null;
private Algo al = null ;
private int count = 0 ;
- private boolean inDemand = false, operating = false ;
+ private boolean inDemand = false, operating = false, authorized = false ;
// private boolean daemonListChange ;
// Constructors
// private boolean daemonListChange ;
// Constructors
/** Initialization of Grid architecture (G5K for now) **/
Grid grid = Utils.createGridG5k(gnodes);
grid.initClusters();
/** Initialization of Grid architecture (G5K for now) **/
Grid grid = Utils.createGridG5k(gnodes);
grid.initClusters();
/** Creation of tasks GTask **/
ArrayList<GTask> ts = new ArrayList<GTask>();
/** Creation of tasks GTask **/
ArrayList<GTask> ts = new ArrayList<GTask>();
Graph graph = new Graph();
Graph graph = new Graph();
/** Launching the Mapping **/
al.map();
/** Launching the Mapping **/
al.map();
/** Transforming mapping in register **/
Mapping mp = al.getMapping();
/** Transforming mapping in register **/
Mapping mp = al.getMapping();
/** Creating the register **/
ArrayList<GNode> ag = mp.getMappedGNodes();
/** Creating the register **/
ArrayList<GNode> ag = mp.getMappedGNodes();
for (int i = 0; i < ag.size(); i++) {
reg.addNode((Node) ag.get(i).getNode());
gnodes.remove(ag.get(i));
Register.Instance().removeNode((Node) ag.get(i).getNode());
}
for (int i = 0; i < ag.size(); i++) {
reg.addNode((Node) ag.get(i).getNode());
gnodes.remove(ag.get(i));
Register.Instance().removeNode((Node) ag.get(i).getNode());
}
if (ag.size() != 0) {
SuperNodeListe.Instance().forwardCountNode();
if (ag.size() != 0) {
SuperNodeListe.Instance().forwardCountNode();
GNode removedGNode = null ;
if( _n != null )
GNode removedGNode = null ;
if( _n != null )
- {
- workingOnGnodes() ;
+ {
+ boolean free = false ;
+
+ if( ! operating )
+ {
+ workingOnGnodes() ;
+ free = true ;
+ }
for( int i = 0 ; i < gnodes.size() ; i++ )
{
for( int i = 0 ; i < gnodes.size() ; i++ )
{
SuperNodeListe.Instance().removeGNode( removedGNode ) ;
SuperNodeListe.Instance().removeGNode( removedGNode ) ;
+ if( free )
+ {
+ operating = false ;
+ }
while( ! operating )
{
inDemand = true ;
while( ! operating )
{
inDemand = true ;
tmp = tmp && SuperNodeListe.Instance().workingOnGnodes() ;
tmp = tmp && SuperNodeListe.Instance().workingOnGnodes() ;
{
System.out.println( "Replacing node found." ) ;
node = (Node) remp.getNode() ;
{
System.out.println( "Replacing node found." ) ;
node = (Node) remp.getNode() ;
+
+ authorized = true ;
+
delGNodeFromList( node ) ;
delGNodeFromList( node ) ;
+
+ authorized = false ;
+
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Replacing node not found !!" ) ;
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Replacing node not found !!" ) ;
{
System.out.println( "Other new node found." ) ;
node = (Node) remp.getNode() ;
{
System.out.println( "Other new node found." ) ;
node = (Node) remp.getNode() ;
+
+ authorized = true ;
+
delGNodeFromList( node ) ;
delGNodeFromList( node ) ;
+
+ authorized = false ;
+
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Other new node not found !!" ) ;
SuperNodeListe.Instance().forwardCountNode();
} else {
System.err.println( "Other new node not found !!" ) ;
@Override
/**
* Allow or deny the use of operations on the gnodes list, in order to
@Override
/**
* Allow or deny the use of operations on the gnodes list, in order to
* @author miquee
* @return The authorization or not to block gnodes
*/
* @author miquee
* @return The authorization or not to block gnodes
*/
- public boolean blockForMapping()
+ public boolean blockForMapping() throws RemoteException
+ if( operating && ! authorized )
{
return false ;
} else {
{
return false ;
} else {