// Force prune any (terminal) tasks that match the query. If no statuses are supplied with the
// query, it will default to all terminal task states. If statuses are supplied, they must be
// terminal states.
// 
// Parameters:
//  - Query
2855
func (p *AuroraAdminClient) PruneTasks(ctx context.Context, query *TaskQuery) (r *Response, err error) {
  var _args350 AuroraAdminPruneTasksArgs
  _args350.Query = query
  var _result351 AuroraAdminPruneTasksResult
  if err = p.Client_().Call(ctx, "pruneTasks", &_args350, &_result351); err != nil {
    return
  }
  return _result351.GetSuccess(), nil
}
877243
func (s *Store) Prune(ctx context.Context, name string) error {
	ls, err := s.List(ctx, name)
	if err != nil {
		return err
	}
	for _, e := range ls {
		if err := s.Delete(ctx, e); err != nil {
			return err
		}
	}
	return nil
}
543348
func pruneTaskGetRetainedUnpushed(gitscanner *lfs.GitScanner, fetchconf lfs.FetchPruneConfig, retainChan chan string, errorChan chan error, waitg *sync.WaitGroup, sem *semaphore.Weighted) {
	defer waitg.Done()

	err := gitscanner.ScanUnpushed(fetchconf.PruneRemoteName, func(p *lfs.WrappedPointer, err error) {
		if err != nil {
			errorChan <- err
		} else {
			retainChan <- p.Pointer.Oid
			tracerx.Printf("RETAIN: %v unpushed", p.Pointer.Oid)
		}
	})

	if err != nil {
		errorChan <- err
		return
	}
}
322744
func (m *InMem) Prune(ctx context.Context, prefix string) error {
	m.Lock()
	defer m.Unlock()

	deleted := 0
	for k := range m.data {
		if strings.HasPrefix(k, prefix+"/") {
			delete(m.data, k)
			deleted++
		}
	}
	if deleted < 1 {
		return fmt.Errorf("not found")
	}
	return nil
}
798884
func (api *API) Prune(p params.StatusHistoryPruneArgs) error {
	if !api.authorizer.AuthController() {
		return common.ErrPerm
	}
	return state.PruneStatusHistory(api.st, p.MaxHistoryTime, p.MaxHistoryMB)
}
1326894
func (c *ContainerCache) Prune(liveContainers map[string]interface{}) {
	c.Lock()
	defer c.Unlock()

	for id := range c.cache {
		if _, ok := liveContainers[id]; !ok {
			delete(c.cache, id)
		}
	}
}
117456
func (r *SearchRequest) Query(query Query) *SearchRequest {
	r.searchSource = r.searchSource.Query(query)
	return r
}
610345
func (s *State) prune() {
	if s == nil {
		return
	}

	// Filter out empty modules.
	// A module is always assumed to have a path, and it's length isn't always
	// bounds checked later on. Modules may be "emptied" during destroy, but we
	// never want to store those in the state.
	for i := 0; i < len(s.Modules); i++ {
		if s.Modules[i] == nil || len(s.Modules[i].Path) == 0 {
			s.Modules = append(s.Modules[:i], s.Modules[i+1:]...)
			i--
		}
	}

	for _, mod := range s.Modules {
		mod.prune()
	}
	if s.Remote != nil && s.Remote.Empty() {
		s.Remote = nil
	}
}
1342431
func (q Query) ForEachT(actionFn interface{}) {
	actionGenericFunc, err := newGenericFunc(
		"ForEachT", "actionFn", actionFn,
		simpleParamValidator(newElemTypeSlice(new(genericType)), nil),
	)

	if err != nil {
		panic(err)
	}

	actionFunc := func(item interface{}) {
		actionGenericFunc.Call(item)
	}

	q.ForEach(actionFunc)
}
884866
func pruneTaskGetRetainedAtRef(gitscanner *lfs.GitScanner, ref string, retainChan chan string, errorChan chan error, waitg *sync.WaitGroup, sem *semaphore.Weighted) {
	sem.Acquire(context.Background(), 1)
	defer sem.Release(1)
	defer waitg.Done()

	err := gitscanner.ScanRef(ref, func(p *lfs.WrappedPointer, err error) {

		if err != nil {
			errorChan <- err
			return
		}

		retainChan <- p.Oid
		tracerx.Printf("RETAIN: %v via ref %v", p.Oid, ref)
	})

	if err != nil {
		errorChan <- err
	}
}
325072
func (q *sessionQueue) ForceQuit() {
	q.forced.Do(func() {
		log.Infof("Force quitting session queue %s", q.ID())

		close(q.forceQuit)
		q.signalUntilShutdown()

		log.Infof("Session queue %s unclean shutdown complete", q.ID())
	})
}
428971
func (s *SearchSource) Query(query Query) *SearchSource {
	s.query = query
	return s
}
813131
func (ptree *ptree) Query(start, stop common.Comparator) common.Comparators {
	cmps := make(common.Comparators, 0, 32)
	aa := newApplyAction(func(cmp common.Comparator) bool {
		cmps = append(cmps, cmp)
		return true
	}, start, stop)
	ptree.checkAndRun(aa)
	aa.completer.Wait()
	return cmps
}
805551
func (s *ProxyQueryService) Query(ctx context.Context, w io.Writer, req *query.ProxyRequest) (flux.Statistics, error) {
	return s.QueryF(ctx, w, req)
}
1249159
func (p *Pruner) Prune(memCache map[int64]string) error {
	err := p.removeOldPings()
	if err != nil {
		return errors.Trace(err)
	}
	err = p.removeUnusedBeings(memCache)
	if err != nil {
		return errors.Trace(err)
	}
	return nil
}
1362084
func (rt *skipListRT) Query(interval rangetree.Interval) rangetree.Entries {
	entries := make(rangetree.Entries, 0, 100)
	rt.apply(rt.top, 0, interval, func(e rangetree.Entry) bool {
		entries = append(entries, e)
		return true
	})

	return entries
}
983516
func (s *Service) Query(ctx context.Context, req *query.Request) (flux.ResultIterator, error) {
	resp, err := s.query(ctx, req)
	if err != nil {
		return nil, err
	}

	// Decode the response into the JSON structure.
	var results Response
	if err := json.NewDecoder(resp.Body).Decode(&results); err != nil {
		return nil, err
	}

	// Return a result iterator using the response.
	return NewResponseIterator(&results), nil
}