本文整理汇总了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);
}
示例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>();
}
示例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);
}