Documentation ¶
Overview ¶
- Copyright (C) 2017 Dgraph Labs, Inc. and Contributors *
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
Package worker contains code for internal worker communication to perform queries and mutations.
Index ¶
- Constants
- func AssignUidsOverNetwork(ctx context.Context, num *protos.Num) (*protos.AssignedIds, error)
- func BlockingStop()
- func CouldApplyAggregatorOn(agrtr string, typ types.TypeID) bool
- func EvalCompare(cmp string, lv, rv int64) bool
- func ExportOverNetwork(ctx context.Context) error
- func GetSchemaOverNetwork(ctx context.Context, schema *protos.SchemaRequest) ([]*protos.SchemaNode, error)
- func Init(ps *badger.KV)
- func MutateOverNetwork(ctx context.Context, m *protos.Mutations) error
- func ProcessTaskOverNetwork(ctx context.Context, q *protos.Query) (*protos.Result, error)
- func RunServer(bindall bool)
- func SortOverNetwork(ctx context.Context, q *protos.SortMessage) (*protos.SortResult, error)
- func StartRaftNodes(walStore *badger.KV, bindall bool)
- func StoreStats() string
- func ValidateAndConvert(edge *protos.DirectedEdge, schemaType types.TypeID) error
- type FuncType
- type Options
Constants ¶
const (
// MB represents a megabyte.
MB = 1 << 20
)
Variables ¶
This section is empty.
Functions ¶
func AssignUidsOverNetwork ¶
func BlockingStop ¶
func BlockingStop()
BlockingStop stops all the nodes, server between other workers and syncs all marks.
func EvalCompare ¶
func ExportOverNetwork ¶
func GetSchemaOverNetwork ¶
func GetSchemaOverNetwork(ctx context.Context, schema *protos.SchemaRequest) ([]*protos.SchemaNode, error)
GetSchemaOverNetwork checks which group should be serving the schema according to fingerprint of the predicate and sends it to that instance.
func MutateOverNetwork ¶
MutateOverNetwork checks which group should be running the mutations according to the group config and sends it to that instance.
func ProcessTaskOverNetwork ¶
ProcessTaskOverNetwork is used to process the query and get the result from the instance which stores posting list corresponding to the predicate in the query.
func RunServer ¶
func RunServer(bindall bool)
RunServer initializes a tcp server on port which listens to requests from other workers for internal communication.
func SortOverNetwork ¶
func SortOverNetwork(ctx context.Context, q *protos.SortMessage) (*protos.SortResult, error)
SortOverNetwork sends sort query over the network.
func StartRaftNodes ¶
StartRaftNodes will read the WAL dir, create the RAFT groups, and either start or restart RAFT nodes. This function triggers RAFT nodes to be created, and is the entrace to the RAFT world from main.go.
func ValidateAndConvert ¶
func ValidateAndConvert(edge *protos.DirectedEdge, schemaType types.TypeID) error
If storage type is specified, then check compatibility or convert to schema type if no storage type is specified then convert to schema type.