graph

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: Apache-2.0, NCSA Imports: 26 Imported by: 4

Documentation

Overview

Package graph provides a high-performance table-based implementation of the graph.Service.

Table format:

edgeSets:<ticket>      -> srvpb.PagedEdgeSet
edgePages:<page_key>   -> srvpb.EdgePage

Index

Constants

View Source
const ColumnarTableKeyMarker = "kythe:columnar"

ColumnarTableKeyMarker is stored within a Kythe columnar table to differentiate it from the legacy combined table format.

Variables

This section is empty.

Functions

func EdgePageKey

func EdgePageKey(key string) []byte

EdgePageKey returns the edgepage CombinedTable key for the given key.

func EdgeSetKey

func EdgeSetKey(ticket string) []byte

EdgeSetKey returns the edgeset CombinedTable key for the given source ticket.

func NewService added in v0.0.29

func NewService(ctx context.Context, t keyvalue.DB) graph.Service

NewService returns an graph.Service backed by the given table. The format of the table with be automatically detected.

Types

type ColumnarTable added in v0.0.29

type ColumnarTable struct{ keyvalue.DB }

ColumnarTable implements an graph.Service backed by a columnar serving table.

func NewColumnarTable added in v0.0.29

func NewColumnarTable(t keyvalue.DB) *ColumnarTable

NewColumnarTable returns a table for the given columnar graph lookup table.

func (*ColumnarTable) Edges added in v0.0.29

func (c *ColumnarTable) Edges(ctx context.Context, req *gpb.EdgesRequest) (*gpb.EdgesReply, error)

Edges implements part of the graph.Service interface.

func (*ColumnarTable) Nodes added in v0.0.29

func (c *ColumnarTable) Nodes(ctx context.Context, req *gpb.NodesRequest) (*gpb.NodesReply, error)

Nodes implements part of the graph.Service interface.

type SplitTable

type SplitTable struct {
	// Edges is a table of srvpb.PagedEdgeSets keyed by their source tickets.
	Edges table.Proto

	// EdgePages is a table of srvpb.EdgePages keyed by their page keys.
	EdgePages table.Proto
}

SplitTable implements the graph Service interface using separate static lookup tables for each API component.

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table implements the GraphService interface using static lookup tables.

func NewCombinedTable

func NewCombinedTable(t table.Proto) *Table

NewCombinedTable returns a table for the given combined graph lookup table. The table's keys are expected to be constructed using only the EdgeSetKey, EdgePageKey, and DecorationsKey functions.

func NewSplitTable

func NewSplitTable(c *SplitTable) *Table

NewSplitTable returns a table based on the given serving tables for each API component.

func (*Table) Edges

func (t *Table) Edges(ctx context.Context, req *gpb.EdgesRequest) (*gpb.EdgesReply, error)

Edges implements part of the graph Service interface.

func (*Table) Nodes

func (t *Table) Nodes(ctx context.Context, req *gpb.NodesRequest) (*gpb.NodesReply, error)

Nodes implements part of the graph Service interface.

Directories

Path Synopsis
Package columnar implements the columnar table format for a Kythe xrefs service.
Package columnar implements the columnar table format for a Kythe xrefs service.

Jump to

Keyboard shortcuts

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