synchronizer

package
v2.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Ready represents ready
	Ready = iota
	// StreamingReady ready
	StreamingReady
	// Error represents some error in SSE streaming
	Error
)
View Source
const (
	// Idle flags
	Idle = iota
	// Streaming flags
	Streaming
	// Polling flags
	Polling
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Local

type Local struct {
	// contains filtered or unexported fields
}

Local implements Local Synchronizer

func (*Local) StartPeriodicDataRecording

func (s *Local) StartPeriodicDataRecording()

StartPeriodicDataRecording starts periodic recorders tasks

func (*Local) StartPeriodicFetching

func (s *Local) StartPeriodicFetching()

StartPeriodicFetching starts periodic fetchers tasks

func (*Local) StopPeriodicDataRecording

func (s *Local) StopPeriodicDataRecording()

StopPeriodicDataRecording stops periodic recorders tasks

func (*Local) StopPeriodicFetching

func (s *Local) StopPeriodicFetching()

StopPeriodicFetching stops periodic fetchers tasks

func (*Local) SyncAll

func (s *Local) SyncAll() error

SyncAll syncs splits and segments

func (*Local) SynchronizeSegment

func (s *Local) SynchronizeSegment(name string, till *int64) error

SynchronizeSegment syncs segment

func (*Local) SynchronizeSplits

func (s *Local) SynchronizeSplits(till *int64) error

SynchronizeSplits syncs splits

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager struct

func NewSynchronizerManager

func NewSynchronizerManager(
	synchronizer Synchronizer,
	logger logging.LoggerInterface,
	config conf.AdvancedConfig,
	authClient service.AuthClient,
	splitStorage storage.SplitStorage,
	managerStatus chan int,
) (*Manager, error)

NewSynchronizerManager creates new sync manager

func (*Manager) IsRunning

func (s *Manager) IsRunning() bool

IsRunning returns true if is in Streaming or Polling

func (*Manager) Start

func (s *Manager) Start()

Start starts synchronization through Split

func (*Manager) Stop

func (s *Manager) Stop()

Stop stop synchronizaation through Split

type SplitTasks

type SplitTasks struct {
	SplitSyncTask            *asynctask.AsyncTask
	SegmentSyncTask          *asynctask.AsyncTask
	TelemetrySyncTask        *asynctask.AsyncTask
	ImpressionSyncTask       tasks.Task
	EventSyncTask            tasks.Task
	ImpressionsCountSyncTask *asynctask.AsyncTask
}

SplitTasks struct for tasks

type Synchronizer

type Synchronizer interface {
	SyncAll() error
	SynchronizeSplits(till *int64) error
	SynchronizeSegment(segmentName string, till *int64) error
	StartPeriodicFetching()
	StopPeriodicFetching()
	StartPeriodicDataRecording()
	StopPeriodicDataRecording()
}

Synchronizer interface for syncing data to and from splits servers

func NewLocal

func NewLocal(
	period int,
	splitAPI *service.SplitAPI,
	splitStorage storage.SplitStorage,
	logger logging.LoggerInterface,
) Synchronizer

NewLocal creates new Local

func NewSynchronizer

func NewSynchronizer(
	confAdvanced conf.AdvancedConfig,
	splitTasks SplitTasks,
	workers Workers,
	logger logging.LoggerInterface,
	inMememoryFullQueue chan string,
) Synchronizer

NewSynchronizer creates new SynchronizerImpl

type SynchronizerImpl

type SynchronizerImpl struct {
	// contains filtered or unexported fields
}

SynchronizerImpl implements Synchronizer

func (*SynchronizerImpl) StartPeriodicDataRecording

func (s *SynchronizerImpl) StartPeriodicDataRecording()

StartPeriodicDataRecording starts periodic recorders tasks

func (*SynchronizerImpl) StartPeriodicFetching

func (s *SynchronizerImpl) StartPeriodicFetching()

StartPeriodicFetching starts periodic fetchers tasks

func (*SynchronizerImpl) StopPeriodicDataRecording

func (s *SynchronizerImpl) StopPeriodicDataRecording()

StopPeriodicDataRecording stops periodic recorders tasks

func (*SynchronizerImpl) StopPeriodicFetching

func (s *SynchronizerImpl) StopPeriodicFetching()

StopPeriodicFetching stops periodic fetchers tasks

func (*SynchronizerImpl) SyncAll

func (s *SynchronizerImpl) SyncAll() error

SyncAll syncs splits and segments

func (*SynchronizerImpl) SynchronizeSegment

func (s *SynchronizerImpl) SynchronizeSegment(name string, till *int64) error

SynchronizeSegment syncs segment

func (*SynchronizerImpl) SynchronizeSplits

func (s *SynchronizerImpl) SynchronizeSplits(till *int64) error

SynchronizeSplits syncs splits

type Workers

type Workers struct {
	SplitFetcher             split.SplitFetcher
	SegmentFetcher           segment.SegmentFetcher
	TelemetryRecorder        metric.MetricRecorder
	ImpressionRecorder       impression.ImpressionRecorder
	EventRecorder            event.EventRecorder
	ImpressionsCountRecorder impressionscount.ImpressionsCountRecorder
}

Workers struct for workers

Directories

Path Synopsis
worker

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL