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


Java TypedStoredFlowEntry.bytes方法代码示例

本文整理汇总了Java中org.onosproject.net.flow.TypedStoredFlowEntry.bytes方法的典型用法代码示例。如果您正苦于以下问题:Java TypedStoredFlowEntry.bytes方法的具体用法?Java TypedStoredFlowEntry.bytes怎么用?Java TypedStoredFlowEntry.bytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.net.flow.TypedStoredFlowEntry的用法示例。


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

示例1: typedFlowEntryLoadByInstInternal

import org.onosproject.net.flow.TypedStoredFlowEntry; //导入方法依赖的package包/类
private List<TypedFlowEntryWithLoad> typedFlowEntryLoadByInstInternal(ConnectPoint cp,
                                                                  Map<FlowRule, TypedStoredFlowEntry> currentMap,
                                                                  Map<FlowRule, TypedStoredFlowEntry> previousMap,
                                                                  boolean isAllInstType,
                                                                  Instruction.Type instType,
                                                                  int liveTypePollInterval) {
    List<TypedFlowEntryWithLoad> fel = new ArrayList<>();

    for (TypedStoredFlowEntry tfe : currentMap.values()) {
        if (isAllInstType ||
                tfe.treatment().allInstructions().stream().
                        filter(i -> i.type() == instType).
                        findAny().isPresent()) {
            long currentBytes = tfe.bytes();
            long previousBytes = previousMap.getOrDefault(tfe, new DefaultTypedFlowEntry((FlowRule) tfe)).bytes();
            Load fLoad = new DefaultLoad(currentBytes, previousBytes, liveTypePollInterval);
            fel.add(new TypedFlowEntryWithLoad(cp, tfe, fLoad));
        }
    }

    return fel;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:FlowStatisticManager.java

示例2: addOrUpdateFlows

import org.onosproject.net.flow.TypedStoredFlowEntry; //导入方法依赖的package包/类
/**
 * Adds or updates typed flow entry from flow entry into the internal flow table.
 *
 * @param flowEntries the flow entries
 */
public synchronized void addOrUpdateFlows(FlowEntry... flowEntries) {
    for (FlowEntry fe : flowEntries) {
        // check if this new rule is an update to an existing entry
        TypedStoredFlowEntry stored = deviceFlowTable.getFlowEntry(fe);

        if (stored != null) {
            // duplicated flow entry is collected!, just skip
            if (fe.bytes() == stored.bytes() && fe.packets() == stored.packets()
                    && fe.life() == stored.life()) {
                if (log.isTraceEnabled()) {
                    log.trace("addOrUpdateFlows({}): flowId={},is DUPLICATED stats collection, just skip.",
                            sw.getStringId(), fe.id());
                }

                //FIXME modification of "stored" flow entry outside of store
                stored.setLastSeen();
                continue;
            } else if (fe.life() < stored.life()) {
                // Invalid updates the stats values, i.e., bytes, packets, durations ...
                if (log.isDebugEnabled()) {
                    log.debug(ADD_INVALID_LOG, fe.id(), stored.id(), fe.bytes(),
                            stored.bytes(), fe.life(), stored.life(),
                            fe.lastSeen(), stored.lastSeen());
                }
                // go next
                //FIXME modification of "stored" flow entry outside of store
                stored.setLastSeen();
                continue;
            }

            // update now
            //FIXME modification of "stored" flow entry outside of store
            stored.setLife(fe.life());
            stored.setPackets(fe.packets());
            stored.setBytes(fe.bytes());
            stored.setLastSeen();
            if (stored.state() == FlowEntry.FlowEntryState.PENDING_ADD) {
                // flow is really RULE_ADDED
                stored.setState(FlowEntry.FlowEntryState.ADDED);
            }
            // flow is RULE_UPDATED, skip adding and just updating flow live table
            //deviceFlowTable.calAndSetFlowLiveType(stored);
            continue;
        }

        // add new flow entry, we suppose IMMEDIATE_FLOW
        TypedStoredFlowEntry newFlowEntry = new DefaultTypedFlowEntry(fe,
                FlowLiveType.IMMEDIATE_FLOW);
        deviceFlowTable.addWithCalAndSetFlowLiveType(newFlowEntry);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:57,代码来源:NewAdaptiveFlowStatsCollector.java

示例3: TypedFlowEntryWithLoad

import org.onosproject.net.flow.TypedStoredFlowEntry; //导入方法依赖的package包/类
/**
 * Creates a new typed flow entry with load.
 *
 * @param cp connect point
 * @param tfe typed flow entry
 */
public TypedFlowEntryWithLoad(ConnectPoint cp, TypedStoredFlowEntry tfe) {
    this.cp = cp;
    this.tfe = tfe;
    this.load = new DefaultLoad(tfe.bytes(), 0, typedPollInterval(tfe));
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:TypedFlowEntryWithLoad.java


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