// NewGroupExpr creates a GroupExpr based on a logical plan node.
335242
func NewGroupExpr(node plannercore.LogicalPlan) *GroupExpr {
	return &GroupExpr{
		ExprNode: node,
		Children: nil,
		Explored: false,
	}
}
453067
func NewGroupAddMemberType(Description string) *GroupAddMemberType {
	s := new(GroupAddMemberType)
	s.Description = Description
	return s
}
109779
func NewGroupByFinal(ctx *plan.Context, p *plan.GroupBy) *GroupByFinal {
	m := &GroupByFinal{
		TaskBase: NewTaskBase(ctx),
		p:        p,
		complete: make(chan bool),
	}
	return m
}
881740
func NewExtendsNode(tplRef Expr, p Pos) *ExtendsNode {
	return &ExtendsNode{p, TrimmableNode{}, tplRef}
}
478433
func newValueExpr(value interface{}) ast.ValueExpr {
	if ve, ok := value.(*ValueExpr); ok {
		return ve
	}
	ve := &ValueExpr{}
	ve.SetValue(value)
	types.DefaultTypeForValue(value, &ve.Type)
	ve.projectionOffset = -1
	return ve
}
629519
func NewRegexp() *Regexp {
	return &Regexp{
		factory: &regexpQueryFactory{
			compiled:  make(map[string]regexpQuery),
			threshold: time.Minute,
		},
		flags:     regexpFlagList(defaultFlags),
		quotemeta: false,
		name:      "Regexp",
		outCh:     pipeline.ChanOutput(make(chan interface{})),
	}
}
632878
func (g *Group) NewGroup(path string) *Group {
	if len(path) < 1 {
		panic("Group path must not be empty")
	}

	checkPath(path)
	path = g.path + path
	//Don't want trailing slash as all sub-paths start with slash
	if path[len(path)-1] == '/' {
		path = path[:len(path)-1]
	}
	return &Group{path, g.mux}
}
116344
func NewGroupAddExternalIdDetails(NewValue string) *GroupAddExternalIdDetails {
	s := new(GroupAddExternalIdDetails)
	s.NewValue = NewValue
	return s
}
676553
func NewGroupCreateType(Description string) *GroupCreateType {
	s := new(GroupCreateType)
	s.Description = Description
	return s
}
29753
func NewGroupMemberSelector(Group *GroupSelector, User *UserSelectorArg) *GroupMemberSelector {
	s := new(GroupMemberSelector)
	s.Group = Group
	s.User = User
	return s
}
188478
func NewGroupMod() *GroupMod {
	g := new(GroupMod)
	g.Header = NewOfp13Header()
	g.Header.Type = Type_GroupMod

	g.Command = OFPGC_ADD
	g.Type = OFPGT_ALL
	g.GroupId = 0
	g.Buckets = make([]Bucket, 0)
	return g
}
267573
func NewGroupByMergedGroupResultSet(g []GroupResultSet) GroupResultSet {
	if len(g) == 0 {
		return nil
	} else if len(g) == 1 {
		return g[0]
	}

	grs := &groupByMergedGroupResultSet{}
	grs.nilVal = nilSortHi
	grs.groupCursors = make([]GroupCursor, 0, len(g))
	grs.resultSets = make([]ResultSet, 0, len(g))
	grs.items = make([]*groupCursorItem, 0, len(g))
	grs.alt = make([]*groupCursorItem, 0, len(g))
	for _, rs := range g {
		grs.items = append(grs.items, &groupCursorItem{grs: rs})
	}

	return grs
}
1355506
func newGenerators(regexps []*syntax.Regexp, args *GeneratorArgs) ([]*internalGenerator, error) {
	generators := make([]*internalGenerator, len(regexps), len(regexps))
	var err error

	// create a generator for each alternate pattern
	for i, subR := range regexps {
		generators[i], err = newGenerator(subR, args)
		if err != nil {
			return nil, err
		}
	}

	return generators, nil
}
1194655
func NewGroupLocMap(c *GroupLocMapConfig) GroupLocMap {
	cfg := resolveGroupLocMapConfig(c)
	locmap := &groupLocMap{workers: uint32(cfg.Workers)}
	// Minimum bits = 2 and count = 4 because the Page logic needs at least two
	// bits to work with, so it can split a page when needed.
	locmap.bits = 2
	count := uint32(4)
	est := uint32(cfg.PageSize / int(unsafe.Sizeof(groupLocMapEntry{})))
	for count < est {
		locmap.bits++
		count <<= 1
	}
	locmap.lowMask = count - 1
	// Minimum rootShift = 63 and count = 2 because the Roots logic needs at
	// least 1 bit to work with.
	locmap.rootShift = 63
	count = 2
	for count < uint32(cfg.Roots) {
		locmap.rootShift--
		count <<= 1
	}
	locmap.entriesLockMask = count - 1
	locmap.splitLevel = uint32(float64(uint32(1<<locmap.bits)) * cfg.SplitMultiplier)
	locmap.roots = make([]groupLocMapNode, count)
	for i := 0; i < len(locmap.roots); i++ {
		locmap.roots[i].highMask = uint64(1) << (locmap.rootShift - 1)
		locmap.roots[i].rangeStart = uint64(i) << locmap.rootShift
		locmap.roots[i].rangeStop = uint64(1)<<locmap.rootShift - 1 + locmap.roots[i].rangeStart
		// Local splitLevel should be a random +-10% to keep splits across a
		// distributed load from synchronizing and causing overall "split lag".
		locmap.roots[i].splitLevel = uint32(float64(locmap.splitLevel) + (rand.Float64()-.5)/5*float64(locmap.splitLevel))
		// Local mergeLevel should be a random percentage, up to 10% of the
		// splitLevel, to keep merges across a distributed load from
		// synchronizing and causing overall "merge lag".
		locmap.roots[i].mergeLevel = uint32(rand.Float64() / 10 * float64(locmap.splitLevel))
	}
	return locmap
}
89077
func NewKeyValueExpr(k, v Expr, pos Pos) *KeyValueExpr {
	return &KeyValueExpr{pos, k, v}
}
1152006
func NewGroup(remotes []string, tlsConfig *tls.Config, strategy Strategy) (Remote, error) {
	var servers = make([]*server, len(remotes))
	for i := range remotes {
		u, err := normalizeURL(remotes[i])
		if err != nil {
			return nil, err
		}
		servers[i] = newServer(u, tlsConfig)
	}

	switch strategy {
	case StrategyOrderedList:
		return newOrdererdListGroup(servers)
	default:
		return nil, errors.New("unrecognised strategy")
	}
}
991268
func NewExpression(Expr node.Node) *Expression {
	return &Expression{
		FreeFloating: nil,
		Expr:         Expr,
	}
}