Documentation ¶
Index ¶
- Constants
- Variables
- func GetCleanTempDb(envId m3db.QsmEnvID) *m3db.QsmEnvironment
- func GetFullTestDb(envId m3db.QsmEnvID) *m3db.QsmEnvironment
- func InitializeDBEnv(env *m3db.QsmEnvironment)
- func RunInsertRandomPoints()
- type ConnectionState
- type ErrorType
- type OpenNodeBuilder
- type PathContext
- type PathContextDb
- func (pathCtx *PathContextDb) CountAllPathNodes() int
- func (pathCtx *PathContextDb) GetAllOpenPathNodes() []PathNode
- func (pathCtx *PathContextDb) GetGrowthCtx() m3point.GrowthContext
- func (pathCtx *PathContextDb) GetGrowthIndex() int
- func (pathCtx *PathContextDb) GetGrowthOffset() int
- func (pathCtx *PathContextDb) GetGrowthType() m3point.GrowthType
- func (pathCtx *PathContextDb) GetId() int
- func (pathCtx *PathContextDb) GetNumberOfOpenNodes() int
- func (pathCtx *PathContextDb) GetPathNodeMap() PathNodeMap
- func (pathCtx *PathContextDb) GetRootPathNode() PathNode
- func (pathCtx *PathContextDb) InitRootNode(center m3point.Point)
- func (pathCtx *PathContextDb) MoveToNextNodes()
- func (pathCtx *PathContextDb) PredictedNextOpenNodesLen() int
- func (pathCtx *PathContextDb) String() string
- type PathNode
- type PathNodeDb
- func (pn *PathNodeDb) D() int
- func (pn *PathNodeDb) GetId() int64
- func (pn *PathNodeDb) GetNext(connIdx int) int64
- func (pn *PathNodeDb) GetNextConnection(connId m3point.ConnectionId) int64
- func (pn *PathNodeDb) GetPathContext() PathContext
- func (pn *PathNodeDb) GetTrioDetails() *m3point.TrioDetails
- func (pn *PathNodeDb) GetTrioIndex() m3point.TrioIndex
- func (pn *PathNodeDb) HasOpenConnections() bool
- func (pn *PathNodeDb) IsDeadEnd(connIdx int) bool
- func (pn *PathNodeDb) IsFrom(connIdx int) bool
- func (pn *PathNodeDb) IsInPool() bool
- func (pn *PathNodeDb) IsLatest() bool
- func (pn *PathNodeDb) IsNew() bool
- func (pn *PathNodeDb) IsNext(connIdx int) bool
- func (pn *PathNodeDb) IsRoot() bool
- func (pn *PathNodeDb) P() m3point.Point
- func (pn *PathNodeDb) PathBuilder() m3point.PathNodeBuilder
- func (pn *PathNodeDb) PathCtx() *PathContextDb
- func (pn *PathNodeDb) SetPathBuilder(pathBuilder m3point.PathNodeBuilder)
- func (pn *PathNodeDb) SetPathCtx(pathCtx *PathContextDb)
- func (pn *PathNodeDb) SetTrioDetails(trioDetails *m3point.TrioDetails)
- func (pn *PathNodeDb) SetTrioId(trioId m3point.TrioIndex)
- func (pn *PathNodeDb) String() string
- type PathNodeDbState
- type PathNodeMap
- type PathPackData
- type PointHashPathNodeMap
- func (hnm *PointHashPathNodeMap) AddPathNode(pathNode PathNode) (PathNode, bool)
- func (hnm *PointHashPathNodeMap) Clear()
- func (hnm *PointHashPathNodeMap) GetPathNode(p m3point.Point) PathNode
- func (*PointHashPathNodeMap) IsActive(pathNode PathNode) bool
- func (hnm *PointHashPathNodeMap) Range(f func(point m3point.Point, pn PathNode) bool, nbProc int)
- func (hnm *PointHashPathNodeMap) Size() int
- type QsmModelError
- type SimplePathNodeMap
- func (pnm *SimplePathNodeMap) AddPathNode(pathNode PathNode) (PathNode, bool)
- func (pnm *SimplePathNodeMap) Clear()
- func (pnm *SimplePathNodeMap) GetPathNode(p m3point.Point) PathNode
- func (pnm *SimplePathNodeMap) IsActive(pathNode PathNode) bool
- func (pnm *SimplePathNodeMap) Range(f func(point m3point.Point, pn PathNode) bool, nbProc int)
- func (pnm *SimplePathNodeMap) Size() int
Constants ¶
View Source
const ( PointsTable = "points" PathContextsTable = "path_contexts" PathNodesTable = "path_nodes" )
View Source
const ( FindPointIdPerCoord = 0 SelectPointPerId = 1 )
View Source
const ( SelectPathContextById = 0 UpdatePathBuilderId = 1 )
View Source
const ( SelectPathNodesById int = iota UpdatePathNode SelectPathNodesByCtxAndDistance PathNodeIdsBefore ConnectedPathNodeIds CountPathNodesByCtx SelectPathNodeIdByCtxAndPointId SelectPathNodesByPoint )
View Source
const ( ConnectionMaskBits = 4 ConnectionStateMask = uint16(0x0003) SingleConnectionMask = uint16(0x000F) NbConnections = 3 )
Variables ¶
View Source
var Log = m3util.NewLogger("m3path", m3util.INFO)
Functions ¶
func GetCleanTempDb ¶
func GetCleanTempDb(envId m3db.QsmEnvID) *m3db.QsmEnvironment
func GetFullTestDb ¶
func GetFullTestDb(envId m3db.QsmEnvID) *m3db.QsmEnvironment
func InitializeDBEnv ¶
func InitializeDBEnv(env *m3db.QsmEnvironment)
func RunInsertRandomPoints ¶
func RunInsertRandomPoints()
************************************************************* perf test main *************************************************************
Types ¶
type ConnectionState ¶
type ConnectionState uint16
const ( ConnectionNotSet ConnectionState = 0x0000 ConnectionFrom ConnectionState = 0x0001 ConnectionNext ConnectionState = 0x0002 ConnectionBlocked ConnectionState = 0x0003 )
type OpenNodeBuilder ¶
type OpenNodeBuilder struct {
// contains filtered or unexported fields
}
type PathContext ¶
type PathContext interface { fmt.Stringer GetId() int GetGrowthCtx() m3point.GrowthContext GetGrowthOffset() int GetGrowthType() m3point.GrowthType GetGrowthIndex() int GetPathNodeMap() PathNodeMap CountAllPathNodes() int InitRootNode(center m3point.Point) GetRootPathNode() PathNode GetNumberOfOpenNodes() int GetAllOpenPathNodes() []PathNode MoveToNextNodes() PredictedNextOpenNodesLen() int // contains filtered or unexported methods }
func MakePathContextDBFromGrowthContext ¶
func MakePathContextDBFromGrowthContext(env *m3db.QsmEnvironment, growthCtx m3point.GrowthContext, offset int) PathContext
type PathContextDb ¶
type PathContextDb struct {
// contains filtered or unexported fields
}
func (*PathContextDb) CountAllPathNodes ¶
func (pathCtx *PathContextDb) CountAllPathNodes() int
func (*PathContextDb) GetAllOpenPathNodes ¶
func (pathCtx *PathContextDb) GetAllOpenPathNodes() []PathNode
TODO: Remove the need for this
func (*PathContextDb) GetGrowthCtx ¶
func (pathCtx *PathContextDb) GetGrowthCtx() m3point.GrowthContext
func (*PathContextDb) GetGrowthIndex ¶
func (pathCtx *PathContextDb) GetGrowthIndex() int
func (*PathContextDb) GetGrowthOffset ¶
func (pathCtx *PathContextDb) GetGrowthOffset() int
func (*PathContextDb) GetGrowthType ¶
func (pathCtx *PathContextDb) GetGrowthType() m3point.GrowthType
func (*PathContextDb) GetId ¶
func (pathCtx *PathContextDb) GetId() int
func (*PathContextDb) GetNumberOfOpenNodes ¶
func (pathCtx *PathContextDb) GetNumberOfOpenNodes() int
func (*PathContextDb) GetPathNodeMap ¶
func (pathCtx *PathContextDb) GetPathNodeMap() PathNodeMap
func (*PathContextDb) GetRootPathNode ¶
func (pathCtx *PathContextDb) GetRootPathNode() PathNode
func (*PathContextDb) InitRootNode ¶
func (pathCtx *PathContextDb) InitRootNode(center m3point.Point)
func (*PathContextDb) MoveToNextNodes ¶
func (pathCtx *PathContextDb) MoveToNextNodes()
func (*PathContextDb) PredictedNextOpenNodesLen ¶
func (pathCtx *PathContextDb) PredictedNextOpenNodesLen() int
func (*PathContextDb) String ¶
func (pathCtx *PathContextDb) String() string
type PathNode ¶
type PathNode interface { fmt.Stringer GetId() int64 GetPathContext() PathContext IsRoot() bool IsLatest() bool P() m3point.Point D() int GetTrioIndex() m3point.TrioIndex HasOpenConnections() bool IsFrom(connIdx int) bool IsNext(connIdx int) bool IsDeadEnd(connIdx int) bool GetTrioDetails() *m3point.TrioDetails }
type PathNodeDb ¶
type PathNodeDb struct {
// contains filtered or unexported fields
}
func (*PathNodeDb) D ¶
func (pn *PathNodeDb) D() int
func (*PathNodeDb) GetId ¶
func (pn *PathNodeDb) GetId() int64
func (*PathNodeDb) GetNext ¶
func (pn *PathNodeDb) GetNext(connIdx int) int64
func (*PathNodeDb) GetNextConnection ¶
func (pn *PathNodeDb) GetNextConnection(connId m3point.ConnectionId) int64
func (*PathNodeDb) GetPathContext ¶
func (pn *PathNodeDb) GetPathContext() PathContext
func (*PathNodeDb) GetTrioDetails ¶
func (pn *PathNodeDb) GetTrioDetails() *m3point.TrioDetails
func (*PathNodeDb) GetTrioIndex ¶
func (pn *PathNodeDb) GetTrioIndex() m3point.TrioIndex
func (*PathNodeDb) HasOpenConnections ¶
func (pn *PathNodeDb) HasOpenConnections() bool
func (*PathNodeDb) IsDeadEnd ¶
func (pn *PathNodeDb) IsDeadEnd(connIdx int) bool
func (*PathNodeDb) IsFrom ¶
func (pn *PathNodeDb) IsFrom(connIdx int) bool
func (*PathNodeDb) IsInPool ¶
func (pn *PathNodeDb) IsInPool() bool
func (*PathNodeDb) IsLatest ¶
func (pn *PathNodeDb) IsLatest() bool
func (*PathNodeDb) IsNew ¶
func (pn *PathNodeDb) IsNew() bool
func (*PathNodeDb) IsNext ¶
func (pn *PathNodeDb) IsNext(connIdx int) bool
func (*PathNodeDb) IsRoot ¶
func (pn *PathNodeDb) IsRoot() bool
func (*PathNodeDb) P ¶
func (pn *PathNodeDb) P() m3point.Point
func (*PathNodeDb) PathBuilder ¶
func (pn *PathNodeDb) PathBuilder() m3point.PathNodeBuilder
func (*PathNodeDb) PathCtx ¶
func (pn *PathNodeDb) PathCtx() *PathContextDb
func (*PathNodeDb) SetPathBuilder ¶
func (pn *PathNodeDb) SetPathBuilder(pathBuilder m3point.PathNodeBuilder)
func (*PathNodeDb) SetPathCtx ¶
func (pn *PathNodeDb) SetPathCtx(pathCtx *PathContextDb)
func (*PathNodeDb) SetTrioDetails ¶
func (pn *PathNodeDb) SetTrioDetails(trioDetails *m3point.TrioDetails)
func (*PathNodeDb) SetTrioId ¶
func (pn *PathNodeDb) SetTrioId(trioId m3point.TrioIndex)
func (*PathNodeDb) String ¶
func (pn *PathNodeDb) String() string
type PathNodeDbState ¶
type PathNodeDbState int16
const ( NewPathNode PathNodeDbState = iota InPoolNode SyncInDbPathNode InConflictNode ModifiedNode )
type PathNodeMap ¶
type PathNodeMap interface { Size() int GetPathNode(p m3point.Point) PathNode AddPathNode(pathNode PathNode) (PathNode, bool) IsActive(pathNode PathNode) bool Clear() Range(f func(point m3point.Point, pn PathNode) bool, nbProc int) }
func MakeHashPathNodeMap ¶
func MakeHashPathNodeMap(initSize int) PathNodeMap
func MakeSimplePathNodeMap ¶
func MakeSimplePathNodeMap(initSize int) PathNodeMap
type PathPackData ¶
type PathPackData struct {
// contains filtered or unexported fields
}
func GetPathPackData ¶
func GetPathPackData(env *m3db.QsmEnvironment) *PathPackData
func (*PathPackData) GetPathCtx ¶
func (ppd *PathPackData) GetPathCtx(id int) PathContext
type PointHashPathNodeMap ¶
type PointHashPathNodeMap struct {
// contains filtered or unexported fields
}
func (*PointHashPathNodeMap) AddPathNode ¶
func (hnm *PointHashPathNodeMap) AddPathNode(pathNode PathNode) (PathNode, bool)
func (*PointHashPathNodeMap) Clear ¶
func (hnm *PointHashPathNodeMap) Clear()
func (*PointHashPathNodeMap) GetPathNode ¶
func (hnm *PointHashPathNodeMap) GetPathNode(p m3point.Point) PathNode
func (*PointHashPathNodeMap) IsActive ¶
func (*PointHashPathNodeMap) IsActive(pathNode PathNode) bool
func (*PointHashPathNodeMap) Size ¶
func (hnm *PointHashPathNodeMap) Size() int
type QsmModelError ¶
type QsmModelError struct {
// contains filtered or unexported fields
}
func MakeQsmModelErrorf ¶
func MakeQsmModelErrorf(errType ErrorType, format string, args ...interface{}) *QsmModelError
func (*QsmModelError) Error ¶
func (err *QsmModelError) Error() string
type SimplePathNodeMap ¶
func (*SimplePathNodeMap) AddPathNode ¶
func (pnm *SimplePathNodeMap) AddPathNode(pathNode PathNode) (PathNode, bool)
func (*SimplePathNodeMap) Clear ¶
func (pnm *SimplePathNodeMap) Clear()
func (*SimplePathNodeMap) GetPathNode ¶
func (pnm *SimplePathNodeMap) GetPathNode(p m3point.Point) PathNode
func (*SimplePathNodeMap) IsActive ¶
func (pnm *SimplePathNodeMap) IsActive(pathNode PathNode) bool
func (*SimplePathNodeMap) Size ¶
func (pnm *SimplePathNodeMap) Size() int
Click to show internal directories.
Click to hide internal directories.