summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
6805ff1)
Change-Id: Icefcb9bc2566e3c2658b5db544fbdc5b1e32d4f6
Signed-off-by: wahidw <abdulwahid.w@nokia.com>
+### v0.5.6-2
+* RT records are sent in a group rather than individually. Group is configurabl
+
### v0.5.6-1
* Moving to ubuntu 18 and fixing UT's
### v0.5.6-1
* Moving to ubuntu 18 and fixing UT's
# By default this file is in the docker build directory,
# but the location can configured in the JJB template.
---
# By default this file is in the docker build directory,
# but the location can configured in the JJB template.
---
- gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.4.6
+ gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.4.7
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/errors v0.19.3
github.com/go-openapi/loads v0.19.4
github.com/ghodss/yaml v1.0.0
github.com/go-openapi/errors v0.19.3
github.com/go-openapi/loads v0.19.4
replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2
replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2
-replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6
+replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.7
replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.1
replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.1
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
"routing-manager/pkg/rtmgr"
"strconv"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
"routing-manager/pkg/rtmgr"
"strconv"
"fmt"
)
type NngPush struct {
Sbi
"fmt"
)
type NngPush struct {
Sbi
- rcChan chan *xapp.RMRParams
+ rcChan chan *xapp.RMRParams
}
type RMRParams struct {
}
type RMRParams struct {
func (params *RMRParams) String() string {
func (params *RMRParams) String() string {
- var b bytes.Buffer
- sum := md5.Sum(params.Payload)
- fmt.Fprintf(&b, "params(Src=%s Mtype=%d SubId=%d Xid=%s Meid=%s Paylens=%d/%d Payhash=%x)", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid.RanName, params.PayloadLen, len(params.Payload), sum)
- return b.String()
+ var b bytes.Buffer
+ sum := md5.Sum(params.Payload)
+ fmt.Fprintf(&b, "params(Src=%s Mtype=%d SubId=%d Xid=%s Meid=%s Paylens=%d/%d Payhash=%x)", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid.RanName, params.PayloadLen, len(params.Payload), sum)
+ return b.String()
}
func NewNngPush() *NngPush {
}
func NewNngPush() *NngPush {
xapp.Logger.Debug("Invoked sbi.AddEndpoint")
endpoint := ep.Ip + ":" + strconv.Itoa(DefaultNngPipelineSocketNumber)
ep.Whid = int(xapp.Rmr.Openwh(endpoint))
xapp.Logger.Debug("Invoked sbi.AddEndpoint")
endpoint := ep.Ip + ":" + strconv.Itoa(DefaultNngPipelineSocketNumber)
ep.Whid = int(xapp.Rmr.Openwh(endpoint))
return errors.New("can't open warmhole connection for endpoint:" + ep.Uuid + " due to invalid Wormhole ID: " + string(ep.Whid))
return errors.New("can't open warmhole connection for endpoint:" + ep.Uuid + " due to invalid Wormhole ID: " + string(ep.Whid))
- }else {
- xapp.Logger.Debug("Wormhole ID is %v and EP is %v",ep.Whid,endpoint)
+ } else {
+ xapp.Logger.Debug("Wormhole ID is %v and EP is %v", ep.Whid, endpoint)
func (c *NngPush) send(ep *rtmgr.Endpoint, policies *[]string) {
xapp.Logger.Debug("Push policy to endpoint: " + ep.Uuid)
func (c *NngPush) send(ep *rtmgr.Endpoint, policies *[]string) {
xapp.Logger.Debug("Push policy to endpoint: " + ep.Uuid)
+ var policy = []byte{}
+ cumulative_policy := 0
+ count := 0
+ maxrecord := xapp.Config.GetInt("maxrecord")
+ if maxrecord == 0 {
+ maxrecord = 10
+ }
+
for _, pe := range *policies {
for _, pe := range *policies {
- params := &RMRParams{&xapp.RMRParams{}}
- params.Mtype = 20
- params.PayloadLen = len([]byte(pe))
- params.Payload =[]byte(pe)
- params.Mbuf = nil
- params.Whid = ep.Whid
- time.Sleep(1 * time.Millisecond)
- xapp.Rmr.SendMsg(params.RMRParams)
+ b := []byte(pe)
+ for j := 0; j < len(b); j++ {
+ policy = append(policy, b[j])
+ }
+ count++
+ cumulative_policy++
+ if count == maxrecord || cumulative_policy == len(*policies) {
+ params := &RMRParams{&xapp.RMRParams{}}
+ params.Mtype = 20
+ params.PayloadLen = len(policy)
+ params.Payload = []byte(policy)
+ params.Mbuf = nil
+ params.Whid = ep.Whid
+ xapp.Rmr.SendMsg(params.RMRParams)
+ count = 0
+ policy = nil
+ xapp.Logger.Debug("Sent message with payload len = %d", params.PayloadLen)
+ }
xapp.Logger.Info("NNG PUSH to endpoint " + ep.Uuid + ": OK (# of Entries:" + strconv.Itoa(len(*policies)) + ")")
}
xapp.Logger.Info("NNG PUSH to endpoint " + ep.Uuid + ": OK (# of Entries:" + strconv.Itoa(len(*policies)) + ")")
}
-func (c *NngPush) CreateEndpoint(payload string) (*rtmgr.Endpoint){
+func (c *NngPush) CreateEndpoint(payload string) *rtmgr.Endpoint {
return c.createEndpoint(payload, c)
}
return c.createEndpoint(payload, c)
}