// disable prevents new operations from hitting the journal.  Will
// fail unless the journal is completely empty.
518722
func (j *tlfJournal) disable() (wasEnabled bool, err error) {
	j.journalLock.Lock()
	defer j.journalLock.Unlock()
	err = j.checkEnabledLocked()
	switch errors.Cause(err).(type) {
	case nil:
		// Continue.
		break
	case errTLFJournalDisabled:
		// Already disabled.
		return false, nil
	default:
		return false, err
	}

	blockEntryCount := j.blockJournal.length()
	mdEntryCount := j.mdJournal.length()

	// You can only disable an empty journal.
	if blockEntryCount > 0 || mdEntryCount > 0 {
		return false, errors.WithStack(errTLFJournalNotEmpty{})
	}

	j.disabled = true
	return true, nil
}
451936
func (m *Machine) Enable() {
	if !m.State.Enabled {
		m.State = State{
			Enabled:    true,
			Generation: m.nextGen(),
			LastRewind: m.Now,
		}
		m.scheduleTick(m.Now)
	}
}
37894
func (pm *Manager) Disable(refOrID string, config *types.PluginDisableConfig) error {
	p, err := pm.config.Store.GetV2Plugin(refOrID)
	if err != nil {
		return err
	}
	pm.mu.RLock()
	c := pm.cMap[p]
	pm.mu.RUnlock()

	if !config.ForceDisable && p.GetRefCount() > 0 {
		return errors.WithStack(inUseError(p.Name()))
	}

	for _, typ := range p.GetTypes() {
		if typ.Capability == authorization.AuthZApiImplements {
			pm.config.AuthzMiddleware.RemovePlugin(p.Name())
		}
	}

	if err := pm.disable(p, c); err != nil {
		return err
	}
	pm.publisher.Publish(EventDisable{Plugin: p.PluginObj})
	pm.config.LogPluginEvent(p.GetID(), refOrID, "disable")
	return nil
}
1060441
func (s *RequestProgress) SetEnabled(v bool) *RequestProgress {
	s.Enabled = &v
	return s
}
934853
func (e *engineImpl) disableJob(c context.Context, jobID string) error {
	return e.jobTxn(c, jobID, func(c context.Context, job *Job, isNew bool) error {
		if isNew || !job.Enabled {
			return errSkipPut
		}
		job.Enabled = false

		// Stop the cron machine ticks.
		err := pokeCron(c, job, e.cfg.Dispatcher, func(m *cron.Machine) error {
			m.Disable()
			return nil
		})
		if err != nil {
			return err
		}

		// Kick the triage to clear the pending triggers. We can pop them only
		// from within the triage procedure.
		return e.kickTriageLater(c, job.JobID, 0)
	})
}
556719
func Disabled(msg pgs.Message) (disabled bool, err error) {
	_, err = msg.Extension(validate.E_Disabled, &disabled)
	return
}
546088
func (module *ODroidC1AnalogModule) Disable() error {
	// Unassign any pins we may have assigned
	for pin, _ := range module.definedPins {
		// attempt to assign this pin for this module.
		UnassignPin(pin)
	}

	// if there are any open analog pins, close them
	for _, openPin := range module.openPins {
		openPin.analogClose()
	}
	return nil
}
898967
func Disable(name string) {
	logger := loggers[name]
	if logger == nil {
		Default.Warn("cannot find logger " + name)
		return
	}

	logger.disabled = true
}
1206635
func (o *MockOracle) Enable() {
	o.Lock()
	defer o.Unlock()
	o.stop = false
}
772114
func (f *RegexFilter) Disabled() bool {
	f.mu.RLock()
	if len(f.currentFilters) == 0 {
		f.mu.RUnlock()
		return true
	}
	f.mu.RUnlock()
	return false
}
514564
func (r *Containerd) Enable() error {
	if err := disableOthers(r, r.Runner); err != nil {
		glog.Warningf("disableOthers: %v", err)
	}
	if err := populateCRIConfig(r.Runner, r.SocketPath()); err != nil {
		return err
	}
	if err := enableIPForwarding(r.Runner); err != nil {
		return err
	}
	// Oherwise, containerd will fail API requests with 'Unimplemented'
	return r.Runner.Run("sudo systemctl restart containerd")
}
472261
func (j *JournalManager) DisableAuto(ctx context.Context) error {
	j.lock.Lock()
	defer j.lock.Unlock()
	if enabled, _ := j.getEnableAutoLocked(); !enabled {
		// Nothing to do.
		return nil
	}

	j.log.CDebugf(ctx, "Disabling auto-journaling")
	j.serverConfig.EnableAuto = false
	j.serverConfig.EnableAutoSetByUser = true
	return j.writeConfig()
}
470000
func (m *ARPMechanism) Disable() {
	m.BaseMechanism.Disable()

	// Remove installed handlers
	m.filter.Unhandle()

	// Match packets of ARP protocol.
	match := ofp.Match{ofp.MT_OXM, []ofp.OXM{
		ofputil.EthType(uint16(iana.ETHT_ARP), nil),
	}}

	err := of.Send(m.C.Switch.Conn(),
		// Flush installed flows
		ofputil.TableFlush(ofp.Table(m.tableNo)),
		// Flush redirect flow
		ofputil.FlowFlush(0, match),
	)

	// Release acquired table
	m.C.Switch.ReleaseTable(m.tableNo)

	if err != nil {
		log.ErrorLog("arp/DISABLE_HOOK",
			"Failed to send requests: ", err)
	}

	log.InfoLog("arp/DISABLE_HOOK", "Mechanism ARP disabled")
}
100896
func (s *UsergroupsService) Disable(usergroup string) *UsergroupsDisableCall {
	var call UsergroupsDisableCall
	call.service = s
	call.usergroup = usergroup
	return &call
}
825850
func (s *AccessLog) SetEnabled(v bool) *AccessLog {
	s.Enabled = &v
	return s
}
233799
func Disable() p.Plugin {
	return p.NewRequestPlugin(func(ctx *c.Context, h c.Handler) {
		// Assert http.Transport to work with the instance
		transport, ok := ctx.Client.Transport.(*http.Transport)
		if !ok {
			h.Next(ctx)
			return
		}

		// Override the http.Client transport
		transport.DisableCompression = true
		ctx.Client.Transport = transport

		h.Next(ctx)
	})
}
966136
func (s *User) SetEnabled(v bool) *User {
	s.Enabled = &v
	return s
}