cockroach: Index | Files

package distsql

import ""


Package Files



const MultiTenancyIssueNo = 47900

MultiTenancyIssueNo is the issue tracking DistSQL's Gossip and NodeID dependencies.


func FlowVerIsCompatible Uses

func FlowVerIsCompatible(
    flowVer, minAcceptedVersion, serverVersion execinfrapb.DistSQLVersion,
) bool

FlowVerIsCompatible checks a flow's version is compatible with this node's DistSQL version.

type LocalState Uses

type LocalState struct {
    EvalContext *tree.EvalContext

    // Collection is set if this flow is running on the gateway as part of user
    // SQL session. It is the current descs.Collection of the planner executing
    // the flow.
    Collection *descs.Collection

    // IsLocal is set if the flow is running on the gateway and there are no
    // remote flows.
    IsLocal bool

    // Txn is filled in on the gateway only. It is the RootTxn that the query is running in.
    // This will be used directly by the flow if the flow has no concurrency and IsLocal is set.
    // If there is concurrency, a LeafTxn will be created.
    Txn *kv.Txn

    // LocalProcs is an array of planNodeToRowSource processors. It's in order and
    // will be indexed into by the RowSourceIdx field in LocalPlanNodeSpec.
    LocalProcs []execinfra.LocalProcessor

LocalState carries information that is required to set up a flow with wrapped planNodes.

type ServerImpl Uses

type ServerImpl struct {
    // contains filtered or unexported fields

ServerImpl implements the server for the distributed SQL APIs.

func NewServer Uses

func NewServer(ctx context.Context, cfg execinfra.ServerConfig) *ServerImpl

NewServer instantiates a DistSQLServer.

func (*ServerImpl) Drain Uses

func (ds *ServerImpl) Drain(
    ctx context.Context, flowDrainWait time.Duration, reporter func(int, string),

Drain changes the node's draining state through gossip and drains the server's flowRegistry. See flowRegistry.Drain for more details.

func (*ServerImpl) FlowStream Uses

func (ds *ServerImpl) FlowStream(stream execinfrapb.DistSQL_FlowStreamServer) error

FlowStream is part of the DistSQLServer interface.

func (*ServerImpl) NewFlowContext Uses

func (ds *ServerImpl) NewFlowContext(
    id execinfrapb.FlowID, evalCtx *tree.EvalContext, traceKV bool, localState LocalState,
) execinfra.FlowCtx

NewFlowContext creates a new FlowCtx that can be used during execution of a flow.

func (*ServerImpl) RunSyncFlow Uses

func (ds *ServerImpl) RunSyncFlow(stream execinfrapb.DistSQL_RunSyncFlowServer) error

RunSyncFlow is part of the DistSQLServer interface.

func (*ServerImpl) SetupFlow Uses

func (ds *ServerImpl) SetupFlow(
    ctx context.Context, req *execinfrapb.SetupFlowRequest,
) (*execinfrapb.SimpleResponse, error)

SetupFlow is part of the DistSQLServer interface.

func (*ServerImpl) SetupLocalSyncFlow Uses

func (ds *ServerImpl) SetupLocalSyncFlow(
    ctx context.Context,
    parentMonitor *mon.BytesMonitor,
    req *execinfrapb.SetupFlowRequest,
    output execinfra.RowReceiver,
    localState LocalState,
) (context.Context, flowinfra.Flow, error)

SetupLocalSyncFlow sets up a synchronous flow on the current (planning) node. It's used by the gateway node to set up the flows local to it. It's the same as SetupSyncFlow except it takes the localState.

func (*ServerImpl) SetupSyncFlow Uses

func (ds *ServerImpl) SetupSyncFlow(
    ctx context.Context,
    parentMonitor *mon.BytesMonitor,
    req *execinfrapb.SetupFlowRequest,
    output execinfra.RowReceiver,
) (context.Context, flowinfra.Flow, error)

SetupSyncFlow sets up a synchronous flow, connecting the sync response output stream to the given RowReceiver. The flow is not started. The flow will be associated with the given context. Note: the returned context contains a span that must be finished through Flow.Cleanup.

func (*ServerImpl) Start Uses

func (ds *ServerImpl) Start()

Start launches workers for the server.

Package distsql imports 30 packages (graph) and is imported by 11 packages. Updated 2020-08-12. Refresh now. Tools for package owners.