proto

package
v2.0.0-alpha2+incompat... Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoundKeyspaceIdQueriesToProto

func BoundKeyspaceIdQueriesToProto(bsq []BoundKeyspaceIdQuery) []*pb.BoundKeyspaceIdQuery

BoundKeyspaceIdQueriesToProto transforms a list of BoundKeyspaceIdQuery to proto3

func BoundShardQueriesToProto

func BoundShardQueriesToProto(bsq []BoundShardQuery) []*pb.BoundShardQuery

BoundShardQueriesToProto transforms a list of BoundShardQuery to proto3

func EntityIdsToProto

func EntityIdsToProto(l []EntityId) []*pb.ExecuteEntityIdsRequest_EntityId

EntityIdsToProto converts an array of EntityId to proto3

func SessionToProto

func SessionToProto(s *Session) *pb.Session

SessionToProto transforms a Session into proto3

func SplitQueryPartsToProto

func SplitQueryPartsToProto(sqp []SplitQueryPart) *pb.SplitQueryResponse

SplitQueryPartsToproto transforms a SplitQueryResponse into proto

Types

type BatchQueryShard

type BatchQueryShard struct {
	CallerID      *tproto.CallerID // only used by BSON
	Queries       []BoundShardQuery
	TabletType    topo.TabletType
	AsTransaction bool
	Session       *Session
}

BatchQueryShard represents a batch query request for the specified shards.

func (*BatchQueryShard) MarshalBson

func (batchQueryShard *BatchQueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes BatchQueryShard.

func (*BatchQueryShard) UnmarshalBson

func (batchQueryShard *BatchQueryShard) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into BatchQueryShard.

type BeginRequest

type BeginRequest struct {
	CallerID *tproto.CallerID // only used by BSON
}

BeginRequest is the BSON implementation of the proto3 query.BeginRequest

type BeginResponse

type BeginResponse struct {
	// Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain
	// consistent with other BSON structs.
	Err     *mproto.RPCError
	Session *Session
}

BeginResponse is the BSON implementation of the proto3 vtgate.BeginResponse

type BoundKeyspaceIdQuery

type BoundKeyspaceIdQuery struct {
	Sql           string
	BindVariables map[string]interface{}
	Keyspace      string
	KeyspaceIds   []key.KeyspaceId
}

BoundKeyspaceIdQuery represents a single query request for the specified list of keyspace ids. This is used in a list for KeyspaceIdBatchQuery.

func ProtoToBoundKeyspaceIdQueries

func ProtoToBoundKeyspaceIdQueries(bsq []*pb.BoundKeyspaceIdQuery) []BoundKeyspaceIdQuery

ProtoToBoundKeyspaceIdQueries transforms a list of BoundKeyspaceIdQuery from proto3

func (*BoundKeyspaceIdQuery) MarshalBson

func (boundKeyspaceIdQuery *BoundKeyspaceIdQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes BoundKeyspaceIdQuery.

func (*BoundKeyspaceIdQuery) UnmarshalBson

func (boundKeyspaceIdQuery *BoundKeyspaceIdQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into BoundKeyspaceIdQuery.

type BoundShardQuery

type BoundShardQuery struct {
	Sql           string
	BindVariables map[string]interface{}
	Keyspace      string
	Shards        []string
}

BoundShardQuery represents a single query request for the specified list of shards. This is used in a list for BatchQueryShard.

func ProtoToBoundShardQueries

func ProtoToBoundShardQueries(bsq []*pb.BoundShardQuery) []BoundShardQuery

ProtoToBoundShardQueries transforms a list of BoundShardQuery from proto3

func (*BoundShardQuery) MarshalBson

func (boundShardQuery *BoundShardQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes BoundShardQuery.

func (*BoundShardQuery) UnmarshalBson

func (boundShardQuery *BoundShardQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into BoundShardQuery.

type CommitRequest

type CommitRequest struct {
	CallerID *tproto.CallerID // only used by BSON
	Session  *Session
}

CommitRequest is the BSON implementation of the proto3 vtgate.CommitRequest

type CommitResponse

type CommitResponse struct {
	// Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain
	// consistent with other BSON structs.
	Err *mproto.RPCError
}

CommitResponse is the BSON implementation of the proto3 vtgate.CommitResponse

type EntityId

type EntityId struct {
	ExternalID interface{}
	KeyspaceID key.KeyspaceId
}

EntityId represents a tuple of external_id and keyspace_id

func ProtoToEntityIds

func ProtoToEntityIds(l []*pb.ExecuteEntityIdsRequest_EntityId) []EntityId

ProtoToEntityIds converts an array of EntityId from proto3

func (*EntityId) MarshalBson

func (entityId *EntityId) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes EntityId.

func (*EntityId) UnmarshalBson

func (entityId *EntityId) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into EntityId.

type EntityIdsQuery

type EntityIdsQuery struct {
	CallerID          *tproto.CallerID // only used by BSON
	Sql               string
	BindVariables     map[string]interface{}
	Keyspace          string
	EntityColumnName  string
	EntityKeyspaceIDs []EntityId
	TabletType        topo.TabletType
	Session           *Session
	NotInTransaction  bool
}

EntityIdsQuery represents a query request for the specified KeyspaceId map.

func (*EntityIdsQuery) MarshalBson

func (entityIdsQuery *EntityIdsQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes EntityIdsQuery.

func (*EntityIdsQuery) UnmarshalBson

func (entityIdsQuery *EntityIdsQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into EntityIdsQuery.

type GetSrvKeyspaceRequest

type GetSrvKeyspaceRequest struct {
	Keyspace string
}

GetSrvKeyspaceRequest is the payload to GetSrvRequest

type KeyRangeQuery

type KeyRangeQuery struct {
	CallerID         *tproto.CallerID // only used by BSON
	Sql              string
	BindVariables    map[string]interface{}
	Keyspace         string
	KeyRanges        []key.KeyRange
	TabletType       topo.TabletType
	Session          *Session
	NotInTransaction bool
}

KeyRangeQuery represents a query request for the specified list of keyranges.

func (*KeyRangeQuery) MarshalBson

func (keyRangeQuery *KeyRangeQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes KeyRangeQuery.

func (*KeyRangeQuery) UnmarshalBson

func (keyRangeQuery *KeyRangeQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into KeyRangeQuery.

type KeyspaceIdBatchQuery

type KeyspaceIdBatchQuery struct {
	CallerID      *tproto.CallerID // only used by BSON
	Queries       []BoundKeyspaceIdQuery
	TabletType    topo.TabletType
	AsTransaction bool
	Session       *Session
}

KeyspaceIdBatchQuery represents a batch query request for the specified keyspace IDs.

func (*KeyspaceIdBatchQuery) MarshalBson

func (keyspaceIdBatchQuery *KeyspaceIdBatchQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes KeyspaceIdBatchQuery.

func (*KeyspaceIdBatchQuery) UnmarshalBson

func (keyspaceIdBatchQuery *KeyspaceIdBatchQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into KeyspaceIdBatchQuery.

type KeyspaceIdQuery

type KeyspaceIdQuery struct {
	CallerID         *tproto.CallerID // only used by BSON
	Sql              string
	BindVariables    map[string]interface{}
	Keyspace         string
	KeyspaceIds      []key.KeyspaceId
	TabletType       topo.TabletType
	Session          *Session
	NotInTransaction bool
}

KeyspaceIdQuery represents a query request for the specified list of keyspace IDs.

func (*KeyspaceIdQuery) MarshalBson

func (keyspaceIdQuery *KeyspaceIdQuery) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes KeyspaceIdQuery.

func (*KeyspaceIdQuery) UnmarshalBson

func (keyspaceIdQuery *KeyspaceIdQuery) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into KeyspaceIdQuery.

type Query

type Query struct {
	CallerID         *tproto.CallerID // only used by BSON
	Sql              string
	BindVariables    map[string]interface{}
	TabletType       topo.TabletType
	Session          *Session
	NotInTransaction bool
}

Query represents a keyspace agnostic query request.

func (*Query) MarshalBson

func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes Query.

func (*Query) UnmarshalBson

func (query *Query) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into Query.

type QueryResult

type QueryResult struct {
	Result  *mproto.QueryResult
	Session *Session
	Error   string
	Err     *mproto.RPCError
}

QueryResult is mproto.QueryResult+Session (for now).

func (*QueryResult) MarshalBson

func (queryResult *QueryResult) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes QueryResult.

func (*QueryResult) UnmarshalBson

func (queryResult *QueryResult) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into QueryResult.

type QueryResultList

type QueryResultList struct {
	List    []mproto.QueryResult
	Session *Session
	Error   string
	Err     *mproto.RPCError
}

QueryResultList is mproto.QueryResultList+Session

type QueryShard

type QueryShard struct {
	CallerID         *tproto.CallerID // only used by BSON
	Sql              string
	BindVariables    map[string]interface{}
	Keyspace         string
	Shards           []string
	TabletType       topo.TabletType
	Session          *Session
	NotInTransaction bool
}

QueryShard represents a query request for the specified list of shards.

func (*QueryShard) MarshalBson

func (queryShard *QueryShard) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes QueryShard.

func (*QueryShard) UnmarshalBson

func (queryShard *QueryShard) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into QueryShard.

type RollbackRequest

type RollbackRequest struct {
	CallerID *tproto.CallerID // only used by BSON
	Session  *Session
}

RollbackRequest is the BSON implementation of the proto3 vtgate.RollbackRequest

type RollbackResponse

type RollbackResponse struct {
	// Err is named 'Err' instead of 'Error' (as the proto3 version is) to remain
	// consistent with other BSON structs.
	Err *mproto.RPCError
}

RollbackResponse is the BSON implementation of the proto3 vtgate.RollbackResponse

type Session

type Session struct {
	InTransaction bool
	ShardSessions []*ShardSession
}

Session represents the session state. It keeps track of the shards on which transactions are in progress, along with the corresponding transaction ids.

func ProtoToSession

func ProtoToSession(s *pb.Session) *Session

ProtoToSession transforms a proto3 Session into native types

func (*Session) MarshalBson

func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes Session.

func (*Session) String

func (session *Session) String() string

func (*Session) UnmarshalBson

func (session *Session) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into Session.

type ShardSession

type ShardSession struct {
	Keyspace      string
	Shard         string
	TabletType    topo.TabletType
	TransactionId int64
}

ShardSession represents the session state for a shard.

func (*ShardSession) MarshalBson

func (shardSession *ShardSession) MarshalBson(buf *bytes2.ChunkedWriter, key string)

MarshalBson bson-encodes ShardSession.

func (*ShardSession) String

func (shardSession *ShardSession) String() string

func (*ShardSession) UnmarshalBson

func (shardSession *ShardSession) UnmarshalBson(buf *bytes.Buffer, kind byte)

UnmarshalBson bson-decodes into ShardSession.

type SplitQueryPart

type SplitQueryPart struct {
	Query      *KeyRangeQuery
	QueryShard *QueryShard
	Size       int64
}

SplitQueryPart is a sub query of SplitQueryRequest.Query Only one of Query or QueryShard will be set.

func ProtoToSplitQueryParts

func ProtoToSplitQueryParts(sqr *pb.SplitQueryResponse) []SplitQueryPart

ProtoToSplitQueryParts transforms a proto3 SplitQueryResponse into native types

type SplitQueryRequest

type SplitQueryRequest struct {
	CallerID    *tproto.CallerID // only used by BSON
	Keyspace    string
	Query       tproto.BoundQuery
	SplitColumn string
	SplitCount  int
}

SplitQueryRequest is a request to split a query into multiple parts

type SplitQueryResult

type SplitQueryResult struct {
	Splits []SplitQueryPart
	Err    *mproto.RPCError
}

SplitQueryResult is the result for SplitQueryRequest

Jump to

Keyboard shortcuts

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