distsql

package
v0.0.0-...-1247558 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2016 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package distsql is a generated protocol buffer package.

It is generated from these files:

cockroach/sql/distsql/api.proto
cockroach/sql/distsql/data.proto

It has these top-level messages:

SetupFlowsRequest
SetupFlowsResponse
Expression
TableReaderSpan
TableReaderSpec
StreamEndpointSpec
OutputRouterSpec
ProcessorCoreUnion
ProcessorSpec
FlowSpec

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowApi   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthData = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowData   = fmt.Errorf("proto: integer overflow")
)
View Source
var OutputRouterSpec_Type_name = map[int32]string{
	0: "MIRROR",
	1: "BY_HASH",
	2: "BY_RANGE",
}
View Source
var OutputRouterSpec_Type_value = map[string]int32{
	"MIRROR":   0,
	"BY_HASH":  1,
	"BY_RANGE": 2,
}
View Source
var StreamEndpointSpec_Type_name = map[int32]string{
	0: "LOCAL",
	1: "REMOTE",
	2: "RPC_SYNC_RESP",
}
View Source
var StreamEndpointSpec_Type_value = map[string]int32{
	"LOCAL":         0,
	"REMOTE":        1,
	"RPC_SYNC_RESP": 2,
}

Functions

func RegisterDistSQLServer

func RegisterDistSQLServer(s *grpc.Server, srv DistSQLServer)

Types

type DistSQLClient

type DistSQLClient interface {
	// SetupFlows instantiates a set of flows (subgraphs of a distributed SQL
	// computation) on the receiving node.
	SetupFlows(ctx context.Context, in *SetupFlowsRequest, opts ...grpc.CallOption) (*SetupFlowsResponse, error)
}

func NewDistSQLClient

func NewDistSQLClient(cc *grpc.ClientConn) DistSQLClient

type DistSQLServer

type DistSQLServer interface {
	// SetupFlows instantiates a set of flows (subgraphs of a distributed SQL
	// computation) on the receiving node.
	SetupFlows(context.Context, *SetupFlowsRequest) (*SetupFlowsResponse, error)
}

type Expression

type Expression struct {
	// TODO(radu): TBD how this will be used
	Version string `protobuf:"bytes,1,opt,name=version" json:"version"`
	// SQL expressions are passed as a string, with ValArgs ($0, $1, ..) used for
	// "input" variables.
	Expr string `protobuf:"bytes,2,opt,name=expr" json:"expr"`
}

func (*Expression) Descriptor

func (*Expression) Descriptor() ([]byte, []int)

func (*Expression) Marshal

func (m *Expression) Marshal() (data []byte, err error)

func (*Expression) MarshalTo

func (m *Expression) MarshalTo(data []byte) (int, error)

func (*Expression) ProtoMessage

func (*Expression) ProtoMessage()

func (*Expression) Reset

func (m *Expression) Reset()

func (*Expression) Size

func (m *Expression) Size() (n int)

func (*Expression) String

func (m *Expression) String() string

func (*Expression) Unmarshal

func (m *Expression) Unmarshal(data []byte) error

type FlowSpec

type FlowSpec struct {
	Processors []ProcessorSpec `protobuf:"bytes,1,rep,name=processors" json:"processors"`
}

FlowSpec describes a "flow" which is a subgraph of a distributed SQL computation consisting of processors and streams.

func (*FlowSpec) Descriptor

func (*FlowSpec) Descriptor() ([]byte, []int)

func (*FlowSpec) Marshal

func (m *FlowSpec) Marshal() (data []byte, err error)

func (*FlowSpec) MarshalTo

func (m *FlowSpec) MarshalTo(data []byte) (int, error)

func (*FlowSpec) ProtoMessage

func (*FlowSpec) ProtoMessage()

func (*FlowSpec) Reset

func (m *FlowSpec) Reset()

func (*FlowSpec) Size

func (m *FlowSpec) Size() (n int)

func (*FlowSpec) String

func (m *FlowSpec) String() string

func (*FlowSpec) Unmarshal

func (m *FlowSpec) Unmarshal(data []byte) error

type OutputRouterSpec

type OutputRouterSpec struct {
	Type    OutputRouterSpec_Type `protobuf:"varint,1,opt,name=type,enum=cockroach.sql.distsql.OutputRouterSpec_Type" json:"type"`
	Streams []StreamEndpointSpec  `protobuf:"bytes,2,rep,name=streams" json:"streams"`
}

OutputRouterSpec is the specification for the output router of a processor; it decides how to send results to multiple output streams.

func (*OutputRouterSpec) Descriptor

func (*OutputRouterSpec) Descriptor() ([]byte, []int)

func (*OutputRouterSpec) Marshal

func (m *OutputRouterSpec) Marshal() (data []byte, err error)

func (*OutputRouterSpec) MarshalTo

func (m *OutputRouterSpec) MarshalTo(data []byte) (int, error)

func (*OutputRouterSpec) ProtoMessage

func (*OutputRouterSpec) ProtoMessage()

func (*OutputRouterSpec) Reset

func (m *OutputRouterSpec) Reset()

func (*OutputRouterSpec) Size

func (m *OutputRouterSpec) Size() (n int)

func (*OutputRouterSpec) String

func (m *OutputRouterSpec) String() string

func (*OutputRouterSpec) Unmarshal

func (m *OutputRouterSpec) Unmarshal(data []byte) error

type OutputRouterSpec_Type

type OutputRouterSpec_Type int32
const (
	// Each row is sent to all output streams (also used if there is a
	// single output stream).
	OutputRouterSpec_MIRROR OutputRouterSpec_Type = 0
	// Each row is sent to one stream, chosen by hashing certain columns of
	// the row. TODO(radu): an extra optional structure below for the hashing
	// details.
	OutputRouterSpec_BY_HASH OutputRouterSpec_Type = 1
	// Each row is sent to one stream, chosen according to preset boundaries
	// for the values of certain columns of the row. TODO(radu): an extra
	// optional structure below for the range details.
	OutputRouterSpec_BY_RANGE OutputRouterSpec_Type = 2
)

func (OutputRouterSpec_Type) Enum

func (OutputRouterSpec_Type) EnumDescriptor

func (OutputRouterSpec_Type) EnumDescriptor() ([]byte, []int)

func (OutputRouterSpec_Type) String

func (x OutputRouterSpec_Type) String() string

func (*OutputRouterSpec_Type) UnmarshalJSON

func (x *OutputRouterSpec_Type) UnmarshalJSON(data []byte) error

type ProcessorCoreUnion

type ProcessorCoreUnion struct {
	TableReader *TableReaderSpec `protobuf:"bytes,1,opt,name=tableReader" json:"tableReader,omitempty"`
}

func (*ProcessorCoreUnion) Descriptor

func (*ProcessorCoreUnion) Descriptor() ([]byte, []int)

func (*ProcessorCoreUnion) GetValue

func (this *ProcessorCoreUnion) GetValue() interface{}

func (*ProcessorCoreUnion) Marshal

func (m *ProcessorCoreUnion) Marshal() (data []byte, err error)

func (*ProcessorCoreUnion) MarshalTo

func (m *ProcessorCoreUnion) MarshalTo(data []byte) (int, error)

func (*ProcessorCoreUnion) ProtoMessage

func (*ProcessorCoreUnion) ProtoMessage()

func (*ProcessorCoreUnion) Reset

func (m *ProcessorCoreUnion) Reset()

func (*ProcessorCoreUnion) SetValue

func (this *ProcessorCoreUnion) SetValue(value interface{}) bool

func (*ProcessorCoreUnion) Size

func (m *ProcessorCoreUnion) Size() (n int)

func (*ProcessorCoreUnion) String

func (m *ProcessorCoreUnion) String() string

func (*ProcessorCoreUnion) Unmarshal

func (m *ProcessorCoreUnion) Unmarshal(data []byte) error

type ProcessorSpec

type ProcessorSpec struct {
	Core ProcessorCoreUnion `protobuf:"bytes,1,opt,name=core" json:"core"`
	// In most cases, there is one output.
	Output []OutputRouterSpec `protobuf:"bytes,2,rep,name=output" json:"output"`
}

func (*ProcessorSpec) Descriptor

func (*ProcessorSpec) Descriptor() ([]byte, []int)

func (*ProcessorSpec) Marshal

func (m *ProcessorSpec) Marshal() (data []byte, err error)

func (*ProcessorSpec) MarshalTo

func (m *ProcessorSpec) MarshalTo(data []byte) (int, error)

func (*ProcessorSpec) ProtoMessage

func (*ProcessorSpec) ProtoMessage()

func (*ProcessorSpec) Reset

func (m *ProcessorSpec) Reset()

func (*ProcessorSpec) Size

func (m *ProcessorSpec) Size() (n int)

func (*ProcessorSpec) String

func (m *ProcessorSpec) String() string

func (*ProcessorSpec) Unmarshal

func (m *ProcessorSpec) Unmarshal(data []byte) error

type ServerContext

type ServerContext struct {
	DB *client.DB
}

ServerContext encompasses the configuration required to create a DistSQLServer.

type ServerImpl

type ServerImpl struct {
	// contains filtered or unexported fields
}

ServerImpl implements the server for the distributed SQL APIs.

func NewServer

func NewServer(ctx ServerContext) *ServerImpl

NewServer instantiates a DistSQLServer.

func (*ServerImpl) SetupFlows

func (ds *ServerImpl) SetupFlows(ctx context.Context, req *SetupFlowsRequest) (
	*SetupFlowsResponse, error,
)

SetupFlows is part of the DistSQLServer interface.

type SetupFlowsRequest

type SetupFlowsRequest struct {
	Txn   cockroach_roachpb1.Transaction `protobuf:"bytes,1,opt,name=txn" json:"txn"`
	Flows []FlowSpec                     `protobuf:"bytes,2,rep,name=flows" json:"flows"`
}

func (*SetupFlowsRequest) Descriptor

func (*SetupFlowsRequest) Descriptor() ([]byte, []int)

func (*SetupFlowsRequest) Marshal

func (m *SetupFlowsRequest) Marshal() (data []byte, err error)

func (*SetupFlowsRequest) MarshalTo

func (m *SetupFlowsRequest) MarshalTo(data []byte) (int, error)

func (*SetupFlowsRequest) ProtoMessage

func (*SetupFlowsRequest) ProtoMessage()

func (*SetupFlowsRequest) Reset

func (m *SetupFlowsRequest) Reset()

func (*SetupFlowsRequest) Size

func (m *SetupFlowsRequest) Size() (n int)

func (*SetupFlowsRequest) String

func (m *SetupFlowsRequest) String() string

func (*SetupFlowsRequest) Unmarshal

func (m *SetupFlowsRequest) Unmarshal(data []byte) error

type SetupFlowsResponse

type SetupFlowsResponse struct {
	Error *cockroach_roachpb2.Error `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
}

func (*SetupFlowsResponse) Descriptor

func (*SetupFlowsResponse) Descriptor() ([]byte, []int)

func (*SetupFlowsResponse) Marshal

func (m *SetupFlowsResponse) Marshal() (data []byte, err error)

func (*SetupFlowsResponse) MarshalTo

func (m *SetupFlowsResponse) MarshalTo(data []byte) (int, error)

func (*SetupFlowsResponse) ProtoMessage

func (*SetupFlowsResponse) ProtoMessage()

func (*SetupFlowsResponse) Reset

func (m *SetupFlowsResponse) Reset()

func (*SetupFlowsResponse) Size

func (m *SetupFlowsResponse) Size() (n int)

func (*SetupFlowsResponse) String

func (m *SetupFlowsResponse) String() string

func (*SetupFlowsResponse) Unmarshal

func (m *SetupFlowsResponse) Unmarshal(data []byte) error

type StreamEndpointSpec

type StreamEndpointSpec struct {
	Type StreamEndpointSpec_Type `protobuf:"varint,1,opt,name=type,enum=cockroach.sql.distsql.StreamEndpointSpec_Type" json:"type"`
	// For the LOCAL type, this is the ID of the corresponding endpoint within
	// the same flow. For the REMOTE type, this is the ID of a mailbox.
	ID int32 `protobuf:"varint,2,opt,name=id" json:"id"`
}

StreamEndpointSpec describes one of the endpoints (input or output) of a physical stream.

func (*StreamEndpointSpec) Descriptor

func (*StreamEndpointSpec) Descriptor() ([]byte, []int)

func (*StreamEndpointSpec) Marshal

func (m *StreamEndpointSpec) Marshal() (data []byte, err error)

func (*StreamEndpointSpec) MarshalTo

func (m *StreamEndpointSpec) MarshalTo(data []byte) (int, error)

func (*StreamEndpointSpec) ProtoMessage

func (*StreamEndpointSpec) ProtoMessage()

func (*StreamEndpointSpec) Reset

func (m *StreamEndpointSpec) Reset()

func (*StreamEndpointSpec) Size

func (m *StreamEndpointSpec) Size() (n int)

func (*StreamEndpointSpec) String

func (m *StreamEndpointSpec) String() string

func (*StreamEndpointSpec) Unmarshal

func (m *StreamEndpointSpec) Unmarshal(data []byte) error

type StreamEndpointSpec_Type

type StreamEndpointSpec_Type int32
const (
	// The ending is part of the same flow.
	StreamEndpointSpec_LOCAL StreamEndpointSpec_Type = 0
	// The stream crosses flows; the ending is a mailbox.
	StreamEndpointSpec_REMOTE StreamEndpointSpec_Type = 1
	// This is a special mode used for simple flows with few expected
	// results. In this "sync RPC" mode, we accumulate results and return
	// them as part of the RPC call that set up the flow. This saves
	// overhead (extra RPCs) compared to the normal "async" mode where the
	// RPC just sets up the flow. There can be at most one such endpoint in
	// one flow, and such a flow cannot have any REMOTE endpoints (i.e. all
	// other endpoints must be LOCAL).
	StreamEndpointSpec_RPC_SYNC_RESP StreamEndpointSpec_Type = 2
)

func (StreamEndpointSpec_Type) Enum

func (StreamEndpointSpec_Type) EnumDescriptor

func (StreamEndpointSpec_Type) EnumDescriptor() ([]byte, []int)

func (StreamEndpointSpec_Type) String

func (x StreamEndpointSpec_Type) String() string

func (*StreamEndpointSpec_Type) UnmarshalJSON

func (x *StreamEndpointSpec_Type) UnmarshalJSON(data []byte) error

type TableReaderSpan

type TableReaderSpan struct {
	// TODO(radu): the dist_sql APIs should be agnostic to how we map tables to
	// KVs. The span should be described as starting and ending lists of values
	// for a prefix of the index columns, along with inclusive/exclusive flags.
	Span cockroach_roachpb1.Span `protobuf:"bytes,1,opt,name=span" json:"span"`
}

func (*TableReaderSpan) Descriptor

func (*TableReaderSpan) Descriptor() ([]byte, []int)

func (*TableReaderSpan) Marshal

func (m *TableReaderSpan) Marshal() (data []byte, err error)

func (*TableReaderSpan) MarshalTo

func (m *TableReaderSpan) MarshalTo(data []byte) (int, error)

func (*TableReaderSpan) ProtoMessage

func (*TableReaderSpan) ProtoMessage()

func (*TableReaderSpan) Reset

func (m *TableReaderSpan) Reset()

func (*TableReaderSpan) Size

func (m *TableReaderSpan) Size() (n int)

func (*TableReaderSpan) String

func (m *TableReaderSpan) String() string

func (*TableReaderSpan) Unmarshal

func (m *TableReaderSpan) Unmarshal(data []byte) error

type TableReaderSpec

type TableReaderSpec struct {
	Table cockroach_sql_sqlbase1.TableDescriptor `protobuf:"bytes,1,opt,name=table" json:"table"`
	// If 0, we use the primary index. If non-zero, we use the index_idx-th index,
	// i.e. table.indexes[index_idx-1]
	IndexIdx uint32            `protobuf:"varint,2,opt,name=index_idx,json=indexIdx" json:"index_idx"`
	Reverse  bool              `protobuf:"varint,3,opt,name=reverse" json:"reverse"`
	Spans    []TableReaderSpan `protobuf:"bytes,4,rep,name=spans" json:"spans"`
	// The filter expression references the columns in the table (table.columns)
	// via $0, $1, etc. If a secondary index is used, the columns that are not
	// available as part of the index cannot be referenced.
	Filter Expression `protobuf:"bytes,5,opt,name=filter" json:"filter"`
	// The table reader will only produce values for these columns, referenced by
	// their indices in table.columns.
	OutputColumns []uint32 `protobuf:"varint,6,rep,packed,name=output_columns,json=outputColumns" json:"output_columns,omitempty"`
}

TableReaderSpec is the specification for a table reader. A table reader performs KV operations to retrieve rows for a table and outputs the desired columns of the rows that pass a filter expression.

func (*TableReaderSpec) Descriptor

func (*TableReaderSpec) Descriptor() ([]byte, []int)

func (*TableReaderSpec) Marshal

func (m *TableReaderSpec) Marshal() (data []byte, err error)

func (*TableReaderSpec) MarshalTo

func (m *TableReaderSpec) MarshalTo(data []byte) (int, error)

func (*TableReaderSpec) ProtoMessage

func (*TableReaderSpec) ProtoMessage()

func (*TableReaderSpec) Reset

func (m *TableReaderSpec) Reset()

func (*TableReaderSpec) Size

func (m *TableReaderSpec) Size() (n int)

func (*TableReaderSpec) String

func (m *TableReaderSpec) String() string

func (*TableReaderSpec) Unmarshal

func (m *TableReaderSpec) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL