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


Java LRULinkedHashMap类代码示例

本文整理汇总了Java中org.openflow.util.LRULinkedHashMap的典型用法代码示例。如果您正苦于以下问题:Java LRULinkedHashMap类的具体用法?Java LRULinkedHashMap怎么用?Java LRULinkedHashMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LRULinkedHashMap类属于org.openflow.util包,在下文中一共展示了LRULinkedHashMap类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addToPortMap

import org.openflow.util.LRULinkedHashMap; //导入依赖的package包/类
/**
 * Adds a host to the MAC/VLAN->SwitchPort mapping
 * @param sw The switch to add the mapping to
 * @param mac The MAC address of the host to add
 * @param vlan The VLAN that the host is on
 * @param portVal The switchport that the host is on
 */
protected void addToPortMap(IOFSwitch sw, long mac, short vlan, short portVal) {
    Map<MacVlanPair,Short> swMap = macVlanToSwitchPortMap.get(sw);

    if (vlan == (short) 0xffff) {
        // OFMatch.loadFromPacket sets VLAN ID to 0xffff if the packet contains no VLAN tag;
        // for our purposes that is equivalent to the default VLAN ID 0
        vlan = 0;
    }

    if (swMap == null) {
        // May be accessed by REST API so we need to make it thread safe
        swMap = Collections.synchronizedMap(new LRULinkedHashMap<MacVlanPair,Short>(MAX_MACS_PER_SWITCH));
        macVlanToSwitchPortMap.put(sw, swMap);
    }
    swMap.put(new MacVlanPair(mac, vlan), portVal);
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:24,代码来源:LearningSwitch.java

示例2: addToPortMap

import org.openflow.util.LRULinkedHashMap; //导入依赖的package包/类
/**
 * Adds a host to the MAC/VLAN->SwitchPort mapping
 * @param sw The switch to add the mapping to
 * @param mac The MAC address of the host to add
 * @param vlan The VLAN that the host is on
 * @param portVal The switchport that the host is on
 */
protected void addToPortMap(IOFSwitch sw, long mac, short vlan, short portVal) {
    Map<MacVlanPair,Short> swMap = macVlanToSwitchPortMap.get(sw);
    
    if (vlan == (short) 0xffff) {
        // OFMatch.loadFromPacket sets VLAN ID to 0xffff if the packet contains no VLAN tag;
        // for our purposes that is equivalent to the default VLAN ID 0
        vlan = 0;
    }
    
    if (swMap == null) {
        // May be accessed by REST API so we need to make it thread safe
        swMap = Collections.synchronizedMap(new LRULinkedHashMap<MacVlanPair,Short>(MAX_MACS_PER_SWITCH));
        macVlanToSwitchPortMap.put(sw, swMap);
    }
    swMap.put(new MacVlanPair(mac, vlan), portVal);
}
 
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:LearningSwitch.java

示例3: OVXSwitch

import org.openflow.util.LRULinkedHashMap; //导入依赖的package包/类
/**
 * Instantiates a new OVX switch.
 *
 * @param switchId the switch id
 * @param tenantId the tenant id
 */
protected OVXSwitch(final Long switchId, final Integer tenantId) {
    super(switchId);
    this.tenantId = tenantId;
    this.missSendLen = 0;
    this.isActive = false;
    this.capabilities = new OVXSwitchCapabilities();
    this.backOffCounter = new AtomicInteger();
    this.resetBackOff();
    this.bufferMap = new LRULinkedHashMap<Integer, OVXPacketIn>(
            OVXSwitch.bufferDimension);
    this.portCounter = new BitSetIndex(IndexType.PORT_ID);
    this.bufferId = new AtomicInteger(1);
    this.flowTable = new OVXFlowTable(this);
    this.roleMan = new RoleManager();
    this.channelMux = new XidTranslator<Channel>();

}
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:24,代码来源:OVXSwitch.java

示例4: XidTranslator

import org.openflow.util.LRULinkedHashMap; //导入依赖的package包/类
public XidTranslator() {
    this.nextID = XidTranslator.MIN_XID;
    this.xidMap = new LRULinkedHashMap<Integer, XidPair<T>>(
            XidTranslator.INIT_SIZE, XidTranslator.MAX_SIZE);
}
 
开发者ID:CoVisor,项目名称:CoVisor,代码行数:6,代码来源:XidTranslator.java


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