protocol

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2014 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Request_Type_name = map[int32]string{
	1:  "QUERY",
	2:  "REPLICATION_WRITE",
	3:  "PROXY_WRITE",
	4:  "REPLICATION_DELETE",
	5:  "PROXY_DELETE",
	6:  "REPLICATION_REPLAY",
	7:  "LIST_SERIES",
	8:  "SEQUENCE_NUMBER",
	9:  "PROXY_DROP_DATABASE",
	10: "REPLICATION_DROP_DATABASE",
	11: "PROXY_DROP_SERIES",
	12: "REPLICATION_DROP_SERIES",
}
View Source
var Request_Type_value = map[string]int32{
	"QUERY":                     1,
	"REPLICATION_WRITE":         2,
	"PROXY_WRITE":               3,
	"REPLICATION_DELETE":        4,
	"PROXY_DELETE":              5,
	"REPLICATION_REPLAY":        6,
	"LIST_SERIES":               7,
	"SEQUENCE_NUMBER":           8,
	"PROXY_DROP_DATABASE":       9,
	"REPLICATION_DROP_DATABASE": 10,
	"PROXY_DROP_SERIES":         11,
	"REPLICATION_DROP_SERIES":   12,
}
View Source
var Response_ErrorCode_name = map[int32]string{
	1: "REQUEST_TOO_LARGE",
	2: "INTERNAL_ERROR",
}
View Source
var Response_ErrorCode_value = map[string]int32{
	"REQUEST_TOO_LARGE": 1,
	"INTERNAL_ERROR":    2,
}
View Source
var Response_Type_name = map[int32]string{
	1: "QUERY",
	2: "WRITE_OK",
	3: "END_STREAM",
	4: "REPLICATION_REPLAY",
	5: "REPLICATION_REPLAY_END",
	6: "LIST_SERIES",
	7: "SEQUENCE_NUMBER",
}
View Source
var Response_Type_value = map[string]int32{
	"QUERY":                  1,
	"WRITE_OK":               2,
	"END_STREAM":             3,
	"REPLICATION_REPLAY":     4,
	"REPLICATION_REPLAY_END": 5,
	"LIST_SERIES":            6,
	"SEQUENCE_NUMBER":        7,
}

Functions

This section is empty.

Types

type ByPointTimeAsc added in v0.4.0

type ByPointTimeAsc struct{ PointsCollection }

func (ByPointTimeAsc) Less added in v0.4.0

func (s ByPointTimeAsc) Less(i, j int) bool

type ByPointTimeDesc added in v0.4.0

type ByPointTimeDesc struct{ PointsCollection }

func (ByPointTimeDesc) Less added in v0.4.0

func (s ByPointTimeDesc) Less(i, j int) bool

type FieldValue

type FieldValue struct {
	StringValue      *string  `protobuf:"bytes,1,opt,name=string_value" json:"string_value,omitempty"`
	DoubleValue      *float64 `protobuf:"fixed64,3,opt,name=double_value" json:"double_value,omitempty"`
	BoolValue        *bool    `protobuf:"varint,4,opt,name=bool_value" json:"bool_value,omitempty"`
	Int64Value       *int64   `protobuf:"varint,5,opt,name=int64_value" json:"int64_value,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*FieldValue) GetBoolValue

func (m *FieldValue) GetBoolValue() bool

func (*FieldValue) GetDoubleValue

func (m *FieldValue) GetDoubleValue() float64

func (*FieldValue) GetInt64Value

func (m *FieldValue) GetInt64Value() int64

func (*FieldValue) GetStringValue

func (m *FieldValue) GetStringValue() string

func (*FieldValue) GetValue

func (self *FieldValue) GetValue() interface{}

func (*FieldValue) ProtoMessage

func (*FieldValue) ProtoMessage()

func (*FieldValue) Reset

func (m *FieldValue) Reset()

func (*FieldValue) String

func (m *FieldValue) String() string

type Point

type Point struct {
	Values           []*FieldValue `protobuf:"bytes,1,rep,name=values" json:"values,omitempty"`
	Timestamp        *int64        `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"`
	SequenceNumber   *uint64       `protobuf:"varint,3,opt,name=sequence_number" json:"sequence_number,omitempty"`
	XXX_unrecognized []byte        `json:"-"`
}

func DecodePoint added in v0.4.0

func DecodePoint(buff *bytes.Buffer) (point *Point, err error)

func (*Point) Encode added in v0.4.0

func (point *Point) Encode() (data []byte, err error)

func (*Point) GetFieldValue

func (self *Point) GetFieldValue(idx int) interface{}

func (*Point) GetSequenceNumber

func (m *Point) GetSequenceNumber() uint64

func (*Point) GetTimestamp

func (m *Point) GetTimestamp() int64

func (*Point) GetTimestampInMicroseconds

func (self *Point) GetTimestampInMicroseconds() *int64

func (*Point) GetValues

func (m *Point) GetValues() []*FieldValue

func (*Point) ProtoMessage

func (*Point) ProtoMessage()

func (*Point) Reset

func (m *Point) Reset()

func (*Point) SetTimestampInMicroseconds

func (self *Point) SetTimestampInMicroseconds(t int64)

func (*Point) String

func (m *Point) String() string

type PointsCollection added in v0.4.0

type PointsCollection []*Point

func (PointsCollection) Len added in v0.4.0

func (s PointsCollection) Len() int

func (PointsCollection) Swap added in v0.4.0

func (s PointsCollection) Swap(i, j int)

type QueryResponseChunk added in v0.4.0

type QueryResponseChunk struct {
	Series           *Series `protobuf:"bytes,1,opt,name=series" json:"series,omitempty"`
	Done             *bool   `protobuf:"varint,2,opt,name=done" json:"done,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*QueryResponseChunk) GetDone added in v0.4.0

func (m *QueryResponseChunk) GetDone() bool

func (*QueryResponseChunk) GetSeries added in v0.4.0

func (m *QueryResponseChunk) GetSeries() *Series

func (*QueryResponseChunk) ProtoMessage added in v0.4.0

func (*QueryResponseChunk) ProtoMessage()

func (*QueryResponseChunk) Reset added in v0.4.0

func (m *QueryResponseChunk) Reset()

func (*QueryResponseChunk) String added in v0.4.0

func (m *QueryResponseChunk) String() string

type Request

type Request struct {
	Id       *uint32       `protobuf:"varint,1,req,name=id" json:"id,omitempty"`
	Type     *Request_Type `protobuf:"varint,2,req,name=type,enum=protocol.Request_Type" json:"type,omitempty"`
	Database *string       `protobuf:"bytes,3,req,name=database" json:"database,omitempty"`
	Series   *Series       `protobuf:"bytes,4,opt,name=series" json:"series,omitempty"`
	// only write and delete requests get sequenceNumbers assigned. These are used to
	// ensure that the receiving server is up to date
	SequenceNumber *uint64 `protobuf:"varint,5,opt,name=sequence_number" json:"sequence_number,omitempty"`
	// the originzatingServerId is only used for writes and deletes. It is the id of the
	// server that first committed the write to its local datastore. It is used for
	// the other servers in the hash ring to ensure they remain consistent.
	OriginatingServerId *uint32 `protobuf:"varint,6,opt,name=originating_server_id" json:"originating_server_id,omitempty"`
	ClusterVersion      *uint32 `protobuf:"varint,10,opt,name=cluster_version" json:"cluster_version,omitempty"`
	Query               *string `protobuf:"bytes,7,opt,name=query" json:"query,omitempty"`
	UserName            *string `protobuf:"bytes,8,opt,name=user_name" json:"user_name,omitempty"`
	// ringLocationsToQuery tells the server what data it should be returning.
	// for example, if the number is 1, it will only return data that is owned by
	// this server on the hash ring. If 2, it will return this server and data replicated
	// from the server directly before it on the ring. 3, etc.
	// If this field is left out, we assume that we'll be returning all data the server has
	// for the query.
	RingLocationsToQuery *uint32 `protobuf:"varint,9,opt,name=ring_locations_to_query" json:"ring_locations_to_query,omitempty"`
	// optional fields for replication replay requests. should include originating serer id
	ReplicationFactor       *uint32 `protobuf:"varint,16,opt,name=replication_factor" json:"replication_factor,omitempty"`
	OwnerServerId           *uint32 `protobuf:"varint,17,opt,name=owner_server_id" json:"owner_server_id,omitempty"`
	LastKnownSequenceNumber *uint64 `protobuf:"varint,18,opt,name=last_known_sequence_number" json:"last_known_sequence_number,omitempty"`
	IsDbUser                *bool   `protobuf:"varint,19,opt,name=is_db_user" json:"is_db_user,omitempty"`
	XXX_unrecognized        []byte  `json:"-"`
}

func DecodeRequest added in v0.4.0

func DecodeRequest(buff *bytes.Buffer) (request *Request, err error)

func (*Request) Encode added in v0.4.0

func (self *Request) Encode() (data []byte, err error)

func (*Request) GetClusterVersion added in v0.4.0

func (m *Request) GetClusterVersion() uint32

func (*Request) GetDatabase added in v0.4.0

func (m *Request) GetDatabase() string

func (*Request) GetId

func (m *Request) GetId() uint32

func (*Request) GetIsDbUser added in v0.4.1

func (m *Request) GetIsDbUser() bool

func (*Request) GetLastKnownSequenceNumber added in v0.4.0

func (m *Request) GetLastKnownSequenceNumber() uint64

func (*Request) GetOriginatingServerId added in v0.4.0

func (m *Request) GetOriginatingServerId() uint32

func (*Request) GetOwnerServerId added in v0.4.0

func (m *Request) GetOwnerServerId() uint32

func (*Request) GetQuery added in v0.4.0

func (m *Request) GetQuery() string

func (*Request) GetReplicationFactor added in v0.4.0

func (m *Request) GetReplicationFactor() uint32

func (*Request) GetRingLocationsToQuery added in v0.4.0

func (m *Request) GetRingLocationsToQuery() uint32

func (*Request) GetSequenceNumber added in v0.4.0

func (m *Request) GetSequenceNumber() uint64

func (*Request) GetSeries added in v0.4.0

func (m *Request) GetSeries() *Series

func (*Request) GetType

func (m *Request) GetType() Request_Type

func (*Request) GetUserName added in v0.4.0

func (m *Request) GetUserName() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) String

func (m *Request) String() string

type Request_Type

type Request_Type int32
const (
	Request_QUERY                     Request_Type = 1
	Request_REPLICATION_WRITE         Request_Type = 2
	Request_PROXY_WRITE               Request_Type = 3
	Request_REPLICATION_DELETE        Request_Type = 4
	Request_PROXY_DELETE              Request_Type = 5
	Request_REPLICATION_REPLAY        Request_Type = 6
	Request_LIST_SERIES               Request_Type = 7
	Request_SEQUENCE_NUMBER           Request_Type = 8
	Request_PROXY_DROP_DATABASE       Request_Type = 9
	Request_REPLICATION_DROP_DATABASE Request_Type = 10
	Request_PROXY_DROP_SERIES         Request_Type = 11
	Request_REPLICATION_DROP_SERIES   Request_Type = 12
)

func (Request_Type) Enum

func (x Request_Type) Enum() *Request_Type

func (Request_Type) String

func (x Request_Type) String() string

func (*Request_Type) UnmarshalJSON

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

type Response

type Response struct {
	Type             *Response_Type      `protobuf:"varint,1,req,name=type,enum=protocol.Response_Type" json:"type,omitempty"`
	RequestId        *uint32             `protobuf:"varint,2,req,name=request_id" json:"request_id,omitempty"`
	Series           *Series             `protobuf:"bytes,3,opt,name=series" json:"series,omitempty"`
	ErrorCode        *Response_ErrorCode `protobuf:"varint,4,opt,name=error_code,enum=protocol.Response_ErrorCode" json:"error_code,omitempty"`
	ErrorMessage     *string             `protobuf:"bytes,5,opt,name=error_message" json:"error_message,omitempty"`
	NextPointTime    *int64              `protobuf:"varint,6,opt,name=nextPointTime" json:"nextPointTime,omitempty"`
	Request          *Request            `protobuf:"bytes,7,opt,name=request" json:"request,omitempty"`
	XXX_unrecognized []byte              `json:"-"`
}

func DecodeResponse added in v0.4.0

func DecodeResponse(buff *bytes.Buffer) (response *Response, err error)

func (*Response) Encode added in v0.4.0

func (self *Response) Encode() (data []byte, err error)

func (*Response) GetErrorCode added in v0.4.0

func (m *Response) GetErrorCode() Response_ErrorCode

func (*Response) GetErrorMessage added in v0.4.0

func (m *Response) GetErrorMessage() string

func (*Response) GetNextPointTime added in v0.4.0

func (m *Response) GetNextPointTime() int64

func (*Response) GetRequest added in v0.4.0

func (m *Response) GetRequest() *Request

func (*Response) GetRequestId added in v0.4.0

func (m *Response) GetRequestId() uint32

func (*Response) GetSeries

func (m *Response) GetSeries() *Series

func (*Response) GetType added in v0.4.0

func (m *Response) GetType() Response_Type

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

type Response_ErrorCode added in v0.4.0

type Response_ErrorCode int32
const (
	Response_REQUEST_TOO_LARGE Response_ErrorCode = 1
	Response_INTERNAL_ERROR    Response_ErrorCode = 2
)

func (Response_ErrorCode) Enum added in v0.4.0

func (Response_ErrorCode) String added in v0.4.0

func (x Response_ErrorCode) String() string

func (*Response_ErrorCode) UnmarshalJSON added in v0.4.0

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

type Response_Type

type Response_Type int32
const (
	Response_QUERY                  Response_Type = 1
	Response_WRITE_OK               Response_Type = 2
	Response_END_STREAM             Response_Type = 3
	Response_REPLICATION_REPLAY     Response_Type = 4
	Response_REPLICATION_REPLAY_END Response_Type = 5
	Response_LIST_SERIES            Response_Type = 6
	Response_SEQUENCE_NUMBER        Response_Type = 7
)

func (Response_Type) Enum

func (x Response_Type) Enum() *Response_Type

func (Response_Type) String

func (x Response_Type) String() string

func (*Response_Type) UnmarshalJSON

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

type Series

type Series struct {
	Points           []*Point `protobuf:"bytes,1,rep,name=points" json:"points,omitempty"`
	Name             *string  `protobuf:"bytes,2,req,name=name" json:"name,omitempty"`
	Fields           []string `protobuf:"bytes,3,rep,name=fields" json:"fields,omitempty"`
	XXX_unrecognized []byte   `json:"-"`
}

func (*Series) GetFields

func (m *Series) GetFields() []string

func (*Series) GetName

func (m *Series) GetName() string

func (*Series) GetPoints

func (m *Series) GetPoints() []*Point

func (*Series) ProtoMessage

func (*Series) ProtoMessage()

func (*Series) Reset

func (m *Series) Reset()

func (*Series) SortPointsTimeAscending added in v0.4.0

func (self *Series) SortPointsTimeAscending()

func (*Series) SortPointsTimeDescending added in v0.4.0

func (self *Series) SortPointsTimeDescending()

func (*Series) String

func (m *Series) String() string

Jump to

Keyboard shortcuts

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