Documentation ¶
Index ¶
- type BasicTarget
- type Controller
- func (c *Controller) AttachSink(name string, sink Sink)
- func (c *Controller) AttachSource(name string, source Source)
- func (c *Controller) Close() error
- func (c *Controller) Flush(ctx context.Context, source string) error
- func (c *Controller) Notify(ctx context.Context, id cadata.ID) error
- func (c *Controller) Refresh(ctx context.Context) error
- type Cost
- type Op
- type Planner
- func (p *Planner) AttachSink(name string, desired cadata.Set, cost Cost, notify func(cadata.ID, bool))
- func (p *Planner) AttachSource(name string, source Source)
- func (p *Planner) Refresh(ctx context.Context) error
- func (p *Planner) RefreshSpan(ctx context.Context, span cadata.Span) error
- func (p *Planner) SinkChange(ctx context.Context, id cadata.ID) error
- func (p *Planner) SourceChange(ctx context.Context, id cadata.ID) error
- type ReadOnlySet
- type ReadOnlyStore
- type Sink
- type Source
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicTarget ¶
func (BasicTarget) Actual ¶
func (t BasicTarget) Actual() ReadOnlyStore
func (BasicTarget) Refresh ¶
func (t BasicTarget) Refresh(ctx context.Context, src ReadOnlyStore, desired ReadOnlySet) error
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller manages where to store blobs
func New ¶
New creates a new Controller getSet will be called to create sets for tracking the desired blobs in each sink.
func (*Controller) AttachSink ¶
func (c *Controller) AttachSink(name string, sink Sink)
func (*Controller) AttachSource ¶
func (c *Controller) AttachSource(name string, source Source)
func (*Controller) Close ¶
func (c *Controller) Close() error
func (*Controller) Flush ¶
func (c *Controller) Flush(ctx context.Context, source string) error
Flush blocks until any blobs pending for source have been persisted by the appropriate sinks.
type Cost ¶
type Cost struct { // Post is the cost to Post a blob Post float64 // Get is the cost to retreive a blob Get float64 // Delete is the cost to delete a blob Delete float64 // List is the cost to list n blobs List func(n int) float64 // BlobSecond is the cost to store 1 blob for 1 second BlobSecond float64 }
type Planner ¶
type Planner struct {
// contains filtered or unexported fields
}
func NewPlanner ¶
func (*Planner) AttachSink ¶
func (*Planner) AttachSource ¶
func (*Planner) Refresh ¶
Refresh causes the planner to reprocess all of the blobs in the attached sources.
func (*Planner) RefreshSpan ¶
type ReadOnlySet ¶
ReadOnlySet is a read-only cadata.Set
type Sink ¶
type Sink struct { Locus [32]byte MaxCount int64 Cost Cost // BatchSize is the size of batches passed to flush. // If BatchSize == 0. Then there is no batching for the Sink. // If BatchSize < 0. Then the magnitude is interpretted as the maximum number of concurrent operations. BatchSize int // BatchDelay is the longest an operation should be queued in a batch before pre-emptively // flushing a batch below BatchSize. BatchDelay time.Duration Target Target }
Sinks are places where blobs can be stored.
type Source ¶
type Source struct { Set ReadOnlySet ExpectedReplicas float64 }
Source provides blobs to be maintained by the controller
type Target ¶
type Target interface { // Actual returns a read only store with the actual content of the sink. Actual() ReadOnlyStore // FlushFunc is called to apply a batch of point operations to the target. Flush(ctx context.Context, ops []Op) error // Refresh is called to resync a target. Refresh(ctx context.Context, src ReadOnlyStore, desired ReadOnlySet) error }
Click to show internal directories.
Click to hide internal directories.