dgraph

package
v0.8.3 Latest Latest
Warning

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

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

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/>.

* 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/>.

* 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/>.

* 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/>.

Index

Constants

View Source
const MinAllottedMemory = 1024.0

Variables

View Source
var DefaultConfig = Options{
	PostingDir:    "p",
	PostingTables: "loadtoram",
	WALDir:        "w",
	Nomutations:   false,

	AllottedMemory: -1.0,
	CommitFraction: 0.10,

	BaseWorkerPort:      12345,
	ExportPath:          "export",
	NumPendingProposals: 2000,
	Tracing:             0.0,
	GroupIds:            "0,1",
	MyAddr:              "",
	PeerAddr:            "",
	RaftId:              1,
	MaxPendingCount:     1000,
	ExpandEdge:          true,
	InMemoryComm:        false,

	ConfigFile: "",
	DebugMode:  false,
}

Functions

func DisposeEmbeddedDgraph

func DisposeEmbeddedDgraph()

func NewEmbeddedDgraphClient

func NewEmbeddedDgraphClient(config Options, opts client.BatchMutationOptions,
	clientDir string) *client.Dgraph

func SetConfiguration

func SetConfiguration(newConfig Options)

Types

type Options

type Options struct {
	PostingDir    string
	PostingTables string
	WALDir        string
	Nomutations   bool

	AllottedMemory float64
	CommitFraction float64

	BaseWorkerPort      int
	ExportPath          string
	NumPendingProposals int
	Tracing             float64
	GroupIds            string
	MyAddr              string
	PeerAddr            string
	RaftId              uint64
	MaxPendingCount     uint64
	ExpandEdge          bool
	InMemoryComm        bool

	ConfigFile string
	DebugMode  bool
}
var Config Options

TODO(tzdybal) - remove global

func GetDefaultEmbeddedConfig

func GetDefaultEmbeddedConfig() Options

type Server

type Server struct{}

Server implements protos.DgraphServer

func (*Server) AssignUids

func (s *Server) AssignUids(ctx context.Context, num *protos.Num) (*protos.AssignedIds, error)

func (*Server) CheckVersion

func (s *Server) CheckVersion(ctx context.Context, c *protos.Check) (v *protos.Version, err error)

func (*Server) Run

func (s *Server) Run(ctx context.Context, req *protos.Request) (resp *protos.Response, err error)

This method is used to execute the query and return the response to the client as a protocol buffer message.

type ServerState

type ServerState struct {
	FinishCh   chan struct{} // channel to wait for all pending reqs to finish.
	ShutdownCh chan struct{} // channel to signal shutdown.

	Pstore   *badger.KV
	WALstore *badger.KV
	// contains filtered or unexported fields
}
var State ServerState

TODO(tzdybal) - remove global

func NewServerState

func NewServerState() (state ServerState)

func (*ServerState) Dispose

func (s *ServerState) Dispose() error

Jump to

Keyboard shortcuts

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