taskerror

package
v0.0.0-...-06bbdd4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PackageProps = packageprops.Props{
	WASMWASI:         packageprops.WASMBlocked,
	WASMJS:           packageprops.WASMBlocked,
	WASMFreestanding: packageprops.WASMBlocked,
}

PackageProps records this package's curated properties (ADR-0080). Seeded by `wasmsurvey props generate`; curate by hand, then `wasmsurvey props verify`.

View Source
var TaskErrorActiveFields = sync.OnceValue(func() []int {
	active := map[string]bool{"stringArray": true, "textArray": true}
	schema := cbdml.CreateSchemaFacts()
	out := make([]int, 0, 4+len(active)*8)
	for i, f := range schema.Fields() {
		name := f.Name
		switch {
		case strings.HasPrefix(name, "id:"),
			strings.HasPrefix(name, "ts:"),
			strings.HasPrefix(name, "lc:"):
			out = append(out, i)
		case strings.HasPrefix(name, "tv:"):
			rest := name[3:]
			colon := strings.IndexByte(rest, ':')
			if colon < 0 {
				continue
			}
			if active[rest[:colon]] {
				out = append(out, i)
			}
		}
	}
	return out
})

TaskErrorActiveFields is the column-index subset this kind populates in the runtime.facts Arrow schema. Lazily computed once via sync.OnceValue: scans cbdml.CreateSchemaFacts()'s tv:<section>:... field names against this kind's active sections plus the three plain prefixes (id:, ts:, lc:). Driven through RecordBuilder. SetActiveFields to skip per-row emit walks for unused columns.

View Source
var TaskErrorActiveSections = []int{9, 12}

TaskErrorActiveSections is the dml_cbor section-index subset this kind populates. Passed to InEntityFacts.SetActiveSections so the builder skips beginSection list-slot work for inactive sections.

Functions

func TaskErrorBuildEntities

func TaskErrorBuildEntities[
	StringArrayAttr TaskErrorStringArrayAttrI,
	StringArraySec TaskErrorStringArraySecI[StringArrayAttr, Ent],
	TextArrayAttr TaskErrorTextArrayAttrI,
	TextArraySec TaskErrorTextArraySecI[TextArrayAttr, Ent],
	Ent any,
	DML TaskErrorEntityI[
		StringArrayAttr, StringArraySec,
		TextArrayAttr, TextArraySec,
		Ent,
	],
](dml DML, c *TaskErrorColumns) (err error)

TaskErrorBuildEntities walks c row-by-row, drives dml's entity / section chain, and returns once every row has been committed. The dml argument's concrete type binds every type parameter via Go's type inference at the call site.

func TaskErrorFillFromArrow

func TaskErrorFillFromArrow[
	StringArrayAttrs TaskErrorStringArrayAttrsReadI,
	StringArrayMembs TaskErrorStringArrayMembsReadI,
	TextArrayAttrs TaskErrorTextArrayAttrsReadI,
	TextArrayMembs TaskErrorTextArrayMembsReadI,
](
	c *TaskErrorColumns,
	n int,
	idCol *array.Uint64,
	nkCol *array.Binary,
	tsCol *array.Timestamp,
	stringArrayAttrs StringArrayAttrs,
	stringArrayMembs StringArrayMembs,
	textArrayAttrs TextArrayAttrs,
	textArrayMembs TextArrayMembs,
) (err error)

TaskErrorFillFromArrow walks rec row-by-row and appends each entity's plain + tagged-section values into c. Plain columns enter as concrete Arrow accessors; per-section Attrs + Membs bind through type-parameter interfaces.

Types

type TaskErrorCodec

type TaskErrorCodec struct{}

TaskErrorCodec is the buscodec.CodecI bridge for TaskError. Encodes one row through dml_cbor; decodes via cborarrow.Convert + ra-Unmarshal + Row(0). Auto-registered in init() so callers using buscodec.Encode / Decode route through here instead of the CBOR fallback.

func (*TaskErrorCodec) ContentType

func (inst *TaskErrorCodec) ContentType() (ct string)

func (*TaskErrorCodec) Decode

func (inst *TaskErrorCodec) Decode(b []byte, v any) (err error)

func (*TaskErrorCodec) Encode

func (inst *TaskErrorCodec) Encode(v any) (b []byte, err error)

func (*TaskErrorCodec) Name

func (inst *TaskErrorCodec) Name() (n string)

type TaskErrorColumns

type TaskErrorColumns struct {
	FactId     []uint64
	NaturalKey [][]byte
	At         []time.Time

	TaskId    []string
	Reason    []string
	ErrorText []string
}

TaskErrorColumns is the SoA storage for batches of TaskError rows. All slices grow in lockstep — Len returns the row count.

func (*TaskErrorColumns) Append

func (c *TaskErrorColumns) Append(row TaskError)

Append pushes one AoS record into the SoA buffers.

Aliasing: slice and pointer fields (`[]T`, `*roaring.Bitmap`) are stored by reference, not copied. Callers must not mutate row.<F> after Append unless they want Marshal to read the mutation. Scalar fields (T, Option[T]) are copied by value.

func (*TaskErrorColumns) Len

func (c *TaskErrorColumns) Len() int

Len returns the number of rows currently in the batch.

func (*TaskErrorColumns) Marshal

func (c *TaskErrorColumns) Marshal(w io.Writer) (err error)

Marshal writes the SoA buffer to w as the sparse-CBOR wire format produced through factsschema/dml_cbor. Thin wrapper around TaskErrorBuildEntities — the per-row chain lives there and works against any leeway-DML class that structurally satisfies TaskErrorEntityI.

func (*TaskErrorColumns) Row

func (c *TaskErrorColumns) Row(i int) (row TaskError)

Row reconstructs entity i as an AoS TaskError record. Inverse of Append: slice / pointer fields are shared by reference (no defensive copy); scalar fields and Option[T] are copied.

func (*TaskErrorColumns) Unmarshal

func (c *TaskErrorColumns) Unmarshal(rec arrow.Record) (err error)

Unmarshal appends one row to c per entity in rec, projecting the runtime.facts columns through factsschema/ra. Thin wrapper around TaskErrorFillFromArrow — the per-row decode lives there.

type TaskErrorEntityI

type TaskErrorEntityI[
	StringArrayAttr TaskErrorStringArrayAttrI,
	StringArraySec TaskErrorStringArraySecI[StringArrayAttr, Ent],
	TextArrayAttr TaskErrorTextArrayAttrI,
	TextArraySec TaskErrorTextArraySecI[TextArrayAttr, Ent],
	Ent any,
] interface {
	BeginEntity() Ent
	SetId(id uint64, naturalKey []byte) Ent
	SetTimestamp(ts time.Time) Ent
	GetSectionStringArray() StringArraySec
	GetSectionTextArray() TextArraySec
	CommitEntity() (err error)
}

TaskErrorEntityI lists exactly the entity-level methods TaskError uses. Type parameters compose the per-section Attr + Sec interfaces; Ent is the entity type itself (return type of BeginEntity / SetId / SetTimestamp / SetLifecycle — usually the DML pointer).

type TaskErrorStringArrayAttrI

type TaskErrorStringArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

TaskErrorStringArrayAttrI is the InAttr-side view of the stringArray section. P-variants only — every method returns void so no F-bounded `[Self]` parameter is needed.

type TaskErrorStringArrayAttrsReadI

type TaskErrorStringArrayAttrsReadI interface {
	GetAttrValueSingleOrDefault(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) string
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

TaskErrorStringArrayAttrsReadI is the Attributes-side view of the stringArray section.

type TaskErrorStringArrayMembsReadI

type TaskErrorStringArrayMembsReadI interface {
	GetMembValueLowCardRef(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) iter.Seq[uint64]
}

TaskErrorStringArrayMembsReadI is the Memberships-side view of the stringArray section.

type TaskErrorStringArraySecI

type TaskErrorStringArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value string) Attr
	EndSection() Ent
}

TaskErrorStringArraySecI is the Section-side view: opens an attribute and closes the section. Attr and Ent are bound at the call site by inference.

type TaskErrorTextArrayAttrI

type TaskErrorTextArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

TaskErrorTextArrayAttrI is the InAttr-side view of the textArray section. P-variants only — every method returns void so no F-bounded `[Self]` parameter is needed.

type TaskErrorTextArrayAttrsReadI

type TaskErrorTextArrayAttrsReadI interface {
	GetAttrValueSingleOrDefault(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) string
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

TaskErrorTextArrayAttrsReadI is the Attributes-side view of the textArray section.

type TaskErrorTextArrayMembsReadI

type TaskErrorTextArrayMembsReadI interface {
	GetMembValueLowCardRef(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) iter.Seq[uint64]
}

TaskErrorTextArrayMembsReadI is the Memberships-side view of the textArray section.

type TaskErrorTextArraySecI

type TaskErrorTextArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value string) Attr
	EndSection() Ent
}

TaskErrorTextArraySecI is the Section-side view: opens an attribute and closes the section. Attr and Ent are bound at the call site by inference.

Jump to

Keyboard shortcuts

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