Documentation ¶
Overview ¶
Package planner is a generated protocol buffer package.
It is generated from these files:
msgs.proto
It has these top-level messages:
Message TaskResponse SqlTask
Index ¶
- Variables
- func LeaderCreate(client *grid.Client) grid.MakeActor
- func NextId() (uint64, error)
- func NextIdUnsafe() uint64
- func NodeName(id uint64) string
- func NodeName2(id1, id2 uint64) string
- func WorkerFactory(conf *Conf, client *grid.Client, server *grid.Server) grid.MakeActor
- type Conf
- type ExecutorGrid
- func (m *ExecutorGrid) Finalize(resultWriter exec.Task) error
- func (m *ExecutorGrid) WalkGroupBy(p *plan.GroupBy) (exec.Task, error)
- func (m *ExecutorGrid) WalkSelect(p *plan.Select) (exec.Task, error)
- func (m *ExecutorGrid) WalkSelectPartition(p *plan.Select, part *schema.Partition) (exec.Task, error)
- func (m *ExecutorGrid) WalkSource(p *plan.Source) (exec.Task, error)
- type JobMaker
- type LeaderActor
- type Message
- type NewPeer
- type PlannerGrid
- type Sink
- type SinkSend
- type Source
- type SqlActor
- type SqlTask
- func (*SqlTask) Descriptor() ([]byte, []int)
- func (m *SqlTask) GetActorCount() int32
- func (m *SqlTask) GetId() string
- func (m *SqlTask) GetMaster() string
- func (m *SqlTask) GetPartition() string
- func (m *SqlTask) GetPb() []byte
- func (m *SqlTask) GetSource() string
- func (*SqlTask) ProtoMessage()
- func (m *SqlTask) Reset()
- func (m *SqlTask) String() string
- type TaskResponse
Constants ¶
This section is empty.
Variables ¶
var ( // States Starting = dfa.State("starting") Running = dfa.State("running") Exiting = dfa.State("exiting") // Letters Failure = dfa.Letter("failure") Started = dfa.Letter("started") Finished = dfa.Letter("finished") Exit = dfa.Letter("exit") )
var ( // BuiltIn Default Conf, used for testing but real runtime swaps this out // for a real config GridConf = &Conf{ GridName: "dataux", Address: "localhost:0", EtcdServers: strings.Split("http://127.0.0.1:2379", ","), } )
Functions ¶
func LeaderCreate ¶
LeaderCreate factory function to create the Leader
func NextIdUnsafe ¶
func NextIdUnsafe() uint64
Types ¶
type Conf ¶
type ExecutorGrid ¶
type ExecutorGrid struct { *exec.JobExecutor GridServer *PlannerGrid // contains filtered or unexported fields }
Sql job that wraps the generic qlbridge job builder
- contains ref to the shared GridServer which has info to distribute tasks across servers
func BuildExecutorUnPlanned ¶
func BuildExecutorUnPlanned(ctx *plan.Context, pg *PlannerGrid) (*ExecutorGrid, error)
Build a Sql Job which has already been planned so this is just execution runner
func BuildSqlJob ¶
func BuildSqlJob(ctx *plan.Context, pg *PlannerGrid) (*ExecutorGrid, error)
Build a Sql Job which may be a Grid/Distributed job
func (*ExecutorGrid) Finalize ¶
func (m *ExecutorGrid) Finalize(resultWriter exec.Task) error
Finalize is after the Dag of Relational-algebra tasks have been assembled
and just before we run them.
func (*ExecutorGrid) WalkGroupBy ¶
func (m *ExecutorGrid) WalkProjection(p *plan.Projection) (exec.Task, error) { u.Debugf("%p Walk Projection sp:%+v", m, m.sp) return exec.NewProjection(m.Ctx, p), nil }
func (*ExecutorGrid) WalkSelect ¶
func (*ExecutorGrid) WalkSelectPartition ¶
func (m *ExecutorGrid) WalkSelectPartition(p *plan.Select, part *schema.Partition) (exec.Task, error)
WalkSelectPartition is ONLY called by child-dag's, ie the remote end of a distributed
sql query, to allow setup before walking
func (*ExecutorGrid) WalkSource ¶
type LeaderActor ¶
type LeaderActor struct {
// contains filtered or unexported fields
}
LeaderActor is the scheduler to create and watch the workers.
func (*LeaderActor) Act ¶
func (a *LeaderActor) Act(ctx context.Context)
Act checks for peers, ie: other processes running this code, in the same namespace and start the sqlworker actor on each of them.
type Message ¶
type Message struct { Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"` Msg []byte `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` }
func (*Message) Descriptor ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type PlannerGrid ¶
type PlannerGrid struct { Conf *Conf GridServer *grid.Server // contains filtered or unexported fields }
PlannerGrid Is a singleton service context per process that manages access to registry, and other singleton resources. It starts the workers, grid processes, watch to ensure it knows about the rest of the peers in the system.
func NewPlannerGrid ¶
func NewPlannerGrid(nodeCt int, r *datasource.Registry) *PlannerGrid
func (*PlannerGrid) CheckinMailbox ¶
func (m *PlannerGrid) CheckinMailbox(mb *grid.Mailbox)
CheckinMailbox return mailbox
func (*PlannerGrid) GetMailbox ¶
func (m *PlannerGrid) GetMailbox() (*grid.Mailbox, error)
GetMailbox get next available mailbox, throttled
func (*PlannerGrid) Run ¶
func (m *PlannerGrid) Run(quit chan bool) error
type Sink ¶
Sink task that receives messages that optionally may have been hashed to be sent via nats to a nats source consumer.
taska-1 -> hash-key -> sink--> \ / --> source --> \ / --> grid --> / \ taska-2 -> hash-key -> sink--> / \ --> source -->
func (*Sink) CloseFinal ¶
CloseFinal after shutdown cleanup the rest of channels
type SinkSend ¶
type SinkSend func(msg interface{}) (interface{}, error)
SinkSend is func to mock the Grid Client Request
type Source ¶
Source task is injected into a SQL dag task pipeline in order to recieve messages from another server via Grid Mailbox, for distribution across multiple workers. These messages optionally may have been hash routed to this node, ie partition-key routed.
taska-1 -> hash-sink \ / --> source --> \ / --route-by-key--> --> source --> / \ taska-2 -> hash-sink / \ --> source -->
func NewSource ¶
Source, the plan already provided info to the nats listener about which key/topic to listen to, Planner holds routing info not here.
func (*Source) CloseFinal ¶
CloseFinal after exit, cleanup some more
type SqlActor ¶
type SqlActor struct {
// contains filtered or unexported fields
}
SqlActor a worker/actor that runs in distributed grid nodes and receives messages from the planner to fulfill parts of sql dag of tasks in order to complete a query.
type SqlTask ¶
type SqlTask struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Pb []byte `protobuf:"bytes,2,opt,name=pb,proto3" json:"pb,omitempty"` Partition string `protobuf:"bytes,3,opt,name=partition" json:"partition,omitempty"` Source string `protobuf:"bytes,4,opt,name=source" json:"source,omitempty"` ActorCount int32 `protobuf:"varint,5,opt,name=actorCount" json:"actorCount,omitempty"` // The name of the mailbox that contains // the master task process to send results to Master string `protobuf:"bytes,6,opt,name=master" json:"master,omitempty"` }
func (*SqlTask) Descriptor ¶
func (*SqlTask) GetActorCount ¶
func (*SqlTask) GetPartition ¶
func (*SqlTask) ProtoMessage ¶
func (*SqlTask) ProtoMessage()
type TaskResponse ¶
type TaskResponse struct { Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` }
func (*TaskResponse) Descriptor ¶
func (*TaskResponse) Descriptor() ([]byte, []int)
func (*TaskResponse) GetId ¶
func (m *TaskResponse) GetId() string
func (*TaskResponse) GetMsg ¶
func (m *TaskResponse) GetMsg() string
func (*TaskResponse) ProtoMessage ¶
func (*TaskResponse) ProtoMessage()
func (*TaskResponse) Reset ¶
func (m *TaskResponse) Reset()
func (*TaskResponse) String ¶
func (m *TaskResponse) String() string