Documentation ¶
Index ¶
- func ConvertAntToString(pb *types.Any) (string, error)
- func ConvertAnyToUint32(pb *types.Any) (uint32, error)
- func ConvertStringToAny(val interface{}) (*types.Any, error)
- func ConvertUint32ToAny(val interface{}) (*types.Any, error)
- func HashPartition(id VertexID, nrOfPartitions uint64) (uint64, error)
- type AggregatableValue
- type Aggregator
- type ComputeContext
- type Message
- type Plugin
- type Vertex
- type VertexID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAntToString ¶
ConvertAntToString converts any to string
func ConvertAnyToUint32 ¶
ConvertAnyToUint32 converts any to uint32
func ConvertStringToAny ¶
ConvertStringToAny converts string to any
func ConvertUint32ToAny ¶
ConvertUint32ToAny converts interface as a uint32 to any
Types ¶
type AggregatableValue ¶
type AggregatableValue interface{}
AggregatableValue is value to be aggregated by aggregator
type Aggregator ¶
type Aggregator interface { Name() string Aggregate(v1 AggregatableValue, v2 AggregatableValue) (AggregatableValue, error) MarshalValue(v AggregatableValue) (*types.Any, error) UnmarshalValue(pb *types.Any) (AggregatableValue, error) ToString(v AggregatableValue) string }
Aggregator is Pregel aggregator implemented by user
type ComputeContext ¶
type ComputeContext interface { SuperStep() uint64 ReceivedMessages() []Message SendMessageTo(dest VertexID, m Message) error VoteToHalt() GetAggregated(aggregatorName string) (AggregatableValue, bool, error) PutAggregatable(aggregatorName string, v AggregatableValue) error }
ComputeContext provides information for vertices to process Compute()
type Message ¶
type Message interface{}
Message is a message sent from the vertex to another vertex during super-step.
type Plugin ¶
type Plugin interface { // TODO: either NewVertex() or NewPartitionVertices() is enough // TODO: improve to load vertices. each vertex loading should be concurrently NewVertex(id VertexID) (Vertex, error) NewPartitionVertices(partitionID uint64, numOfPartitions uint64, register func(v Vertex)) error Partition(vertex VertexID, numOfPartitions uint64) (uint64, error) MarshalMessage(msg Message) (*types.Any, error) UnmarshalMessage(pb *types.Any) (Message, error) GetCombiner() func(destination VertexID, messages []Message) ([]Message, error) GetAggregators() []Aggregator }
Plugin provides an implementation of particular graph computation.
Click to show internal directories.
Click to hide internal directories.