// NewIndexAlias creates a new IndexAlias over the provided
// Index objects.
979665
func NewIndexAlias(indexes ...Index) *indexAliasImpl {
	return &indexAliasImpl{
		name:    "alias",
		indexes: indexes,
		open:    true,
	}
}
859878
func New(minShift, depth int) *Index {
	if minShift == 0 {
		minShift = DefaultShift
	}
	if depth == 0 {
		depth = DefaultDepth
	}
	return &Index{Version: 0x2, minShift: uint32(minShift), depth: uint32(depth)}
}
596629
func (s *StreamingDistributionConfig) SetAliases(v *Aliases) *StreamingDistributionConfig {
	s.Aliases = v
	return s
}
1216668
func (s *DirectoryDescription) SetAlias(v string) *DirectoryDescription {
	s.Alias = &v
	return s
}
518408
func (a *AliasAddAction) Index(index ...string) *AliasAddAction {
	a.index = append(a.index, index...)
	return a
}
637952
func (b *BaseBuilder) CreateIndex(table, name string, cols ...string) *Query {
	sql := fmt.Sprintf("CREATE INDEX %v ON %v (%v)",
		b.db.QuoteColumnName(name),
		b.db.QuoteTableName(table),
		b.quoteColumns(cols))
	return b.NewQuery(sql)
}
687857
func NewAlias(name string, symbol Symbol) Symbol {
	switch s := symbol.(type) {
	case *BrokenSymbol:
		return newBrokenSymbol(name)
	case *Term:
		return newTerm(name, s.Def())
	case *Invocation:
		return newInvocation(name, s.Def(), s.fn, s.args)
	case *Struct:
		// Structs are copied by value too, but we check they are frozen at this
		// point, so it should be fine. It is possible the struct is not frozen yet
		// in the following self-referential case: 'a = {}; a = struct(k = a)'. But
		// it is not allowed by starlark (redefinitions are forbidden). We still
		// cautiously treat this case as broken.
		if !s.frozen {
			return newBrokenSymbol(name)
		}
		strct := newStruct(name, s.Def())
		strct.symbols = s.symbols // it is immutable, copying the pointer is fine
		strct.freeze()
		return strct
	default:
		panic(fmt.Sprintf("unrecognized symbol type %T", s))
	}
}
291291
func (s *OrganizationSummary) SetAlias(v string) *OrganizationSummary {
	s.Alias = &v
	return s
}
1218081
func NewIndex(physicalID int64, tblInfo *model.TableInfo, indexInfo *model.IndexInfo) table.Index {
	index := &index{
		idxInfo: indexInfo,
		tblInfo: tblInfo,
		// The prefix can't encode from tblInfo.ID, because table partition may change the id to partition id.
		prefix: tablecodec.EncodeTableIndexPrefix(physicalID, indexInfo.ID),
	}
	return index
}
1351923
func (s *AliasService) AddWithFilter(indexName string, aliasName string, filter Query) *AliasService {
	action := NewAliasAddAction(aliasName).Index(indexName).Filter(filter)
	s.actions = append(s.actions, action)
	return s
}
349637
func (ns *Namespace) ResolveAlias(nameNode node.Node, aliasType string) (string, error) {
	aliasType = strings.ToLower(aliasType)
	nameParts := nameNode.(*name.Name).Parts

	firstPartStr := nameParts[0].(*name.NamePart).Value

	if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type
		firstPartStr = strings.ToLower(firstPartStr)
		aliasType = ""
	} else {
		if aliasType != "const" { // constants are case-sensitive
			firstPartStr = strings.ToLower(firstPartStr)
		}
	}

	aliasName, ok := ns.Aliases[aliasType][firstPartStr]
	if !ok {
		return "", errors.New("Not found")
	}

	return aliasName, nil
}
255332
func (f *File) ImportAlias(path, alias string) {
	f.hints[path] = importdef{name: alias, alias: true}
}
1810
func NewIndexWriter() IndexWriter {
	buf := bytes.NewBuffer(make([]byte, 0, 1024*1024))
	return &directIndex{buf: buf, w: bufio.NewWriter(buf)}
}
716207
func CreateOptionMyAlias(alias string) EndpointOption {
	return func(ep *endpoint) {
		ep.myAliases = append(ep.myAliases, alias)
	}
}
55729
func (s *AliasesService) Index(index ...string) *AliasesService {
	s.index = append(s.index, index...)
	return s
}
363717
func (c *Client) IndexSegments(indices ...string) *IndicesSegmentsService {
	return NewIndicesSegmentsService(c).Index(indices...)
}
376311
func NewIndexBuilder(r *Repository) (*IndexBuilder, error) {
	b := &IndexBuilder{
		contentPostings: newPostingsBuilder(),
		namePostings:    newPostingsBuilder(),
		languageMap:     map[string]byte{},
	}

	if r == nil {
		r = &Repository{}
	}
	if err := b.setRepository(r); err != nil {
		return nil, err
	}
	return b, nil
}