worker

package
v83.0.0-...-38e0eed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2017 License: AGPL-3.0, Apache-2.0 Imports: 43 Imported by: 0

README

To update the protocol buffer definitions, run this from one directory above:

protoc -I worker worker/payload.proto --gofast_out=plugins=grpc:worker

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

View Source
const (
	// MB represents a megabyte.
	MB = 1 << 20
)

Variables

This section is empty.

Functions

func AssignUidsOverNetwork

func AssignUidsOverNetwork(ctx context.Context, num *protos.Num) (*protos.AssignedIds, error)

func BlockingStop

func BlockingStop()

BlockingStop stops all the nodes, server between other workers and syncs all marks.

func CouldApplyAggregatorOn

func CouldApplyAggregatorOn(agrtr string, typ types.TypeID) bool

func EvalCompare

func EvalCompare(cmp string, lv, rv int64) bool

func ExportOverNetwork

func ExportOverNetwork(ctx context.Context) error

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 Init

func Init(ps *badger.KV)

func MutateOverNetwork

func MutateOverNetwork(ctx context.Context, m *protos.Mutations) error

MutateOverNetwork checks which group should be running the mutations according to the group config and sends it to that instance.

func ProcessTaskOverNetwork

func ProcessTaskOverNetwork(ctx context.Context, q *protos.Query) (*protos.Result, error)

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

func StartRaftNodes(walStore *badger.KV, bindall bool)

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 StoreStats

func StoreStats() string

StoreStats returns stats for data store.

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.

Types

type FuncType

type FuncType int
const (
	NotAFunction FuncType = iota
	AggregatorFn
	CompareAttrFn
	CompareScalarFn
	GeoFn
	PasswordFn
	RegexFn
	FullTextSearchFn
	HasFn
	UidInFn
	StandardFn = 100
)

type Options

type Options struct {
	BaseWorkerPort      int
	ExportPath          string
	NumPendingProposals int
	Tracing             float64
	GroupIds            string
	MyAddr              string
	PeerAddr            string
	RaftId              uint64
	MaxPendingCount     uint64
	ExpandEdge          bool
	InMemoryComm        bool
}
var Config Options

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL