queryservice

package
v2.0.0-beta.1+incompat... Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2016 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package queryservice contains the interface for the service definition of the Query Service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorQueryService

type ErrorQueryService struct {
	GetSessionIdError error
}

ErrorQueryService is an implementation of QueryService that returns a configurable error for some of its methods.

func (*ErrorQueryService) Begin

func (e *ErrorQueryService) Begin(ctx context.Context, target *querypb.Target, sessionID int64) (int64, error)

Begin is part of QueryService interface

func (*ErrorQueryService) Commit

func (e *ErrorQueryService) Commit(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

Commit is part of QueryService interface

func (*ErrorQueryService) Execute

func (e *ErrorQueryService) Execute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID, transactionID int64) (*sqltypes.Result, error)

Execute is part of QueryService interface

func (*ErrorQueryService) ExecuteBatch

func (e *ErrorQueryService) ExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, sessionID int64, asTransaction bool, transactionID int64) ([]sqltypes.Result, error)

ExecuteBatch is part of QueryService interface

func (*ErrorQueryService) GetSessionId

func (e *ErrorQueryService) GetSessionId(keyspace, shard string) (int64, error)

GetSessionId is part of QueryService interface

func (*ErrorQueryService) HandlePanic

func (e *ErrorQueryService) HandlePanic(*error)

HandlePanic is part of QueryService interface

func (*ErrorQueryService) Rollback

func (e *ErrorQueryService) Rollback(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

Rollback is part of QueryService interface

func (*ErrorQueryService) SplitQuery

func (e *ErrorQueryService) SplitQuery(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, splitColumn string, splitCount int64, sessionID int64) ([]querytypes.QuerySplit, error)

SplitQuery is part of QueryService interface

func (*ErrorQueryService) StreamExecute

func (e *ErrorQueryService) StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID int64, sendReply func(*sqltypes.Result) error) error

StreamExecute is part of QueryService interface

func (*ErrorQueryService) StreamHealthRegister

func (e *ErrorQueryService) StreamHealthRegister(chan<- *querypb.StreamHealthResponse) (int, error)

StreamHealthRegister is part of QueryService interface

func (*ErrorQueryService) StreamHealthUnregister

func (e *ErrorQueryService) StreamHealthUnregister(int) error

StreamHealthUnregister is part of QueryService interface

type QueryService

type QueryService interface {
	// GetSessionId establishes a session to guarantee the current
	// query service state doesn't change.
	// This is begin deprecated, replaced by the Target structure.
	GetSessionId(keyspace, shard string) (int64, error)

	// Begin returns the transaction id to use for further operations
	Begin(ctx context.Context, target *querypb.Target, sessionID int64) (int64, error)

	// Commit commits the current transaction
	Commit(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

	// Rollback aborts the current transaction
	Rollback(ctx context.Context, target *querypb.Target, sessionID, transactionID int64) error

	Execute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID, transactionID int64) (*sqltypes.Result, error)
	StreamExecute(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, sessionID int64, sendReply func(*sqltypes.Result) error) error
	ExecuteBatch(ctx context.Context, target *querypb.Target, queries []querytypes.BoundQuery, sessionID int64, asTransaction bool, transactionID int64) ([]sqltypes.Result, error)

	// SplitQuery is a map reduce helper function
	SplitQuery(ctx context.Context, target *querypb.Target, sql string, bindVariables map[string]interface{}, splitColumn string, splitCount int64, sessionID int64) ([]querytypes.QuerySplit, error)

	// StreamHealthRegister registers a listener for StreamHealth
	StreamHealthRegister(chan<- *querypb.StreamHealthResponse) (int, error)

	// StreamHealthUnregister unregisters a listener for StreamHealth
	StreamHealthUnregister(int) error

	// Helper for RPC panic handling: call this in a defer statement
	// at the beginning of each RPC handling method.
	HandlePanic(*error)
}

QueryService is the interface implemented by the tablet's query service.

Jump to

Keyboard shortcuts

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