outputstore

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package outputstore persists output independently of execution scheduling.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutputLimit     = errors.New("run output limit reached")
	ErrSpoolLimit      = errors.New("executor output storage limit reached")
	ErrFinalized       = errors.New("output already finalized")
	ErrIdentity        = errors.New("output identity differs from admission")
	ErrAcknowledgement = errors.New("output acknowledgement conflicts with retained output")
)

Functions

This section is empty.

Types

type Frame

type Frame struct {
	Sequence  int64
	Timestamp time.Time
	Output    []byte
}

type Limits

type Limits struct {
	ControlReserveBytes int64
	RunBytes            int64
	RunFrames           int64
	NodeBytes           int64
	Runs                int64
}

func DefaultLimits

func DefaultLimits() Limits

type Run

type Run struct {
	ID                   uuid.UUID
	Binding              controlsession.Binding
	Version              uint32
	LastSequence         int64
	AcknowledgedSequence int64
	EmittedBytes         int64
	QueuedBytes          int64
	QueuedFrames         int64
	End                  *pb.DebugletOutputEnd
	EndAcknowledged      bool
	Receipt              *pb.DebugletOutputEnd
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB, limits Limits) (*Store, error)

func (*Store) Abandon

func (s *Store) Abandon(ctx context.Context, id uuid.UUID) error

Abandon releases a finished run's spool when the dispatcher can no longer accept it: output bound to an ended session resumes only over an enrolled credential, and the dispatcher finalizes the rest as interrupted itself.

func (*Store) AcceptTruncation

func (s *Store) AcceptTruncation(ctx context.Context, id uuid.UUID, end *pb.DebugletOutputEnd) error

AcceptTruncation records a dispatcher quota receipt separately from the producer's immutable end. The caller must first cancel and join the producer.

func (*Store) Acknowledge

func (s *Store) Acknowledge(ctx context.Context, id uuid.UUID, sequence int64, end *pb.DebugletOutputEnd) error

func (*Store) Admit

func (s *Store) Admit(ctx context.Context, id uuid.UUID, binding controlsession.Binding, version uint32) error

func (*Store) AdmitTx

func (s *Store) AdmitTx(ctx context.Context, tx *sql.Tx, id uuid.UUID, binding controlsession.Binding, version uint32) error

AdmitTx reserves output identity and quota in the caller's admission transaction. The scheduler uses this so an accepted queued run cannot lack output metadata.

func (*Store) Append

func (s *Store) Append(ctx context.Context, id uuid.UUID, timestamp time.Time, data []byte) (Frame, error)

Append returns only after the frame and its quota charge commit together.

func (*Store) Finish

func (s *Store) Finish(ctx context.Context, id uuid.UUID, status pb.DebugletOutputStatus, reason string) (*pb.DebugletOutputEnd, error)

func (*Store) Frames

func (s *Store) Frames(ctx context.Context, id uuid.UUID, after int64, limit int) ([]Frame, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id uuid.UUID) (Run, error)

func (*Store) InterruptOpen

func (s *Store) InterruptOpen(ctx context.Context) error

InterruptOpen records uncertainty about producers that died with the process. It grants no permission to replay their workloads.

func (*Store) Pending

func (s *Store) Pending(ctx context.Context, afterRunID string, limit int) ([]Run, error)

Pending is keyset-paged so a caller can make fair, bounded delivery passes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL