[VOL-1499] Use precreated topic
This commit migrate from dynamically created kafka topic to
pre-created topic. The changes are made in the rw_core, simulated
onu and olt adapters, and ponsim olt and onu adapters.
TODO: move the python shared library changes into the pyvoltha
repo.
Change-Id: Ia92287ec74009872e694aa22eb896d8a6487d231
diff --git a/kafka/utils.go b/kafka/utils.go
index beac9f9..0cb9535 100644
--- a/kafka/utils.go
+++ b/kafka/utils.go
@@ -15,10 +15,7 @@
*/
package kafka
-import (
- "fmt"
- "strings"
-)
+import "strings"
const (
TopicSeparator = "_"
@@ -39,19 +36,7 @@
Value interface{}
}
-//CreateSubTopic concatenate a list of arguments together using underscores.
-func CreateSubTopic(args ...string) Topic {
- topic := ""
- for index, arg := range args {
- if index == 0 {
- topic = arg
- } else {
- topic = fmt.Sprintf("%s%s%s", topic, TopicSeparator, arg)
- }
- }
- return Topic{Name: topic}
-}
-
+// TODO: Remove and provide better may to get the device id
// GetDeviceIdFromTopic extract the deviceId from the topic name. The topic name is formatted either as:
// <any string> or <any string>_<deviceId>. The device Id is 24 characters long.
func GetDeviceIdFromTopic(topic Topic) string {