rpc

package
v0.0.0-...-df46cc1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PasswordKey = "pwd"
)

Variables

View Source
var (
	Codec = &MsgPackCodec{}
)
View Source
var ServiceDesc = grpc.ServiceDesc{
	ServiceName: "zenodb",
	HandlerType: (*Server)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "query",
			Handler:       queryHandler,
			ServerStreams: true,
		},
		{
			StreamName:    "follow",
			Handler:       followHandler,
			ServerStreams: true,
		},
		{
			StreamName:    "remoteQuery",
			Handler:       remoteQueryHandler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "insert",
			Handler:       insertHandler,
			ClientStreams: true,
		},
	},
}

Functions

This section is empty.

Types

type Client

type Client interface {
	NewInserter(ctx context.Context, stream string, opts ...grpc.CallOption) (Inserter, error)

	Query(ctx context.Context, sqlString string, includeMemStore bool, opts ...grpc.CallOption) (*common.QueryMetaData, func(onRow core.OnFlatRow) (*common.QueryStats, error), error)

	Follow(ctx context.Context, in *common.Follow, opts ...grpc.CallOption) (int, func() (data []byte, newOffset wal.Offset, err error), error)

	ProcessRemoteQuery(ctx context.Context, partition int, query planner.QueryClusterFN, timeout time.Duration, opts ...grpc.CallOption) error

	Close() error
}

func Dial

func Dial(addr string, opts *ClientOpts) (Client, error)

type ClientOpts

type ClientOpts struct {
	// Password, if specified, is the password that client will present to server
	// in order to gain access.
	Password string

	Dialer func(string, time.Duration) (net.Conn, error)
}

type Insert

type Insert struct {
	Stream       string // note, only the first Insert in a batch needs to include the Stream
	TS           int64
	Dims         []byte
	Vals         []byte
	EndOfInserts bool
}

type InsertReport

type InsertReport struct {
	Received  int
	Succeeded int
	Errors    map[int]string
}

type Inserter

type Inserter interface {
	Insert(ts time.Time, dims map[string]interface{}, vals func(func(string, interface{}))) error

	Close() (*InsertReport, error)
}

type MsgPackCodec

type MsgPackCodec struct {
}

func (*MsgPackCodec) Marshal

func (c *MsgPackCodec) Marshal(v interface{}) ([]byte, error)

func (*MsgPackCodec) String

func (c *MsgPackCodec) String() string

func (*MsgPackCodec) Unmarshal

func (c *MsgPackCodec) Unmarshal(data []byte, v interface{}) error

type Point

type Point struct {
	Data   []byte
	Offset wal.Offset
}

type Query

type Query struct {
	SQLString       string
	IsSubQuery      bool
	SubQueryResults [][]interface{}
	IncludeMemStore bool
	Unflat          bool
	Deadline        time.Time
	HasDeadline     bool
}

type RegisterQueryHandler

type RegisterQueryHandler struct {
	Partition int
}

type RemoteQueryResult

type RemoteQueryResult struct {
	Fields       core.Fields
	Key          bytemap.ByteMap
	Vals         core.Vals
	Row          *core.FlatRow
	Stats        *common.QueryStats
	Error        string
	EndOfResults bool
}

type Server

type Server interface {
	Insert(stream grpc.ServerStream) error

	Query(*Query, grpc.ServerStream) error

	Follow(*common.Follow, grpc.ServerStream) error

	HandleRemoteQueries(r *RegisterQueryHandler, stream grpc.ServerStream) error
}

type SnappyListener

type SnappyListener struct {
	net.Listener
}

func (*SnappyListener) Accept

func (sl *SnappyListener) Accept() (net.Conn, error)

type SourceInfo

type SourceInfo struct {
	ID int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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