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 CommitOverNetwork(ctx context.Context, tc *protos.TxnContext) (uint64, error)
- 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.ManagedDB)
- func MaxLeaseId() uint64
- func MutateOverNetwork(ctx context.Context, m *protos.Mutations) (*protos.TxnContext, 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.ManagedDB, bindall bool)
- func StoreStats() string
- func Timestamps(ctx context.Context, num *protos.Num) (*protos.AssignedIds, error)
- 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 ¶ added in v0.7.0
func BlockingStop ¶ added in v0.7.3
func BlockingStop()
BlockingStop stops all the nodes, server between other workers and syncs all marks.
func CommitOverNetwork ¶ added in v0.9.0
func CouldApplyAggregatorOn ¶ added in v0.7.3
func EvalCompare ¶ added in v0.7.3
func ExportOverNetwork ¶ added in v0.8.2
func GetSchemaOverNetwork ¶ added in v0.8.2
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 MaxLeaseId ¶ added in v0.9.0
func MaxLeaseId() uint64
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 ¶ added in v0.7.0
func RunServer(bindall bool)
RunServer initializes a tcp server on port which listens to requests from other workers for internal communication.
func SortOverNetwork ¶ added in v0.7.0
func SortOverNetwork(ctx context.Context, q *protos.SortMessage) (*protos.SortResult, error)
SortOverNetwork sends sort query over the network.
func StartRaftNodes ¶ added in v0.7.0
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 Timestamps ¶ added in v0.9.0
func ValidateAndConvert ¶ added in v0.8.2
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.