VOL-1537 : Create the Alarm Framework in golang openolt adapter
Event manager is added to process indications comming from the
OLT and publish them as generic events on to the KAFKA bus which
could be device alarms or KPIs.
It depends on the updated events.proto which contains the defination
for the generic event gRPC message and the event proxy from the VOLTHA
core.
So the changes in voltha-proto needs to be merged first followed by the
changes in voltha-go and then voltha-openolt-adapter.
Change-Id: Ie38b2ea01bd738737522c018e65e685ee41589d5
diff --git a/vendor/go.etcd.io/etcd/raft/tracker/progress.go b/vendor/go.etcd.io/etcd/raft/tracker/progress.go
index a7f1ab7..697277b 100644
--- a/vendor/go.etcd.io/etcd/raft/tracker/progress.go
+++ b/vendor/go.etcd.io/etcd/raft/tracker/progress.go
@@ -16,6 +16,7 @@
import (
"fmt"
+ "sort"
"strings"
)
@@ -235,3 +236,22 @@
}
return buf.String()
}
+
+// ProgressMap is a map of *Progress.
+type ProgressMap map[uint64]*Progress
+
+// String prints the ProgressMap in sorted key order, one Progress per line.
+func (m ProgressMap) String() string {
+ ids := make([]uint64, 0, len(m))
+ for k := range m {
+ ids = append(ids, k)
+ }
+ sort.Slice(ids, func(i, j int) bool {
+ return ids[i] < ids[j]
+ })
+ var buf strings.Builder
+ for _, id := range ids {
+ fmt.Fprintf(&buf, "%d: %s\n", id, m[id])
+ }
+ return buf.String()
+}