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


Java OFStatisticsType.TABLE属性代码示例

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


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

示例1: checkForTableStats

@LogMessageDocs({
    @LogMessageDoc(level="INFO",
        message="Switch {switch} flow table is full",
        explanation="The switch flow table at least 98% full, " +
                "this requires attention if using reactive flow setup"),
    @LogMessageDoc(level="INFO",
        message="Switch {switch} flow table capacity back to normal",
        explanation="The switch flow table is less than 90% full")
})
private void checkForTableStats(OFStatisticsReply statReply) {
    if (statReply.getStatisticType() != OFStatisticsType.TABLE) {
        return;
    }
    List<? extends OFStatistics> stats = statReply.getStatistics();
    // Assume a single table only
    OFStatistics stat = stats.get(0);
    if (stat instanceof OFTableStatistics) {
        OFTableStatistics tableStat = (OFTableStatistics) stat;
        int activeCount = tableStat.getActiveCount();
        int maxEntry = tableStat.getMaximumEntries();
        log.debug("Switch {} active entries {} max entries {}",
                new Object[] { this.stringId, activeCount, maxEntry});
        int percentFull = activeCount * 100 / maxEntry;
        if (flowTableFull && percentFull < 90) {
            log.info("Switch {} flow table capacity is back to normal",
                    toString());
            floodlightProvider.addSwitchEvent(this.datapathId,
                    "SWITCH_FLOW_TABLE_NORMAL < 90% full", false);
        } else if (percentFull >= 98) {
            log.info("Switch {} flow table is almost full", toString());
            floodlightProvider.addSwitchEvent(this.datapathId,
                    "SWITCH_FLOW_TABLE_ALMOST_FULL >= 98% full", false);
        }
    }
}
 
开发者ID:JianqingJiang,项目名称:QoS-floodlight,代码行数:35,代码来源:OFSwitchBase.java


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