Exposed maximumEntries for TableStatistics to sal 74/3474/2
authorKatelyn Kasperowicz <kkaspero@cisco.com>
Thu, 5 Dec 2013 01:20:47 +0000 (17:20 -0800)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 5 Dec 2013 19:30:22 +0000 (19:30 +0000)
Change-Id: Ib5fd0362e898f4bcaeda97416c1f048826e3e440
Signed-off-by: Katelyn Kasperowicz <kkaspero@cisco.com>
opendaylight/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/StatisticsNorthbound.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/TableStatisticsConverter.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/reader/NodeTableStatistics.java
opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/reader/NodeTableStatisticsTest.java

index 05cb500273c2bca5c2012b251ebea9db02344ebe..5338849a62626ed740c6d930d72064efa1dca4d2 100644 (file)
@@ -844,7 +844,8 @@ public class StatisticsNorthbound {
      *                     },
      *                     "activeCount": "11",
      *                     "lookupCount": "816",
-     *                     "matchedCount": "220"
+     *                     "matchedCount": "220",
+     *                     "maximumEntries": "1000"
      *                 },
      *                 {
      *                     ...another table
@@ -876,6 +877,7 @@ public class StatisticsNorthbound {
      *          &lt;activeCount&gt;12&lt;/activeCount&gt;
      *          &lt;lookupCount&gt;10935&lt;/lookupCount&gt;
      *          &lt;matchedCount&gt;10084&lt;/matchedCount&gt;
+     *          &lt;maximumEntries&gt;1000&lt;/maximumEntries&gt;
      *      &lt;/tableStatistic&gt;
      *      &lt;tableStatistic&gt;
      *          &lt;nodeTable&gt;
@@ -888,6 +890,7 @@ public class StatisticsNorthbound {
      *          &lt;activeCount&gt;0&lt;/activeCount&gt;
      *          &lt;lookupCount&gt;0&lt;/lookupCount&gt;
      *          &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *          &lt;maximumEntries&gt;0&lt;/maximumEntries&gt;
      *      &lt;/tableStatistic&gt;
      *      &lt;tableStatistic&gt;
      *          &lt;nodeTable&gt;
@@ -900,6 +903,7 @@ public class StatisticsNorthbound {
      *          &lt;activeCount&gt;0&lt;/activeCount&gt;
      *          &lt;lookupCount&gt;0&lt;/lookupCount&gt;
      *          &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *          &lt;maximumEntries&gt;0&lt;/maximumEntries&gt;
      *      &lt;/tableStatistic&gt;
      *  &lt;/tableStatistics&gt;
      *  &lt;tableStatistics&gt;
@@ -987,7 +991,8 @@ public class StatisticsNorthbound {
      *             },
      *             "activeCount": "12",
      *             "lookupCount": "11382",
-     *             "matchedCount": "10524"
+     *             "matchedCount": "10524",
+     *             "maximumEntries": "1000"
      *         },
      *         {
      *             "nodeTable": {
@@ -999,7 +1004,8 @@ public class StatisticsNorthbound {
      *             },
      *             "activeCount": "0",
      *             "lookupCount": "0",
-     *             "matchedCount": "0"
+     *             "matchedCount": "0",
+     *             "maximumEntries": "0"
      *         }
      *    ]
      * }
@@ -1022,6 +1028,7 @@ public class StatisticsNorthbound {
      *         &lt;activeCount&gt;12&lt;/activeCount&gt;
      *         &lt;lookupCount&gt;10935&lt;/lookupCount&gt;
      *         &lt;matchedCount&gt;10084&lt;/matchedCount&gt;
+     *         &lt;maximumEntries&gt;1000&lt;/maximumEntries&gt;
      *     &lt;/tableStatistic&gt;
      *     &lt;tableStatistic&gt;
      *         &lt;nodeTable&gt;
@@ -1034,6 +1041,7 @@ public class StatisticsNorthbound {
      *         &lt;activeCount&gt;0&lt;/activeCount&gt;
      *         &lt;lookupCount&gt;0&lt;/lookupCount&gt;
      *         &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *         &lt;maximumEntries&gt;0&lt;/maximumEntries&gt;
      *     &lt;/tableStatistic&gt;
      *     &lt;tableStatistic&gt;
      *         &lt;nodeTable&gt;
@@ -1046,6 +1054,7 @@ public class StatisticsNorthbound {
      *         &lt;activeCount&gt;0&lt;/activeCount&gt;
      *         &lt;lookupCount&gt;0&lt;/lookupCount&gt;
      *         &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *         &lt;maximumEntries&gt;0&lt;/maximumEntries&gt;
      *     &lt;/tableStatistic&gt;
      * &lt;/nodeTableStatistics&gt;
      *
index bcc2445808a677573892b299b16a3a2d6a5beed8..35a763869b20f2e73c2c773d748930970212820c 100644 (file)
@@ -54,6 +54,7 @@ public class TableStatisticsConverter {
                 ntStat.setActiveCount(ofTableStat.getActiveCount());
                 ntStat.setLookupCount(ofTableStat.getLookupCount());
                 ntStat.setMatchedCount(ofTableStat.getMatchedCount());
+                ntStat.setMaximumEntries(ofTableStat.getMaximumEntries());
                 this.ntStatsList.add(ntStat);
             }
         }
index 7c404178cfc195edd206500c90ba4155c7e02f73..eb33ad67995f2621fd95024c0736e897fb6f18ee 100644 (file)
@@ -37,6 +37,8 @@ public class NodeTableStatistics implements Serializable {
     private long lookupCount;
     @XmlElement
     private long matchedCount;
+    @XmlElement
+    private int maximumEntries;
 
 
     @Override
@@ -164,6 +166,20 @@ public class NodeTableStatistics implements Serializable {
         this.matchedCount = matchedCount;
     }
 
+    /**
+     * @return the maximumEntries
+     */
+    public long getMaximumEntries() {
+        return maximumEntries;
+    }
+
+    /**
+     * @param maximumEntries the maximumEntries to set
+     */
+    public void setMaximumEntries(int maximumEntries) {
+        this.maximumEntries = maximumEntries;
+    }
+
     @Override
     public String toString() {
         return "NodeTableStats[tableId = " + nodeTable
index c0d6bb698a7b0cf9112bcfa51b8e95ce2e20cf5b..a29d4268dab2c02f55006ff948a1735ee65125ea 100644 (file)
@@ -24,12 +24,14 @@ public class NodeTableStatisticsTest {
         ntStats.setActiveCount(100);
         ntStats.setLookupCount(200);
         ntStats.setMatchedCount(500);
+        ntStats.setMaximumEntries(1000);
         ntStats.setName("Test");
 
         Assert.assertTrue(ntStats.getNodeTable().equals(nt));
         Assert.assertTrue(ntStats.getActiveCount() == 100);
         Assert.assertTrue(ntStats.getLookupCount() == 200);
         Assert.assertTrue(ntStats.getMatchedCount() == 500);
+        Assert.assertTrue(ntStats.getMaximumEntries() == 1000);
         Assert.assertTrue(ntStats.getName().equals("Test"));
     }
 }