func (l *Linearizer) ProcessRecord(t *Record) error {
	err := l.store.Insert(l.compID, "i", t)
	if err != nil {
		return err
	}
	err = l.lwmTracker.ProcessRecord(t)
	if err != nil {
		return err
	}
	upstreamLWM := l.lwmTracker.GetUpstreamLWM()
	l.lwmCh <- upstreamLWM
	l.tmpT <- t
	return nil
}
ProcessRecord inserts the record into the buffer sorted by timestamps
package dagger
import (
	log "github.com/Sirupsen/logrus"
)
type Linearizer struct {
	compID     StreamID
	store      StreamBuffer
	lwmTracker LWMTracker
	LWM        Timestamp
	lwmCh      chan Timestamp
	startAtLWM Timestamp
	ltp        LinearizedRecordProcessor
	stopCh     chan struct{}
	tmpT       chan *Record
}
func NewLinearizer(compID StreamID, store StreamBuffer, lwmTracker LWMTracker) *Linearizer {
	return &Linearizer{
		compID:     compID,
		store:      store,
		lwmTracker: lwmTracker,
		lwmCh:      make(chan Timestamp),
		tmpT:       make(chan *Record),
		stopCh:     make(chan struct{}),
	}
}
func (l *Linearizer) SetProcessor(ltp LinearizedRecordProcessor) {
	l.ltp = ltp
}
func (l *Linearizer) SetStartLWM(time Timestamp) {
	l.startAtLWM = time
}