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