Documentation ¶
Index ¶
- func DstEdgeKey(eid, src, dst, label uint64) []byte
- func DstEdgeKeyParse(key []byte) (uint64, uint64, uint64, uint64)
- func DstEdgeKeyPrefix(src, dst, eid uint64) []byte
- func DstEdgeListPrefix() []byte
- func DstEdgePrefix(id uint64) []byte
- func EdgeKey(id, src, dst, label uint64) []byte
- func EdgeKeyParse(key []byte) (uint64, uint64, uint64, uint64)
- func EdgeKeyPrefix(id uint64) []byte
- func EdgeListPrefix() []byte
- func GetRawProcessor(db *Graph, ps gdbi.PipelineState, stmt *gripql.GraphStatement) (gdbi.Processor, error)
- func NewCompiler(ggraph *Graph) gdbi.Compiler
- func NewGraphDB(baseDir string) (gdbi.GraphDB, error)
- func SelectPath(stmts []*gripql.GraphStatement, path []int) []*gripql.GraphStatement
- func SrcEdgeKey(eid, src, dst, label uint64) []byte
- func SrcEdgeKeyParse(key []byte) (uint64, uint64, uint64, uint64)
- func SrcEdgeKeyPrefix(eid, src, dst uint64) []byte
- func SrcEdgeListPrefix() []byte
- func SrcEdgePrefix(id uint64) []byte
- func VertexKey(id uint64) []byte
- func VertexKeyParse(key []byte) uint64
- func VertexListPrefix() []byte
- type Compiler
- type GDB
- func (kgraph *GDB) AddGraph(graph string) error
- func (ma *GDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
- func (kgraph *GDB) Close() error
- func (kgraph *GDB) DeleteGraph(graph string) error
- func (kgraph *GDB) Graph(graph string) (gdbi.GraphInterface, error)
- func (gdb *GDB) ListGraphs() []string
- type GRIDDataElement
- type GRIDDataElementID
- type GRIDTraveler
- func (t *GRIDTraveler) AddCurrent(r *gdbi.DataElement) gdbi.Traveler
- func (t *GRIDTraveler) AddMark(label string, r *gdbi.DataElement) gdbi.Traveler
- func (t *GRIDTraveler) AddRawCurrent(r *GRIDDataElement) *GRIDTraveler
- func (t *GRIDTraveler) Copy() gdbi.Traveler
- func (t *GRIDTraveler) GRIDCopy() *GRIDTraveler
- func (t GRIDTraveler) GetAggregation() *gdbi.Aggregate
- func (t *GRIDTraveler) GetCount() uint32
- func (t *GRIDTraveler) GetCurrent() *gdbi.DataElement
- func (t *GRIDTraveler) GetCurrentID() string
- func (t *GRIDTraveler) GetMark(label string) *gdbi.DataElement
- func (t *GRIDTraveler) GetPath() []gdbi.DataElementID
- func (t *GRIDTraveler) GetRender() interface{}
- func (t *GRIDTraveler) GetSelections() map[string]*gdbi.DataElement
- func (tr *GRIDTraveler) GetSignal() gdbi.Signal
- func (t *GRIDTraveler) HasMark(label string) bool
- func (tr *GRIDTraveler) IsNull() bool
- func (tr *GRIDTraveler) IsSignal() bool
- func (t *GRIDTraveler) ListMarks() []string
- type Graph
- func (ggraph *Graph) AddEdge(edges []*gdbi.Edge) error
- func (ggraph *Graph) AddVertex(vertices []*gdbi.Vertex) error
- func (ggraph *Graph) AddVertexIndex(label string, field string) error
- func (ggraph *Graph) BulkAdd(stream <-chan *gdbi.GraphElement) error
- func (g *Graph) Close() error
- func (ggraph *Graph) Compiler() gdbi.Compiler
- func (ggraph *Graph) DelEdge(eid string) error
- func (ggraph *Graph) DelVertex(id string) error
- func (ggraph *Graph) DeleteVertexIndex(label string, field string) error
- func (ggraph *Graph) GetEdge(id string, loadProp bool) *gdbi.Edge
- func (ggraph *Graph) GetEdgeList(ctx context.Context, loadProp bool) <-chan *gdbi.Edge
- func (ggraph *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, ...) chan gdbi.ElementLookup
- func (ggraph *Graph) GetTimestamp() string
- func (ggraph *Graph) GetVertex(id string, loadProp bool) *gdbi.Vertex
- func (ggraph *Graph) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
- func (ggraph *Graph) GetVertexIndexList() <-chan *gripql.IndexID
- func (ggraph *Graph) GetVertexList(ctx context.Context, loadProp bool) <-chan *gdbi.Vertex
- func (ggraph *Graph) ListEdgeLabels() ([]string, error)
- func (ggraph *Graph) ListVertexLabels() ([]string, error)
- func (ggraph *Graph) RawGetEdgeList(ctx context.Context) <-chan *GRIDDataElement
- func (ggraph *Graph) RawGetInChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
- func (ggraph *Graph) RawGetInEdgeChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
- func (ggraph *Graph) RawGetOutChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
- func (ggraph *Graph) RawGetOutEdgeChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
- func (ggraph *Graph) RawGetVertexChannel(reqChan chan *RawElementLookup) <-chan *RawElementLookup
- func (ggraph *Graph) RawGetVertexList(ctx context.Context) <-chan *GRIDDataElement
- func (ggraph *Graph) VertexLabelScan(ctx context.Context, label string) chan string
- type KeyMap
- func (km *KeyMap) Close()
- func (km *KeyMap) DelEdgeKey(id string) error
- func (km *KeyMap) DelVertexKey(id string) error
- func (km *KeyMap) GetEdgeID(key uint64) (string, bool)
- func (km *KeyMap) GetEdgeKey(id string) (uint64, bool)
- func (km *KeyMap) GetEdgeLabel(key uint64) uint64
- func (km *KeyMap) GetLabelID(key uint64) (string, bool)
- func (km *KeyMap) GetLabelKey(id string) (uint64, bool)
- func (km *KeyMap) GetVertexID(key uint64) (string, bool)
- func (km *KeyMap) GetVertexKey(id string) (uint64, bool)
- func (km *KeyMap) GetVertexLabel(key uint64) uint64
- func (km *KeyMap) GetsertEdgeKey(id, label string) (uint64, uint64)
- func (km *KeyMap) GetsertLabelKey(id string) uint64
- func (km *KeyMap) GetsertVertexKey(id, label string) (uint64, uint64)
- type PathInEProc
- type PathInEdgeAdjProc
- type PathInProc
- type PathLabelProc
- type PathOutEProc
- type PathOutEdgeAdjProc
- type PathOutProc
- type PathVProc
- type RawElementLookup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DstEdgeKey ¶
DstEdgeKey creates a dest edge index key
func DstEdgeKeyParse ¶
DstEdgeKeyParse takes a dest index key entry and parses it into: `graph`, `edgeId`, `dstVertexId`, `srcVertexId`, `label`, `etype`
func DstEdgeKeyPrefix ¶
DstEdgeKeyPrefix creates a byte array prefix for a dest edge index entry
func DstEdgeListPrefix ¶
func DstEdgeListPrefix() []byte
DstEdgeListPrefix returns a byte array prefix for all entries in the dest edge index for a graph
func DstEdgePrefix ¶
DstEdgePrefix returns a byte array prefix for all entries in the dest edge index a particular vertex (the dest vertex)
func EdgeKeyParse ¶
EdgeKeyParse takes a edge key and returns the elements encoded in it: `graph`, `edgeID`, `srcVertexId`, `dstVertexId`, `label`
func EdgeKeyPrefix ¶
EdgeKeyPrefix returns the byte array prefix for a particular edge id
func EdgeListPrefix ¶
func EdgeListPrefix() []byte
EdgeListPrefix returns a byte array prefix for all edges in a graph
func GetRawProcessor ¶
func GetRawProcessor(db *Graph, ps gdbi.PipelineState, stmt *gripql.GraphStatement) (gdbi.Processor, error)
func NewCompiler ¶
func NewGraphDB ¶
NewKVGraphDB intitalize a new grids graph driver
func SelectPath ¶
func SelectPath(stmts []*gripql.GraphStatement, path []int) []*gripql.GraphStatement
func SrcEdgeKey ¶
SrcEdgeKey creates a src edge index key
func SrcEdgeKeyParse ¶
SrcEdgeKeyParse takes a src index key entry and parses it into: `graph`, `edgeId`, `srcVertexId`, `dstVertexId`, `label`, `etype`
func SrcEdgeKeyPrefix ¶
SrcEdgeKeyPrefix creates a byte array prefix for a src edge index entry
func SrcEdgeListPrefix ¶
func SrcEdgeListPrefix() []byte
SrcEdgeListPrefix returns a byte array prefix for all entries in the source edge index for a graph
func SrcEdgePrefix ¶
SrcEdgePrefix returns a byte array prefix for all entries in the source edge index a particular vertex (the source vertex)
func VertexKeyParse ¶
VertexKeyParse takes a byte array key and returns: `graphId`, `vertexId`
func VertexListPrefix ¶
func VertexListPrefix() []byte
VertexListPrefix returns a byte array prefix for all vertices in a graph
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
func (Compiler) Compile ¶
func (comp Compiler) Compile(stmts []*gripql.GraphStatement, opts *gdbi.CompileOptions) (gdbi.Pipeline, error)
type GDB ¶
type GDB struct {
// contains filtered or unexported fields
}
GridsGDB implements the GripInterface using a generic key/value storage driver
func (*GDB) BuildSchema ¶
func (ma *GDB) BuildSchema(ctx context.Context, graph string, sampleN uint32, random bool) (*gripql.Graph, error)
BuildSchema returns the schema of a specific graph in the database
func (*GDB) DeleteGraph ¶
DeleteGraph deletes `graph`
func (*GDB) Graph ¶
func (kgraph *GDB) Graph(graph string) (gdbi.GraphInterface, error)
Graph obtains the gdbi.DBI for a particular graph
func (*GDB) ListGraphs ¶
ListGraphs lists the graphs managed by this driver
type GRIDDataElement ¶
type GRIDDataElement struct { Gid uint64 To uint64 From uint64 Label uint64 Data map[string]interface{} Loaded bool }
func DataElementToGRID ¶
func DataElementToGRID(d *gdbi.DataElement, g *Graph) (*GRIDDataElement, error)
func (*GRIDDataElement) Copy ¶
func (rd *GRIDDataElement) Copy() *GRIDDataElement
func (*GRIDDataElement) DataElement ¶
func (rd *GRIDDataElement) DataElement(ggraph *Graph) *gdbi.DataElement
func (*GRIDDataElement) EdgeDataElement ¶
func (rd *GRIDDataElement) EdgeDataElement(ggraph *Graph) *gdbi.Edge
func (*GRIDDataElement) VertexDataElement ¶
func (rd *GRIDDataElement) VertexDataElement(ggraph *Graph) *gdbi.Vertex
type GRIDDataElementID ¶
type GRIDTraveler ¶
type GRIDTraveler struct { Graph *Graph Current *GRIDDataElement Marks map[string]*GRIDDataElement Selections map[string]*GRIDDataElement Aggregation *gdbi.Aggregate Count uint32 Render interface{} Path []GRIDDataElementID Signal *gdbi.Signal }
func NewGRIDTraveler ¶
func NewGRIDTraveler(tr gdbi.Traveler, isVertex bool, gg *Graph) *GRIDTraveler
func (*GRIDTraveler) AddCurrent ¶
func (t *GRIDTraveler) AddCurrent(r *gdbi.DataElement) gdbi.Traveler
AddCurrent creates a new copy of the travel with new 'current' value
func (*GRIDTraveler) AddMark ¶
func (t *GRIDTraveler) AddMark(label string, r *gdbi.DataElement) gdbi.Traveler
AddMark adds a result to travels state map using `label` as the name
func (*GRIDTraveler) AddRawCurrent ¶
func (t *GRIDTraveler) AddRawCurrent(r *GRIDDataElement) *GRIDTraveler
func (*GRIDTraveler) Copy ¶
func (t *GRIDTraveler) Copy() gdbi.Traveler
AddCurrent creates a new copy of the travel with new 'current' value
func (*GRIDTraveler) GRIDCopy ¶
func (t *GRIDTraveler) GRIDCopy() *GRIDTraveler
func (GRIDTraveler) GetAggregation ¶
func (t GRIDTraveler) GetAggregation() *gdbi.Aggregate
func (*GRIDTraveler) GetCount ¶
func (t *GRIDTraveler) GetCount() uint32
func (*GRIDTraveler) GetCurrent ¶
func (t *GRIDTraveler) GetCurrent() *gdbi.DataElement
GetCurrent get current result value attached to the traveler
func (*GRIDTraveler) GetCurrentID ¶
func (t *GRIDTraveler) GetCurrentID() string
func (*GRIDTraveler) GetMark ¶
func (t *GRIDTraveler) GetMark(label string) *gdbi.DataElement
GetMark gets stored result in travels state using its label
func (*GRIDTraveler) GetPath ¶
func (t *GRIDTraveler) GetPath() []gdbi.DataElementID
func (*GRIDTraveler) GetRender ¶
func (t *GRIDTraveler) GetRender() interface{}
func (*GRIDTraveler) GetSelections ¶
func (t *GRIDTraveler) GetSelections() map[string]*gdbi.DataElement
func (*GRIDTraveler) GetSignal ¶
func (tr *GRIDTraveler) GetSignal() gdbi.Signal
func (*GRIDTraveler) HasMark ¶
func (t *GRIDTraveler) HasMark(label string) bool
HasMark checks to see if a results is stored in a travelers statemap
func (*GRIDTraveler) IsNull ¶
func (tr *GRIDTraveler) IsNull() bool
func (*GRIDTraveler) IsSignal ¶
func (tr *GRIDTraveler) IsSignal() bool
func (*GRIDTraveler) ListMarks ¶
func (t *GRIDTraveler) ListMarks() []string
ListMarks returns the list of marks in a travelers statemap
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph implements the GDB interface using a genertic key/value storage driver
func (*Graph) AddEdge ¶
AddEdge adds an edge to the graph, if the id is not "" and in already exists in the graph, it is replaced
func (*Graph) AddVertex ¶
AddVertex adds an edge to the graph, if it already exists in the graph, it is replaced
func (*Graph) AddVertexIndex ¶
AddVertexIndex add index to vertices
func (*Graph) Compiler ¶
Compiler gets a compiler that will use the graph the execute the compiled query
func (*Graph) DeleteVertexIndex ¶
DeleteVertexIndex delete index from vertices
func (*Graph) GetEdgeList ¶
GetEdgeList produces a channel of all edges in the graph
func (*Graph) GetInChannel ¶
func (ggraph *Graph) GetInChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInChannel process requests of vertex ids and find the connected vertices on incoming edges
func (*Graph) GetInEdgeChannel ¶
func (ggraph *Graph) GetInEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetInEdgeChannel process requests of vertex ids and find the connected incoming edges
func (*Graph) GetOutChannel ¶
func (ggraph *Graph) GetOutChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutChannel process requests of vertex ids and find the connected vertices on outgoing edges
func (*Graph) GetOutEdgeChannel ¶
func (ggraph *Graph) GetOutEdgeChannel(ctx context.Context, reqChan chan gdbi.ElementLookup, load bool, emitNull bool, edgeLabels []string) chan gdbi.ElementLookup
GetOutEdgeChannel process requests of vertex ids and find the connected outgoing edges
func (*Graph) GetTimestamp ¶
GetTimestamp returns the update timestamp
func (*Graph) GetVertexChannel ¶
func (ggraph *Graph) GetVertexChannel(ctx context.Context, ids chan gdbi.ElementLookup, load bool) chan gdbi.ElementLookup
GetVertexChannel is passed a channel of vertex ids and it produces a channel of vertices
func (*Graph) GetVertexIndexList ¶
GetVertexIndexList lists out all the vertex indices for a graph
func (*Graph) GetVertexList ¶
GetVertexList produces a channel of all edges in the graph
func (*Graph) ListEdgeLabels ¶
ListEdgeLabels returns a list of edge types in the graph
func (*Graph) ListVertexLabels ¶
ListVertexLabels returns a list of vertex types in the graph
func (*Graph) RawGetEdgeList ¶
func (ggraph *Graph) RawGetEdgeList(ctx context.Context) <-chan *GRIDDataElement
func (*Graph) RawGetInChannel ¶
func (ggraph *Graph) RawGetInChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
func (*Graph) RawGetInEdgeChannel ¶
func (ggraph *Graph) RawGetInEdgeChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
func (*Graph) RawGetOutChannel ¶
func (ggraph *Graph) RawGetOutChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
func (*Graph) RawGetOutEdgeChannel ¶
func (ggraph *Graph) RawGetOutEdgeChannel(reqChan chan *RawElementLookup, edgeLabels []string) chan *RawElementLookup
func (*Graph) RawGetVertexChannel ¶
func (ggraph *Graph) RawGetVertexChannel(reqChan chan *RawElementLookup) <-chan *RawElementLookup
func (*Graph) RawGetVertexList ¶
func (ggraph *Graph) RawGetVertexList(ctx context.Context) <-chan *GRIDDataElement
type KeyMap ¶
type KeyMap struct {
// contains filtered or unexported fields
}
func (*KeyMap) GetEdgeKey ¶
GetEdgeKey gets the uint64 key for a given GID string
func (*KeyMap) GetEdgeLabel ¶
func (*KeyMap) GetLabelID ¶
GetLabelID gets the GID for a given uint64 label key
func (*KeyMap) GetVertexLabel ¶
func (*KeyMap) GetsertEdgeKey ¶
GetsertEdgeKey gets or inserts a new uint64 id for a given edge GID string
func (*KeyMap) GetsertLabelKey ¶
GetsertLabelKey gets-or-inserts a new label key uint64 for a given string
type PathInEProc ¶
type PathInEProc struct {
// contains filtered or unexported fields
}
type PathInEdgeAdjProc ¶
type PathInEdgeAdjProc struct {
// contains filtered or unexported fields
}
type PathInProc ¶
type PathInProc struct {
// contains filtered or unexported fields
}
type PathLabelProc ¶
type PathLabelProc struct {
// contains filtered or unexported fields
}
type PathOutEProc ¶
type PathOutEProc struct {
// contains filtered or unexported fields
}
type PathOutEdgeAdjProc ¶
type PathOutEdgeAdjProc struct {
// contains filtered or unexported fields
}
PathOutAdjEProc process edge to out
type PathOutProc ¶
type PathOutProc struct {
// contains filtered or unexported fields
}
type RawElementLookup ¶
type RawElementLookup struct { ID uint64 Ref *GRIDTraveler Element *GRIDDataElement }
ElementLookup request to look up data
func (*RawElementLookup) IsSignal ¶
func (rel *RawElementLookup) IsSignal() bool