worker

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: AGPL-3.0, Apache-2.0 Imports: 44 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 intern.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 added in v0.7.0

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

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 CommitOverNetwork(ctx context.Context, tc *api.TxnContext) (uint64, error)

func CouldApplyAggregatorOn added in v0.7.3

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

func EvalCompare added in v0.7.3

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

func ExportOverNetwork added in v0.8.2

func ExportOverNetwork(ctx context.Context) error

func GetSchemaOverNetwork added in v0.8.2

func GetSchemaOverNetwork(ctx context.Context, schema *intern.SchemaRequest) ([]*api.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.ManagedDB)

func MaxLeaseId added in v0.9.0

func MaxLeaseId() uint64

func MutateOverNetwork

func MutateOverNetwork(ctx context.Context, m *intern.Mutations) (*api.TxnContext, 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 *intern.Query) (*intern.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 added in v0.7.0

func RunServer(bindall bool)

RunServer initializes a tcp server on port which listens to requests from other workers for intern.communication.

func SortOverNetwork added in v0.7.0

func SortOverNetwork(ctx context.Context, q *intern.SortMessage) (*intern.SortResult, error)

SortOverNetwork sends sort query over the network.

func StartRaftNodes added in v0.7.0

func StartRaftNodes(walStore *badger.ManagedDB, 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 added in v0.7.0

func StoreStats() string

StoreStats returns stats for data store.

func Timestamps added in v0.9.0

func Timestamps(ctx context.Context, num *intern.Num) (*api.AssignedIds, error)

func ValidateAndConvert added in v0.8.2

func ValidateAndConvert(edge *intern.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 added in v0.7.3

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

type Options added in v0.8.2

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

Jump to

Keyboard shortcuts

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