Documentation
      ¶
    
    
  
    
  
    Index ¶
- type BatchedIngressClient
 - type EgressReverseProxy
 - type EgressReverseProxyOption
 - type IngressClientFunc
 - type IngressReverseProxy
 - type LocalStoreReader
 - type Lookup
 - type Metrics
 - type OrchestratorAgent
 - func (o *OrchestratorAgent) AddRange(ctx context.Context, r *rpc.AddRangeRequest) (*rpc.AddRangeResponse, error)
 - func (o *OrchestratorAgent) ListRanges(ctx context.Context, r *rpc.ListRangesRequest) (*rpc.ListRangesResponse, error)
 - func (o *OrchestratorAgent) RemoveRange(ctx context.Context, req *rpc.RemoveRangeRequest) (*rpc.RemoveRangeResponse, error)
 - func (o *OrchestratorAgent) SetRanges(ctx context.Context, in *rpc.SetRangesRequest) (*rpc.SetRangesResponse, error)
 
- type Range
 - type RangeSetter
 - type RoutingTable
 - type StaticLookup
 - type StoreReader
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchedIngressClient ¶
type BatchedIngressClient struct {
	// contains filtered or unexported fields
}
    BatchedIngressClient batches envelopes before sending it. Each invocation to Send is async.
func NewBatchedIngressClient ¶
func NewBatchedIngressClient( size int, interval time.Duration, c rpc.IngressClient, m Metrics, log *log.Logger, ) *BatchedIngressClient
NewBatchedIngressClient returns a new BatchedIngressClient.
func (*BatchedIngressClient) Send ¶
func (b *BatchedIngressClient) Send(ctx context.Context, in *rpc.SendRequest, opts ...grpc.CallOption) (*rpc.SendResponse, error)
Send batches envelopes before shipping them to the client.
type EgressReverseProxy ¶
type EgressReverseProxy struct {
	// contains filtered or unexported fields
}
    EgressReverseProxy is a reverse proxy for Egress requests.
func NewEgressReverseProxy ¶
func NewEgressReverseProxy( l Lookup, clients []rpc.EgressClient, localIdx int, log *log.Logger, opts ...EgressReverseProxyOption, ) *EgressReverseProxy
NewEgressReverseProxy returns a new EgressReverseProxy. LocalIdx is required to know where to find the local node for meta lookups.
func (*EgressReverseProxy) Meta ¶
func (e *EgressReverseProxy) Meta(ctx context.Context, in *rpc.MetaRequest) (*rpc.MetaResponse, error)
Meta will gather meta from the local store and remote nodes.
func (*EgressReverseProxy) Read ¶
func (e *EgressReverseProxy) Read(ctx context.Context, in *rpc.ReadRequest) (*rpc.ReadResponse, error)
Read will either read from the local node or remote nodes.
type EgressReverseProxyOption ¶
type EgressReverseProxyOption func(e *EgressReverseProxy)
func WithMetaCacheDuration ¶
func WithMetaCacheDuration(d time.Duration) EgressReverseProxyOption
WithMetaCacheDuration is a EgressReverseProxyOption to configure how long to cache results from the Meta endpoint.
type IngressClientFunc ¶
type IngressClientFunc func(ctx context.Context, r *rpc.SendRequest, opts ...grpc.CallOption) (*rpc.SendResponse, error)
IngressClientFunc transforms a function into an IngressClient.
func (IngressClientFunc) Send ¶
func (f IngressClientFunc) Send(ctx context.Context, r *rpc.SendRequest, opts ...grpc.CallOption) (*rpc.SendResponse, error)
Send implements an IngressClient.
type IngressReverseProxy ¶
type IngressReverseProxy struct {
	// contains filtered or unexported fields
}
    IngressReverseProxy is a reverse proxy for Ingress requests.
func NewIngressReverseProxy ¶
func NewIngressReverseProxy( l Lookup, clients []rpc.IngressClient, localIdx int, log *log.Logger, ) *IngressReverseProxy
NewIngressReverseProxy returns a new IngressReverseProxy.
func (*IngressReverseProxy) Send ¶
func (p *IngressReverseProxy) Send(ctx context.Context, r *rpc.SendRequest) (*rpc.SendResponse, error)
Send will send to either the local node or the correct remote node according to its source ID.
type LocalStoreReader ¶
type LocalStoreReader struct {
	// contains filtered or unexported fields
}
    LocalStoreReader accesses a store via gRPC calls. It handles converting the requests into a form that the store understands for reading.
func NewLocalStoreReader ¶
func NewLocalStoreReader(s StoreReader) *LocalStoreReader
NewLocalStoreReader creates and returns a new LocalStoreReader.
func (*LocalStoreReader) Meta ¶
func (r *LocalStoreReader) Meta(ctx context.Context, req *logcache_v1.MetaRequest, opts ...grpc.CallOption) (*logcache_v1.MetaResponse, error)
func (*LocalStoreReader) Read ¶
func (r *LocalStoreReader) Read(ctx context.Context, req *logcache_v1.ReadRequest, opts ...grpc.CallOption) (*logcache_v1.ReadResponse, error)
Read returns data from the store.
type Metrics ¶
type Metrics interface {
	// NewCounter returns a func that can be used to increment a counter
	// metric.
	NewCounter(name string) func(delta uint64)
}
    Metrics registers new Counter metrics.
type OrchestratorAgent ¶
type OrchestratorAgent struct {
	// contains filtered or unexported fields
}
    OrchestratorAgent manages the Log Cache node's routes.
func NewOrchestratorAgent ¶
func NewOrchestratorAgent(s RangeSetter) *OrchestratorAgent
NewOrchestratorAgent returns a new OrchestratorAgent.
func (*OrchestratorAgent) AddRange ¶
func (o *OrchestratorAgent) AddRange(ctx context.Context, r *rpc.AddRangeRequest) (*rpc.AddRangeResponse, error)
AddRange adds a range (from the scheduler) for data to be routed to.
func (*OrchestratorAgent) ListRanges ¶
func (o *OrchestratorAgent) ListRanges(ctx context.Context, r *rpc.ListRangesRequest) (*rpc.ListRangesResponse, error)
ListRanges returns all the ranges that are currently active.
func (*OrchestratorAgent) RemoveRange ¶
func (o *OrchestratorAgent) RemoveRange(ctx context.Context, req *rpc.RemoveRangeRequest) (*rpc.RemoveRangeResponse, error)
RemoveRange removes a range (form the scheduler) for the data to be routed to.
func (*OrchestratorAgent) SetRanges ¶
func (o *OrchestratorAgent) SetRanges(ctx context.Context, in *rpc.SetRangesRequest) (*rpc.SetRangesResponse, error)
SetRanges passes them along to the RangeSetter.
type RangeSetter ¶
type RangeSetter interface {
	// SetRanges is used as a pass through for the orchestration service's
	// SetRanges method.
	SetRanges(ctx context.Context, in *rpc.SetRangesRequest) (*rpc.SetRangesResponse, error)
}
    type RoutingTable ¶
type RoutingTable struct {
	// contains filtered or unexported fields
}
    RoutingTable makes decisions for where a item should be routed.
func NewRoutingTable ¶
func NewRoutingTable(addrs []string, hasher func(string) uint64) *RoutingTable
NewRoutingTable returns a new RoutingTable.
func (*RoutingTable) Lookup ¶
func (t *RoutingTable) Lookup(item string) []int
Lookup takes a item, hash it and determine what node it should be routed to.
func (*RoutingTable) LookupAll ¶
func (t *RoutingTable) LookupAll(item string) []int
LookupAll returns every index that has a range where the item would fall under.
func (*RoutingTable) SetRanges ¶
func (t *RoutingTable) SetRanges(ctx context.Context, in *rpc.SetRangesRequest) (*rpc.SetRangesResponse, error)
SetRanges sets the routing table.
type StaticLookup ¶
type StaticLookup struct {
	// contains filtered or unexported fields
}
    StaticLookup is used to do lookup for static routes.
func NewStaticLookup ¶
func NewStaticLookup(numOfRoutes int, hasher func(string) uint64) *StaticLookup
NewStaticLookup creates and returns a StaticLookup.
func (*StaticLookup) Lookup ¶
func (l *StaticLookup) Lookup(sourceID string) int
Lookup hashes the SourceId and then returns the index that is in range of the hash.
type StoreReader ¶
type StoreReader interface {
	// Gets envelopes from a local or remote Log Cache.
	Get(
		sourceID string,
		start time.Time,
		end time.Time,
		envelopeTypes []logcache_v1.EnvelopeType,
		nameFilter *regexp.Regexp,
		limit int,
		descending bool,
	) []*loggregator_v2.Envelope
	// Meta gets the metadata from Log Cache instances in the cluster.
	Meta() map[string]logcache_v1.MetaInfo
}
    StoreReader proxies to the log cache for getting envelopes or Log Cache Metadata.