// Triggers a mock filesystem event.
198760
func (w *fakeWatcher) TriggerEvent(op fsnotify.Op, filename string) {
	w.eventHandler(fsnotify.Event{Op: op, Name: filename})
}
1019472
func (c KbfsClient) FSOverallSyncEvent(ctx context.Context, status FolderSyncStatus) (err error) {
	__arg := FSOverallSyncEventArg{Status: status}
	err = c.Cli.Call(ctx, "keybase.1.kbfs.FSOverallSyncEvent", []interface{}{__arg}, nil)
	return
}
1149434
func (c *CircularBuffer) PushBatch(events []Event) {
	c.Lock()
	defer c.Unlock()

	for i := range events {
		c.push(events[i])
	}
}
398376
func eventsFileName(dataDir string, sessionID session.ID, eventIndex int64) string {
	return filepath.Join(dataDir, fmt.Sprintf("%v-%v.events.gz", sessionID.String(), eventIndex))
}
24917
func (m *MockVolumeDriver) CloudBackupGroupSchedCreate(arg0 *api.CloudBackupGroupSchedCreateRequest) (*api.CloudBackupSchedCreateResponse, error) {
	ret := m.ctrl.Call(m, "CloudBackupGroupSchedCreate", arg0)
	ret0, _ := ret[0].(*api.CloudBackupSchedCreateResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
998466
func (m *MockCollector) CollectTraceEvent(records []string) {
	m.ctrl.Call(m, "CollectTraceEvent", records)
}
220650
func (c *Client) onEvent(event fsnotify.Event) {
	// If file was removed, delete all configuration associated with it. Do the same action for
	// rename, following action will be create with the new name which re-applies the configuration
	// (if new name is in scope of the defined path)
	if (event.Op == fsnotify.Rename || event.Op == fsnotify.Remove) && !c.fsHandler.FileExists(event.Name) {
		entries := c.db.GetDataForFile(event.Name)
		for _, entry := range entries {
			// Value from DB does not need to be checked
			keyed := keyedData{
				path:      event.Name,
				watchResp: watchResp{Op: datasync.Delete, Key: entry.Key, Value: nil, PrevValue: entry.Value},
			}
			c.sendToChannel(keyed)
			c.db.DeleteFile(event.Name)
		}
		return
	}

	// Read data from file
	dc := c.getFileDecoder(event.Name)
	if dc == nil {
		return
	}
	byteFile, err := c.fsHandler.ReadFile(event.Name)
	if err != nil {
		c.log.Errorf("failed to process filesystem event: file cannot be read %s: %v", event.Name, err)
		return
	}
	decodedFileEntries, err := dc.Decode(byteFile)
	if err != nil {
		c.log.Errorf("failed to process filesystem event: file cannot be decoded %s: %v", event.Name, err)
		return
	}
	file := &decoder.File{Path: event.Name, Data: decodedFileEntries}
	latestFile := &decoder.File{Path: event.Name, Data: c.db.GetDataForFile(event.Name)}
	changed, removed := file.CompareTo(latestFile)
	// Update database and propagate data to channel
	for _, fileDataEntry := range removed {
		keyed := keyedData{
			path:      event.Name,
			watchResp: watchResp{Op: datasync.Delete, Key: fileDataEntry.Key, Value: nil, PrevValue: fileDataEntry.Value},
		}
		c.sendToChannel(keyed)
		c.db.Delete(event.Name, keyed.Key)
	}
	for _, fileDataEntry := range changed {
		// Get last key-val configuration item if exists
		var prevVal []byte
		if prevValEntry, ok := c.db.GetDataForKey(fileDataEntry.Key); ok {
			prevVal = prevValEntry.Value
		}
		keyed := keyedData{
			path:      event.Name,
			watchResp: watchResp{Op: datasync.Put, Key: fileDataEntry.Key, Value: fileDataEntry.Value, PrevValue: prevVal},
		}
		c.sendToChannel(keyed)
		c.db.Add(event.Name, &decoder.FileDataEntry{
			Key:   keyed.Key,
			Value: keyed.Value,
		})
	}
}
139178
func (mr *MockCloudMockRecorder) DetachDisk(arg0, arg1 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DetachDisk", reflect.TypeOf((*MockCloud)(nil).DetachDisk), arg0, arg1)
}
301884
func appendTaskEvent(state *structs.TaskState, event *structs.TaskEvent, capacity int) {
	if state.Events == nil {
		state.Events = make([]*structs.TaskEvent, 1, capacity)
		state.Events[0] = event
		return
	}

	// If we hit capacity, then shift it.
	if len(state.Events) == capacity {
		old := state.Events
		state.Events = make([]*structs.TaskEvent, 0, capacity)
		state.Events = append(state.Events, old[1:]...)
	}

	state.Events = append(state.Events, event)
}
1174854
func (m *Memberlist) triggerFunc(stagger time.Duration, C <-chan time.Time, stop <-chan struct{}, f func()) {
	// Use a random stagger to avoid syncronizing
	randStagger := time.Duration(uint64(rand.Int63()) % uint64(stagger))
	select {
	case <-time.After(randStagger):
	case <-stop:
		return
	}
	for {
		select {
		case <-C:
			f()
		case <-stop:
			return
		}
	}
}
772268
func (c *ContextAction) Trigger() {
	packet := MumbleProto.ContextAction{
		Action: &c.Name,
	}
	c.client.Conn.WriteProto(&packet)
}
102806
func (m *rekeyFSM) listenOnEvent(
	event rekeyEventType, callback func(RekeyEvent), repeatedly bool) {
	m.muListeners.Lock()
	defer m.muListeners.Unlock()
	m.listeners[event] = append(m.listeners[event], rekeyFSMListener{
		onEvent:    callback,
		repeatedly: repeatedly,
	})
}
603155
func (m *MockCloud) AttachDisk(arg0, arg1 string) (interface{}, error) {
	ret := m.ctrl.Call(m, "AttachDisk", arg0, arg1)
	ret0, _ := ret[0].(interface{})
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
542523
func TriggerEvent(name TriggerEventName, payload interface{}) error {
	// Create plugin input
	payloadBytes, err := json.Marshal(payload)
	if err != nil {
		return err
	}

	pluginInput := PluginInput{
		PluginInputPayloadKey:      string(payloadBytes),
		PluginInputTriggerEventKey: string(name),
	}

	// Load plugins
	plugins, err := LoadPlugins(string(name))
	if err != nil {
		return err
	}

	// Run plugins
	for _, plugin := range plugins {
		if err := RunPluginByEvent(plugin, pluginInput); err != nil {
			return err
		}
	}

	return nil
}
1255603
func (s *Simulator) popEvent() event {
	if len(s.events) == 0 {
		panic("no events to pop")
	}
	return heap.Pop(&s.events).(event)
}
157364
func (m *MockCluster) AddEventListener(arg0 cluster.ClusterListener) error {
	ret := m.ctrl.Call(m, "AddEventListener", arg0)
	ret0, _ := ret[0].(error)
	return ret0
}
885712
func (m *MockEventInterface) PatchWithEventNamespace(arg0 *v1.Event, arg1 []byte) (*v1.Event, error) {
	ret := m.ctrl.Call(m, "PatchWithEventNamespace", arg0, arg1)
	ret0, _ := ret[0].(*v1.Event)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}