Documentation ¶
Overview ¶
Package broker implements the broker runtime and protocol.JournalServer APIs (Read, Append, Replicate, List, Apply). Its `pipeline` type manages the coordination of write transactions, and `resolver` the mapping of journal names to Routes of responsible brokers. `replica` is a top-level collection of runtime state and maintenance tasks associated with the processing of a journal. gRPC proxy support is also implemented by this package.
Index ¶
- func NewKeySpace(prefix string) *keyspace.KeySpace
- func SetSharedPersister(p *fragment.Persister)
- type Service
- func (srv *Service) Append(stream pb.Journal_AppendServer) error
- func (srv *Service) Apply(ctx context.Context, req *pb.ApplyRequest) (*pb.ApplyResponse, error)
- func (svc *Service) Fragments(ctx context.Context, req *pb.FragmentsRequest) (*pb.FragmentsResponse, error)
- func (svc *Service) IsNoopRouter() bool
- func (srv *Service) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)
- func (svc *Service) Read(req *pb.ReadRequest, stream pb.Journal_ReadServer) error
- func (srv *Service) Replicate(stream pb.Journal_ReplicateServer) error
- func (svc *Service) Route(ctx context.Context, item string) pb.Route
- func (svc *Service) UpdateRoute(string, *pb.Route)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewKeySpace ¶
NewKeySpace returns a KeySpace suitable for use with an Allocator. It decodes allocator Items as JournalSpec messages, Members as BrokerSpecs, and Assignments as Routes.
func SetSharedPersister ¶
SetSharedPersister sets the Persister instance used by the `broker` package.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the top-level runtime concern of a Gazette Broker process. It drives local journal handling in response to allocator.State, powers journal resolution, and is also an implementation of protocol.JournalServer.
func NewService ¶
NewService constructs a new broker Service, driven by allocator.State.
func (*Service) Append ¶
func (srv *Service) Append(stream pb.Journal_AppendServer) error
Append dispatches the JournalServer.Append API.
func (*Service) Apply ¶
func (srv *Service) Apply(ctx context.Context, req *pb.ApplyRequest) (*pb.ApplyResponse, error)
Apply dispatches the JournalServer.Apply API.
func (*Service) Fragments ¶
func (svc *Service) Fragments(ctx context.Context, req *pb.FragmentsRequest) (*pb.FragmentsResponse, error)
Fragments dispatches the JournalServer.Fragments API.
func (*Service) List ¶
func (srv *Service) List(ctx context.Context, req *pb.ListRequest) (*pb.ListResponse, error)
List dispatches the JournalServer.List API.
func (*Service) Read ¶
func (svc *Service) Read(req *pb.ReadRequest, stream pb.Journal_ReadServer) error
Read dispatches the JournalServer.Read API.
func (*Service) Replicate ¶
func (srv *Service) Replicate(stream pb.Journal_ReplicateServer) error
Replicate dispatches the JournalServer.Replicate API.