pb

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package pb is a generated protocol buffer package.

It is generated from these files:

grpc.proto

It has these top-level messages:

ProdRq
ProdRs
ConsNAckRq
ConsRs
AckRq
AckRs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterKafkaPixyServer

func RegisterKafkaPixyServer(s *grpc.Server, srv KafkaPixyServer)

Types

type AckRq added in v0.13.0

type AckRq struct {
	// Name of a proxy (Kafka cluster) to operate on. Default proxy is used by
	// default.
	Cluster string `protobuf:"bytes,1,opt,name=cluster" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
	// Name of a consumer group.
	Group string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"`
	// Partition that the acknowledged message was consumed from.
	Partition int32 `protobuf:"varint,4,opt,name=partition" json:"partition,omitempty"`
	// Offset in the partition that the acknowledged message was consumed from.
	Offset int64 `protobuf:"varint,5,opt,name=offset" json:"offset,omitempty"`
}

func (*AckRq) Descriptor added in v0.13.0

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

func (*AckRq) GetCluster added in v0.13.0

func (m *AckRq) GetCluster() string

func (*AckRq) GetGroup added in v0.13.0

func (m *AckRq) GetGroup() string

func (*AckRq) GetOffset added in v0.13.0

func (m *AckRq) GetOffset() int64

func (*AckRq) GetPartition added in v0.13.0

func (m *AckRq) GetPartition() int32

func (*AckRq) GetTopic added in v0.13.0

func (m *AckRq) GetTopic() string

func (*AckRq) ProtoMessage added in v0.13.0

func (*AckRq) ProtoMessage()

func (*AckRq) Reset added in v0.13.0

func (m *AckRq) Reset()

func (*AckRq) String added in v0.13.0

func (m *AckRq) String() string

type AckRs added in v0.13.0

type AckRs struct {
}

func (*AckRs) Descriptor added in v0.13.0

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

func (*AckRs) ProtoMessage added in v0.13.0

func (*AckRs) ProtoMessage()

func (*AckRs) Reset added in v0.13.0

func (m *AckRs) Reset()

func (*AckRs) String added in v0.13.0

func (m *AckRs) String() string

type ConsNAckRq added in v0.13.0

type ConsNAckRq struct {
	// Name of a Kafka cluster to operate on. Default proxy is used by
	// default.
	Cluster string `protobuf:"bytes,1,opt,name=cluster" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
	// Name of a consumer group.
	Group string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"`
	// If true then no message is acknowledged by the request.
	NoAck bool `protobuf:"varint,4,opt,name=no_ack,json=noAck" json:"no_ack,omitempty"`
	// If true and no_ack is false then the message returned by the requests is
	// automatically acknowledged by Kafka-Pixy before the request completes.
	AutoAck bool `protobuf:"varint,5,opt,name=auto_ack,json=autoAck" json:"auto_ack,omitempty"`
	// If both no_ack and auto_ack are false (by default), then ack_partition
	// and ack_offset along with proxy+group+topic determine the message that
	// should be acknowledged by the request.
	AckPartition int32 `protobuf:"varint,6,opt,name=ack_partition,json=ackPartition" json:"ack_partition,omitempty"`
	AckOffset    int64 `protobuf:"varint,7,opt,name=ack_offset,json=ackOffset" json:"ack_offset,omitempty"`
}

func (*ConsNAckRq) Descriptor added in v0.13.0

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

func (*ConsNAckRq) GetAckOffset added in v0.13.0

func (m *ConsNAckRq) GetAckOffset() int64

func (*ConsNAckRq) GetAckPartition added in v0.13.0

func (m *ConsNAckRq) GetAckPartition() int32

func (*ConsNAckRq) GetAutoAck added in v0.13.0

func (m *ConsNAckRq) GetAutoAck() bool

func (*ConsNAckRq) GetCluster added in v0.13.0

func (m *ConsNAckRq) GetCluster() string

func (*ConsNAckRq) GetGroup added in v0.13.0

func (m *ConsNAckRq) GetGroup() string

func (*ConsNAckRq) GetNoAck added in v0.13.0

func (m *ConsNAckRq) GetNoAck() bool

func (*ConsNAckRq) GetTopic added in v0.13.0

func (m *ConsNAckRq) GetTopic() string

func (*ConsNAckRq) ProtoMessage added in v0.13.0

func (*ConsNAckRq) ProtoMessage()

func (*ConsNAckRq) Reset added in v0.13.0

func (m *ConsNAckRq) Reset()

func (*ConsNAckRq) String added in v0.13.0

func (m *ConsNAckRq) String() string

type ConsRs added in v0.13.0

type ConsRs struct {
	// Partition the message was read from.
	Partition int32 `protobuf:"varint,1,opt,name=partition" json:"partition,omitempty"`
	// Offset of the read message in the partition.
	Offset int64 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
	// Key that was used to produce the message, unless key_undefined is true,
	// then it is undefined.
	KeyValue []byte `protobuf:"bytes,3,opt,name=key_value,json=keyValue,proto3" json:"key_value,omitempty"`
	// If true then the message was produced to a random partition.
	KeyUndefined bool `protobuf:"varint,4,opt,name=key_undefined,json=keyUndefined" json:"key_undefined,omitempty"`
	// Message body
	Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
}

func (*ConsRs) Descriptor added in v0.13.0

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

func (*ConsRs) GetKeyUndefined added in v0.13.0

func (m *ConsRs) GetKeyUndefined() bool

func (*ConsRs) GetKeyValue added in v0.13.0

func (m *ConsRs) GetKeyValue() []byte

func (*ConsRs) GetMessage added in v0.13.0

func (m *ConsRs) GetMessage() []byte

func (*ConsRs) GetOffset added in v0.13.0

func (m *ConsRs) GetOffset() int64

func (*ConsRs) GetPartition added in v0.13.0

func (m *ConsRs) GetPartition() int32

func (*ConsRs) ProtoMessage added in v0.13.0

func (*ConsRs) ProtoMessage()

func (*ConsRs) Reset added in v0.13.0

func (m *ConsRs) Reset()

func (*ConsRs) String added in v0.13.0

func (m *ConsRs) String() string

type KafkaPixyClient

type KafkaPixyClient interface {
	// Produce writes a message to a Kafka topic.
	//
	// If ProdReq.async_mode is false (default value) then the request will
	// block until the message is written to all ISR. In this case the respose
	// will contain the partition and offset of the message. This has to be
	// used to achive at-least-once deliverability guarantee.
	// If ProdReq.async_mode is true, then Kafka-Pixy returns immediately after
	// it gets the request and performs write on the backgroud. This mode
	// ensures highest throughput but messages can be lost, e.g. if the host
	// crashes before Kafka-Pixy has a chance to complete write.
	//
	// Hash of ProdReq.key_value is used to determine a partition that the
	// message should be written to. If you want a message to go to an random
	// partition then set ProdReq.key_undefined to true. Note that if both
	// ProdReq.key_undefined and ProdReq.key_value are left default, which is
	// empty string and false respectively, then messages will be consitently
	// written to a partiticular partition selected by the hash of an empty
	// string.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Produce(ctx context.Context, in *ProdRq, opts ...grpc.CallOption) (*ProdRs, error)
	// Consume reads a message from a topic and optionally acknowledges a
	// message previously consumed from the same topic.
	//
	// Requests are performed in long polling fation, that is if all available
	// messages have been consumed then the request will block for
	// config.yaml:proxies.<proxy>.consumer.long_polling_timeout waiting for
	// new messages. If no new messages is produced while waiting the request
	// will return gRPC error with 408 status code.
	//
	// To consume the first message set ConsNAckReq.no_ack to true, since there
	// is no message to acknowledge at this point. In the second and all
	// subsequent calls of the method set ConsNAckReq.ack_partition and
	// ConsNAckReq.ack_offset to the respective values of ConsRes returned by
	// the previous method call. To acknowledge the last consumed message before
	// teminating the application call Ack method.
	//
	// If a message is not acknowledged within
	// config.yaml:proxies.<proxy>.consumer.ack_timeout the it will be returned
	// by Kafka-Pixy in ConsRes again possibly to another application.
	//
	// If at-least-once delivery guarantee and retries are not desirable, then
	// you can set ConsNAckReq.auto_ack to true and Kafka-Pixy will acknowledge
	// messages automatically before returning them in ConsRes.
	//
	// gRPC error codes:
	//  * Not Found (5): It just means that all message has been consumed and
	//    the long polling timeout has elaspsed. Just keep calling this method
	//    in a loop;
	//  * Resource Exhausted (8): too many consume requests. Either reduce the
	//    number of consuming threads or increase
	//    config.yaml:proxies.<proxy>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	ConsumeNAck(ctx context.Context, in *ConsNAckRq, opts ...grpc.CallOption) (*ConsRs, error)
	// Ack acknowledges a message earlier consumed from a topic.
	//
	// This method is provided solely to acknowledge the last consumed message
	// before the application terminates. In all other cases ConsumeNAck should
	// be used.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Ack(ctx context.Context, in *AckRq, opts ...grpc.CallOption) (*AckRs, error)
}

func NewKafkaPixyClient

func NewKafkaPixyClient(cc *grpc.ClientConn) KafkaPixyClient

type KafkaPixyServer

type KafkaPixyServer interface {
	// Produce writes a message to a Kafka topic.
	//
	// If ProdReq.async_mode is false (default value) then the request will
	// block until the message is written to all ISR. In this case the respose
	// will contain the partition and offset of the message. This has to be
	// used to achive at-least-once deliverability guarantee.
	// If ProdReq.async_mode is true, then Kafka-Pixy returns immediately after
	// it gets the request and performs write on the backgroud. This mode
	// ensures highest throughput but messages can be lost, e.g. if the host
	// crashes before Kafka-Pixy has a chance to complete write.
	//
	// Hash of ProdReq.key_value is used to determine a partition that the
	// message should be written to. If you want a message to go to an random
	// partition then set ProdReq.key_undefined to true. Note that if both
	// ProdReq.key_undefined and ProdReq.key_value are left default, which is
	// empty string and false respectively, then messages will be consitently
	// written to a partiticular partition selected by the hash of an empty
	// string.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Produce(context.Context, *ProdRq) (*ProdRs, error)
	// Consume reads a message from a topic and optionally acknowledges a
	// message previously consumed from the same topic.
	//
	// Requests are performed in long polling fation, that is if all available
	// messages have been consumed then the request will block for
	// config.yaml:proxies.<proxy>.consumer.long_polling_timeout waiting for
	// new messages. If no new messages is produced while waiting the request
	// will return gRPC error with 408 status code.
	//
	// To consume the first message set ConsNAckReq.no_ack to true, since there
	// is no message to acknowledge at this point. In the second and all
	// subsequent calls of the method set ConsNAckReq.ack_partition and
	// ConsNAckReq.ack_offset to the respective values of ConsRes returned by
	// the previous method call. To acknowledge the last consumed message before
	// teminating the application call Ack method.
	//
	// If a message is not acknowledged within
	// config.yaml:proxies.<proxy>.consumer.ack_timeout the it will be returned
	// by Kafka-Pixy in ConsRes again possibly to another application.
	//
	// If at-least-once delivery guarantee and retries are not desirable, then
	// you can set ConsNAckReq.auto_ack to true and Kafka-Pixy will acknowledge
	// messages automatically before returning them in ConsRes.
	//
	// gRPC error codes:
	//  * Not Found (5): It just means that all message has been consumed and
	//    the long polling timeout has elaspsed. Just keep calling this method
	//    in a loop;
	//  * Resource Exhausted (8): too many consume requests. Either reduce the
	//    number of consuming threads or increase
	//    config.yaml:proxies.<proxy>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	ConsumeNAck(context.Context, *ConsNAckRq) (*ConsRs, error)
	// Ack acknowledges a message earlier consumed from a topic.
	//
	// This method is provided solely to acknowledge the last consumed message
	// before the application terminates. In all other cases ConsumeNAck should
	// be used.
	//
	// gRPC error codes:
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	Ack(context.Context, *AckRq) (*AckRs, error)
}

type ProdRq added in v0.13.0

type ProdRq struct {
	// Name of a Kafka cluster to operate on. Default proxy is used by
	// default.
	Cluster string `protobuf:"bytes,1,opt,name=cluster" json:"cluster,omitempty"`
	// Name of a topic to produce to.
	Topic string `protobuf:"bytes,2,opt,name=topic" json:"topic,omitempty"`
	// Hash of the key is used to determine the partition to produce to. By
	// default it is an empty array which is a valid key, unless key_undefined
	// is set to true and then a random partition is selected.
	KeyValue []byte `protobuf:"bytes,3,opt,name=key_value,json=keyValue,proto3" json:"key_value,omitempty"`
	// If true then the message is written to a random partition, otherwise
	// hash of key_value is used to determine the partition.
	KeyUndefined bool `protobuf:"varint,4,opt,name=key_undefined,json=keyUndefined" json:"key_undefined,omitempty"`
	// Message body.
	Message []byte `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"`
	// If true then the method returns immediately after Kafka-Pixy get the
	// produce request, and the message is written to Kafka asynchronously.
	// In that case partition and offset returned in response should be ignored.
	// If false (by default), then a response is returned after the message is
	// written to all ISR and response provides partition+offset where it was
	// actually written.
	AsyncMode bool `protobuf:"varint,6,opt,name=async_mode,json=asyncMode" json:"async_mode,omitempty"`
}

func (*ProdRq) Descriptor added in v0.13.0

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

func (*ProdRq) GetAsyncMode added in v0.13.0

func (m *ProdRq) GetAsyncMode() bool

func (*ProdRq) GetCluster added in v0.13.0

func (m *ProdRq) GetCluster() string

func (*ProdRq) GetKeyUndefined added in v0.13.0

func (m *ProdRq) GetKeyUndefined() bool

func (*ProdRq) GetKeyValue added in v0.13.0

func (m *ProdRq) GetKeyValue() []byte

func (*ProdRq) GetMessage added in v0.13.0

func (m *ProdRq) GetMessage() []byte

func (*ProdRq) GetTopic added in v0.13.0

func (m *ProdRq) GetTopic() string

func (*ProdRq) ProtoMessage added in v0.13.0

func (*ProdRq) ProtoMessage()

func (*ProdRq) Reset added in v0.13.0

func (m *ProdRq) Reset()

func (*ProdRq) String added in v0.13.0

func (m *ProdRq) String() string

type ProdRs added in v0.13.0

type ProdRs struct {
	// Partition the message was written to. The value only makes sense if
	// ProdReq.async_mode was false.
	Partition int32 `protobuf:"varint,1,opt,name=partition" json:"partition,omitempty"`
	// Offset the message was written to. The value only makes sense if
	// ProdReq.async_mode was false.
	Offset int64 `protobuf:"varint,2,opt,name=offset" json:"offset,omitempty"`
}

func (*ProdRs) Descriptor added in v0.13.0

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

func (*ProdRs) GetOffset added in v0.13.0

func (m *ProdRs) GetOffset() int64

func (*ProdRs) GetPartition added in v0.13.0

func (m *ProdRs) GetPartition() int32

func (*ProdRs) ProtoMessage added in v0.13.0

func (*ProdRs) ProtoMessage()

func (*ProdRs) Reset added in v0.13.0

func (m *ProdRs) Reset()

func (*ProdRs) String added in v0.13.0

func (m *ProdRs) String() string

Jump to

Keyboard shortcuts

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