当前位置: 首页>>代码示例>>Java>>正文


Java HARole.EQUAL属性代码示例

本文整理汇总了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);		
}
 
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:12,代码来源:LinkDiscoveryManager.java

示例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);
}
 
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:8,代码来源:TopologyManager.java

示例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);
		}
	}
 
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:10,代码来源:TopologyManager.java

示例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));

}
 
开发者ID:hksoni,项目名称:SDN-Multicast,代码行数:52,代码来源:RoleManager.java


注:本文中的net.floodlightcontroller.core.HARole.EQUAL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。