本文整理汇总了Java中net.floodlightcontroller.core.HARole.EQUAL属性的典型用法代码示例。如果您正苦于以下问题:Java HARole.EQUAL属性的具体用法?Java HARole.EQUAL怎么用?Java HARole.EQUAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.floodlightcontroller.core.HARole
的用法示例。
在下文中一共展示了HARole.EQUAL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transitionToEQUAL
@Override
public void transitionToEQUAL() {
if (log.isTraceEnabled()) {
log.trace("Sending LLDPs "
+ "to HA change from STANDBY or MASTER --> EQUAL");
}
LinkDiscoveryManager.this.role = HARole.EQUAL;
clearAllLinks();
//readTopologyConfigFromStorage();
log.debug("Role Change to EQUAL: Rescheduling discovery task.");
discoveryTask.reschedule(1, TimeUnit.MICROSECONDS);
}
示例2: transitionToEQUAL
@Override
public void transitionToEQUAL() {
role = HARole.EQUAL;
log.debug("Re-computing topology due " +
"to role change from STANDBY->EQUAL");
newInstanceTask.reschedule(TOPOLOGY_COMPUTE_INTERVAL_MS,
TimeUnit.MILLISECONDS);
}
示例3: informListeners
public void informListeners(List<LDUpdate> linkUpdates) {
if (role != null && role != HARole.ACTIVE && role != HARole.EQUAL)
return;
for(int i=0; i < topologyAware.size(); ++i) {
ITopologyListener listener = topologyAware.get(i);
listener.topologyChanged(linkUpdates);
}
}
示例4: setRole
/**
* Set the controller's new role and notify switches.
*
* This method updates the controllers current role and notifies all
* connected switches of the new role is different from the current
* role. We dampen calls to this method. See class description for
* details.
*
* @param role The new role.
* @param roleChangeDescription A textual description of why the role
* was changed. For information purposes only.
* @throws NullPointerException if role or roleChangeDescription is null
*/
public synchronized void setRole(@Nonnull HARole role, @Nonnull String roleChangeDescription) {
Preconditions.checkNotNull(role, "role must not be null");
Preconditions.checkNotNull(roleChangeDescription, "roleChangeDescription must not be null");
if (role == getRole()) {
counters.setSameRole.increment();
log.debug("Received role request for {} but controller is "
+ "already {}. Ignoring it.", role, this.getRole());
return;
}
if (this.getRole() == HARole.STANDBY && role == HARole.ACTIVE) {
// At this point we are guaranteed that we will execute the code
// below exactly once during the lifetime of this process! And
// it will be a to MASTER transition
counters.setRoleMaster.increment();
}
if (role == HARole.EQUAL) {
if (this.getRole() == HARole.ACTIVE) {
counters.setRoleEQUAL.increment();
} else { // previous role was STANDBY
//TODO: handle standby to EQUAL
log.debug("Received role request for {} but controller is "
+ "in {}. returning as of now.", role, this.getRole());
return;
}
}
log.info("Received role request for {} (reason: {})."
+ " Initiating transition", role, roleChangeDescription);
currentRoleInfo =
new RoleInfo(role, roleChangeDescription, new Date());
controller.addUpdateToQueue(new HARoleUpdate(role));
controller.addUpdateToQueue(new SwitchRoleUpdate(role));
}