pb

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 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:

kafkapixy.proto

It has these top-level messages:

ProdRq
ProdRs
ConsNAckRq
ConsRs
AckRq
AckRs
PartitionOffset
GetOffsetsRq
GetOffsetsRs

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 Kafka cluster to operate on.
	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.
	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 cluster-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 GetOffsetsRq added in v0.14.0

type GetOffsetsRq struct {
	// Name of a Kafka cluster
	Cluster string `protobuf:"bytes,1,opt,name=cluster" json:"cluster,omitempty"`
	// Name of a topic
	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"`
}

func (*GetOffsetsRq) Descriptor added in v0.14.0

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

func (*GetOffsetsRq) GetCluster added in v0.14.0

func (m *GetOffsetsRq) GetCluster() string

func (*GetOffsetsRq) GetGroup added in v0.14.0

func (m *GetOffsetsRq) GetGroup() string

func (*GetOffsetsRq) GetTopic added in v0.14.0

func (m *GetOffsetsRq) GetTopic() string

func (*GetOffsetsRq) ProtoMessage added in v0.14.0

func (*GetOffsetsRq) ProtoMessage()

func (*GetOffsetsRq) Reset added in v0.14.0

func (m *GetOffsetsRq) Reset()

func (*GetOffsetsRq) String added in v0.14.0

func (m *GetOffsetsRq) String() string

type GetOffsetsRs added in v0.14.0

type GetOffsetsRs struct {
	Offsets []*PartitionOffset `protobuf:"bytes,1,rep,name=offsets" json:"offsets,omitempty"`
}

func (*GetOffsetsRs) Descriptor added in v0.14.0

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

func (*GetOffsetsRs) GetOffsets added in v0.14.0

func (m *GetOffsetsRs) GetOffsets() []*PartitionOffset

func (*GetOffsetsRs) ProtoMessage added in v0.14.0

func (*GetOffsetsRs) ProtoMessage()

func (*GetOffsetsRs) Reset added in v0.14.0

func (m *GetOffsetsRs) Reset()

func (*GetOffsetsRs) String added in v0.14.0

func (m *GetOffsetsRs) 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;
	//  * Unavailable (14): the service is shutting down.
	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.<cluster>.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.<cluster>.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.<cluster>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	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)
	// Fetches partition offsets for the specified topic and group
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	GetOffsets(ctx context.Context, in *GetOffsetsRq, opts ...grpc.CallOption) (*GetOffsetsRs, 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;
	//  * Unavailable (14): the service is shutting down.
	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.<cluster>.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.<cluster>.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.<cluster>.consumer.channel_buffer_size;
	//  * Invalid Argument (3): see the status description for details;
	//  * Internal (13): see the status description and logs for details;
	//  * Unavailable (14): the service is shutting down.
	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)
	// Fetches partition offsets for the specified topic and group
	//
	// gRPC error codes:
	//  * Invalid Argument (3): If unable to find the cluster named in the request
	//  * Internal (13): If Kafka returns an error on offset request
	//  * NotFound (5): If the group and or topic does not exist
	GetOffsets(context.Context, *GetOffsetsRq) (*GetOffsetsRs, error)
}

type PartitionOffset added in v0.14.0

type PartitionOffset struct {
	// The Partition this structure describes
	Partition int32 `protobuf:"varint,1,opt,name=partition" json:"partition,omitempty"`
	// The beginning offset
	Begin int64 `protobuf:"varint,2,opt,name=begin" json:"begin,omitempty"`
	// The ending offset
	End int64 `protobuf:"varint,3,opt,name=end" json:"end,omitempty"`
	// The number of messages in the partition
	Count int64 `protobuf:"varint,4,opt,name=count" json:"count,omitempty"`
	// Offset in the partition
	Offset int64 `protobuf:"varint,5,opt,name=offset" json:"offset,omitempty"`
	// The number of un-consumed messages in the partition
	Lag int64 `protobuf:"varint,6,opt,name=lag" json:"lag,omitempty"`
	// Metatdata associated with the partition
	Metadata string `protobuf:"bytes,7,opt,name=metadata" json:"metadata,omitempty"`
	// human readable representation of sparsely committed ranges
	SparseAcks string `protobuf:"bytes,8,opt,name=sparse_acks,json=sparseAcks" json:"sparse_acks,omitempty"`
}

func (*PartitionOffset) Descriptor added in v0.14.0

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

func (*PartitionOffset) GetBegin added in v0.14.0

func (m *PartitionOffset) GetBegin() int64

func (*PartitionOffset) GetCount added in v0.14.0

func (m *PartitionOffset) GetCount() int64

func (*PartitionOffset) GetEnd added in v0.14.0

func (m *PartitionOffset) GetEnd() int64

func (*PartitionOffset) GetLag added in v0.14.0

func (m *PartitionOffset) GetLag() int64

func (*PartitionOffset) GetMetadata added in v0.14.0

func (m *PartitionOffset) GetMetadata() string

func (*PartitionOffset) GetOffset added in v0.14.0

func (m *PartitionOffset) GetOffset() int64

func (*PartitionOffset) GetPartition added in v0.14.0

func (m *PartitionOffset) GetPartition() int32

func (*PartitionOffset) GetSparseAcks added in v0.14.0

func (m *PartitionOffset) GetSparseAcks() string

func (*PartitionOffset) ProtoMessage added in v0.14.0

func (*PartitionOffset) ProtoMessage()

func (*PartitionOffset) Reset added in v0.14.0

func (m *PartitionOffset) Reset()

func (*PartitionOffset) String added in v0.14.0

func (m *PartitionOffset) String() string

type ProdRq added in v0.13.0

type ProdRq struct {
	// Name of a Kafka cluster to operate on.
	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 gets 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, then a response is returned in accordance with the
	// producer.required_acks parameter, that can be one of:
	//  * no_response:    the response is returned as soon as a produce request
	//                    is delivered to a partition leader Kafka broker.
	//  * wait_for_local: the response is returned as soon as data is written
	//                    to the disk by a partition leader Kafka broker.
	//  * wait_for_all:   the response is returned after all in-sync replicas
	//                    have data committed to disk.
	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