fabric: github.com/hyperledger/fabric/orderer/common/broadcast Index | Files | Directories

package broadcast

import "github.com/hyperledger/fabric/orderer/common/broadcast"


Package Files

broadcast.go metrics.go

func ClassifyError Uses

func ClassifyError(err error) cb.Status

ClassifyError converts an error type into a status code.

type ChannelSupport Uses

type ChannelSupport interface {

ChannelSupport provides the backing resources needed to support broadcast on a channel

type ChannelSupportRegistrar Uses

type ChannelSupportRegistrar interface {
    // BroadcastChannelSupport returns the message channel header, whether the message is a config update
    // and the channel resources for a message or an error if the message is not a message which can
    // be processed directly (like CONFIG and ORDERER_TRANSACTION messages)
    BroadcastChannelSupport(msg *cb.Envelope) (*cb.ChannelHeader, bool, ChannelSupport, error)

ChannelSupportRegistrar provides a way for the Handler to look up the Support for a channel

type Consenter Uses

type Consenter interface {
    // Order accepts a message or returns an error indicating the cause of failure
    // It ultimately passes through to the consensus.Chain interface
    Order(env *cb.Envelope, configSeq uint64) error

    // Configure accepts a reconfiguration or returns an error indicating the cause of failure
    // It ultimately passes through to the consensus.Chain interface
    Configure(config *cb.Envelope, configSeq uint64) error

    // WaitReady blocks waiting for consenter to be ready for accepting new messages.
    // This is useful when consenter needs to temporarily block ingress messages so
    // that in-flight messages can be consumed. It could return error if consenter is
    // in erroneous states. If this blocking behavior is not desired, consenter could
    // simply return nil.
    WaitReady() error

Consenter provides methods to send messages through consensus

type Handler Uses

type Handler struct {
    SupportRegistrar ChannelSupportRegistrar
    Metrics          *Metrics

Handler is designed to handle connections from Broadcast AB gRPC service

func (*Handler) Handle Uses

func (bh *Handler) Handle(srv ab.AtomicBroadcast_BroadcastServer) error

Handle reads requests from a Broadcast stream, processes them, and returns the responses to the stream

func (*Handler) ProcessMessage Uses

func (bh *Handler) ProcessMessage(msg *cb.Envelope, addr string) (resp *ab.BroadcastResponse)

ProcessMessage validates and enqueues a single message

type Metrics Uses

type Metrics struct {
    ValidateDuration metrics.Histogram
    EnqueueDuration  metrics.Histogram
    ProcessedCount   metrics.Counter

func NewMetrics Uses

func NewMetrics(p metrics.Provider) *Metrics

type MetricsTracker Uses

type MetricsTracker struct {
    ValidateStartTime time.Time
    EnqueueStartTime  time.Time
    ValidateDuration  time.Duration
    ChannelID         string
    TxType            string
    Metrics           *Metrics

func (*MetricsTracker) BeginEnqueue Uses

func (mt *MetricsTracker) BeginEnqueue()

func (*MetricsTracker) BeginValidate Uses

func (mt *MetricsTracker) BeginValidate()

func (*MetricsTracker) EndValidate Uses

func (mt *MetricsTracker) EndValidate()

func (*MetricsTracker) Record Uses

func (mt *MetricsTracker) Record(resp *ab.BroadcastResponse)


mockCode generated by counterfeiter.

Package broadcast imports 9 packages (graph) and is imported by 39 packages. Updated 2019-12-09. Refresh now. Tools for package owners.