wilfred-s commented on code in PR #533:
URL: https://github.com/apache/yunikorn-core/pull/533#discussion_r1464323732


##########
pkg/events/event_system.go:
##########
@@ -191,11 +245,21 @@ func (ec *EventSystemImpl) isRestartNeeded() bool {
        return ec.readIsTrackingEnabled() != ec.trackingEnabled
 }
 
+// Restart restarts the event system, used during config update.
 func (ec *EventSystemImpl) Restart() {
        ec.Stop()
        ec.StartServiceWithPublisher(true)
 }
 
+// VisibleForTesting

Review Comment:
   fix comment to use standard go layout as it is an.exported function now.



##########
pkg/events/event_system.go:
##########
@@ -94,21 +141,25 @@ func (ec *EventSystemImpl) GetRingBufferCapacity() uint64 {
 // VisibleForTesting
 func Init() {
        store := newEventStore()
+       buffer := newEventRingBuffer(defaultRingBufferSize)
        ev = &EventSystemImpl{
                Store:         store,
                channel:       make(chan *si.EventRecord, 
defaultEventChannelSize),
                stop:          make(chan bool),
                stopped:       false,
                publisher:     CreateShimPublisher(store),
-               eventBuffer:   newEventRingBuffer(defaultRingBufferSize),
+               eventBuffer:   buffer,
                eventSystemId: fmt.Sprintf("event-system-%d", 
time.Now().Unix()),
+               streaming:     NewEventStreaming(buffer),
        }
 }
 
+// StartService starts the event processing in the background. See the 
interface for details.
 func (ec *EventSystemImpl) StartService() {
        ec.StartServiceWithPublisher(true)
 }
 
+// VisibleForTesting

Review Comment:
   fix comment to use standard go layout as it is an.exported function now.



##########
pkg/events/event_ringbuffer.go:
##########
@@ -70,14 +70,38 @@ func (e *eventRingBuffer) Add(event *si.EventRecord) {
        e.id++
 }
 
-// GetEventsFromID returns "count" number of event records from "id" if 
possible. The id can be determined from
+func (e *eventRingBuffer) GetRecentEvents(count uint64) []*si.EventRecord {

Review Comment:
   add comment use standard go layout as it is an.exported function



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to