// storeFilter stores a given filter, and performs the steps needed to
// generate the filter's header.
519672
func storeFilter(dbTx database.Tx, block *btcutil.Block, f *gcs.Filter,
	filterType wire.FilterType) error {
	if uint8(filterType) > maxFilterType {
		return errors.New("unsupported filter type")
	}

	// Figure out which buckets to use.
	fkey := cfIndexKeys[filterType]
	hkey := cfHeaderKeys[filterType]
	hashkey := cfHashKeys[filterType]

	// Start by storing the filter.
	h := block.Hash()
	filterBytes, err := f.NBytes()
	if err != nil {
		return err
	}
	err = dbStoreFilterIdxEntry(dbTx, fkey, h, filterBytes)
	if err != nil {
		return err
	}

	// Next store the filter hash.
	filterHash, err := builder.GetFilterHash(f)
	if err != nil {
		return err
	}
	err = dbStoreFilterIdxEntry(dbTx, hashkey, h, filterHash[:])
	if err != nil {
		return err
	}

	// Then fetch the previous block's filter header.
	var prevHeader *chainhash.Hash
	ph := &block.MsgBlock().Header.PrevBlock
	if ph.IsEqual(&zeroHash) {
		prevHeader = &zeroHash
	} else {
		pfh, err := dbFetchFilterIdxEntry(dbTx, hkey, ph)
		if err != nil {
			return err
		}

		// Construct the new block's filter header, and store it.
		prevHeader, err = chainhash.NewHash(pfh)
		if err != nil {
			return err
		}
	}

	fh, err := builder.MakeHeaderForFilter(f, *prevHeader)
	if err != nil {
		return err
	}
	return dbStoreFilterIdxEntry(dbTx, hkey, h, fh[:])
}
492663
func (s *GetEntitlementsInput) SetFilter(v map[string][]*string) *GetEntitlementsInput {
	s.Filter = v
	return s
}
848972
func (s *DescribeEventTypesInput) SetFilter(v *EventTypeFilter) *DescribeEventTypesInput {
	s.Filter = v
	return s
}
1227032
func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule {
	s.Filter = v
	return s
}
685997
func (s *GetCostAndUsageInput) SetFilter(v *Expression) *GetCostAndUsageInput {
	s.Filter = v
	return s
}
1021654
func (service *BaseService) RemoveFilter(filter ...Filter) Service {
	service.filterManager.RemoveFilter(filter...)
	return service
}
934790
func (service *BaseService) AddFilter(filter ...Filter) Service {
	service.filterManager.AddFilter(filter...)
	return service
}
1158285
func (s *ListPoliciesForTargetInput) SetFilter(v string) *ListPoliciesForTargetInput {
	s.Filter = &v
	return s
}
418912
func (s BlockTrigger) Store(bd *BlockData, _ *wire.MsgBlock) error {
	s.Saver(bd.Header.Hash, bd.Header.Height)
	return nil
}
615874
func (engine *Engine) StoreEngine(storeEngine string) *Session {
	session := engine.NewSession()
	session.IsAutoClose = true
	return session.StoreEngine(storeEngine)
}
806054
func (c *Container) Filter(filter FilterFunction) {
	c.containerFilters = append(c.containerFilters, filter)
}
592524
func (s *DescribeImagesInput) SetFilter(v *DescribeImagesFilter) *DescribeImagesInput {
	s.Filter = v
	return s
}
1267649
func (c *fileStore) Store(authConfig types.AuthConfig) error {
	c.file.GetAuthConfigs()[authConfig.ServerAddress] = authConfig
	return c.file.Save()
}
646513
func (s *storeImpl) Put(ctx datastore.Context, lf *LogFilter) error {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("LogFilterStore.Put"))
	return s.ds.Put(ctx, Key(lf.Name, lf.Version), lf)
}
350861
func (s *ListRecordHistoryInput) SetSearchFilter(v *ListRecordHistorySearchFilter) *ListRecordHistoryInput {
	s.SearchFilter = v
	return s
}
1136838
func (s *TermvectorsService) Filter(filter *TermvectorsFilterSettings) *TermvectorsService {
	s.filter = filter
	return s
}
810717
func (s *ListTopicsDetectionJobsInput) SetFilter(v *TopicsDetectionJobFilter) *ListTopicsDetectionJobsInput {
	s.Filter = v
	return s
}