Skip to content
Snippets Groups Projects
Commit ac39a00f authored by Tulio Ribeiro's avatar Tulio Ribeiro
Browse files

The basic idea is, every HEARTBEAT time, ask to RPCService which nodes still on

and compare with initial cluster config defined in floodlightdefault.properties.

Issues: Do not treat the message ROLE_STATUS.
In case a cluster goes down and goes up, there is a problem, the Controller does not change its own role to role slave.

But works properly as Primary-Backup configuration.

Under development...
parent 3961a087
No related branches found
No related tags found
No related merge requests found
package net.floodlightcontroller.simpleft;
import java.util.concurrent.TimeUnit;
import net.floodlightcontroller.core.IOFSwitch;
import org.projectfloodlight.openflow.protocol.OFControllerRole;
import org.projectfloodlight.openflow.protocol.OFRoleReply;
import org.projectfloodlight.openflow.types.U64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.util.concurrent.ListenableFuture;
public class UtilDurable {
private static Logger logger;
public UtilDurable(){
logger = LoggerFactory.getLogger(UtilDurable.class);
}
public OFRoleReply setSwitchRole(IOFSwitch sw, OFControllerRole role) {
try {
ListenableFuture<OFRoleReply> future = sw.writeRequest(sw.getOFFactory().buildRoleRequest()
.setGenerationId(U64.ZERO)
.setRole(role)
.build());
return future.get(10, TimeUnit.SECONDS);
} catch (Exception e) {
logger.error("Failure setting switch {} role to {}.", sw.toString(), role.toString());
logger.error(e.getMessage());
}
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment