m1fixture

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package m1fixture is the ADR-0042 M1 demonstration fact kind: a flat DTO exercising every plain type the generator must support (string, uint{8,16,32,64}, float{32,64}, bool, time, [4]byte, [16]byte) under both `Membership` + `ExactlyOne` and `Membership` + `ZeroToOne` cardinalities.

The DTO in this file is the **input** the generator will parse (the human-authored "schema source"); the file `fixture.out.go` is the generator's eventual output, hand-written here so the wire shape can be validated against clickhouse-local before the generator binary lands. See keelson/vdd/EXPLANATION.md for the model the generator respects.

keelson/vdd/EXPLANATION.md: ../../../vdd/EXPLANATION.md

Index

Constants

This section is empty.

Variables

View Source
var M1SampleActiveFields = sync.OnceValue(func() []int {
	active := map[string]bool{"blobArray": true, "bool": true, "f32Array": true, "f64Array": true, "stringArray": true, "symbol": true, "textArray": true, "timeArray": true, "u16Array": true, "u32Array": true, "u64Array": true, "u8Array": 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
})

M1SampleActiveFields is the column-index subset this kind populates in the boxer.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 M1SampleActiveSections = []int{0, 1, 2, 3, 9, 10, 12, 13, 14, 15, 18, 20}

M1SampleActiveSections 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.

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 `boxer code analysis golang wasmsurvey props generate`; curate by hand. The same group's `props verify` reconciles it.

Functions

func M1SampleAddSections added in v0.0.12

func M1SampleAddSections[
	SymbolAttr M1SampleSymbolAttrI,
	SymbolSec M1SampleSymbolSecI[SymbolAttr, Ent],
	U8ArrayAttr M1SampleU8ArrayAttrI,
	U8ArraySec M1SampleU8ArraySecI[U8ArrayAttr, Ent],
	U16ArrayAttr M1SampleU16ArrayAttrI,
	U16ArraySec M1SampleU16ArraySecI[U16ArrayAttr, Ent],
	U32ArrayAttr M1SampleU32ArrayAttrI,
	U32ArraySec M1SampleU32ArraySecI[U32ArrayAttr, Ent],
	U64ArrayAttr M1SampleU64ArrayAttrI,
	U64ArraySec M1SampleU64ArraySecI[U64ArrayAttr, Ent],
	F32ArrayAttr M1SampleF32ArrayAttrI,
	F32ArraySec M1SampleF32ArraySecI[F32ArrayAttr, Ent],
	F64ArrayAttr M1SampleF64ArrayAttrI,
	F64ArraySec M1SampleF64ArraySecI[F64ArrayAttr, Ent],
	BoolAttr M1SampleBoolAttrI,
	BoolSec M1SampleBoolSecI[BoolAttr, Ent],
	BlobArrayAttr M1SampleBlobArrayAttrI,
	BlobArraySec M1SampleBlobArraySecI[BlobArrayAttr, Ent],
	TimeArrayAttr M1SampleTimeArrayAttrI,
	TimeArraySec M1SampleTimeArraySecI[TimeArrayAttr, Ent],
	StringArrayAttr M1SampleStringArrayAttrI,
	StringArraySec M1SampleStringArraySecI[StringArrayAttr, Ent],
	TextArrayAttr M1SampleTextArrayAttrI,
	TextArraySec M1SampleTextArraySecI[TextArrayAttr, Ent],
	Ent any,
	DML M1SampleEntityI[
		SymbolAttr, SymbolSec,
		U8ArrayAttr, U8ArraySec,
		U16ArrayAttr, U16ArraySec,
		U32ArrayAttr, U32ArraySec,
		U64ArrayAttr, U64ArraySec,
		F32ArrayAttr, F32ArraySec,
		F64ArrayAttr, F64ArraySec,
		BoolAttr, BoolSec,
		BlobArrayAttr, BlobArraySec,
		TimeArrayAttr, TimeArraySec,
		StringArrayAttr, StringArraySec,
		TextArrayAttr, TextArraySec,
		Ent,
	],
](dml DML, row M1Sample) (err error)

M1SampleAddSections contributes this kind's tagged sections to the OPEN entity on dml — the BuildEntities body without the entity frame. The caller owns BeginEntity / plain setters / CommitEntity.

func M1SampleBuildEntities

func M1SampleBuildEntities[
	SymbolAttr M1SampleSymbolAttrI,
	SymbolSec M1SampleSymbolSecI[SymbolAttr, Ent],
	U8ArrayAttr M1SampleU8ArrayAttrI,
	U8ArraySec M1SampleU8ArraySecI[U8ArrayAttr, Ent],
	U16ArrayAttr M1SampleU16ArrayAttrI,
	U16ArraySec M1SampleU16ArraySecI[U16ArrayAttr, Ent],
	U32ArrayAttr M1SampleU32ArrayAttrI,
	U32ArraySec M1SampleU32ArraySecI[U32ArrayAttr, Ent],
	U64ArrayAttr M1SampleU64ArrayAttrI,
	U64ArraySec M1SampleU64ArraySecI[U64ArrayAttr, Ent],
	F32ArrayAttr M1SampleF32ArrayAttrI,
	F32ArraySec M1SampleF32ArraySecI[F32ArrayAttr, Ent],
	F64ArrayAttr M1SampleF64ArrayAttrI,
	F64ArraySec M1SampleF64ArraySecI[F64ArrayAttr, Ent],
	BoolAttr M1SampleBoolAttrI,
	BoolSec M1SampleBoolSecI[BoolAttr, Ent],
	BlobArrayAttr M1SampleBlobArrayAttrI,
	BlobArraySec M1SampleBlobArraySecI[BlobArrayAttr, Ent],
	TimeArrayAttr M1SampleTimeArrayAttrI,
	TimeArraySec M1SampleTimeArraySecI[TimeArrayAttr, Ent],
	StringArrayAttr M1SampleStringArrayAttrI,
	StringArraySec M1SampleStringArraySecI[StringArrayAttr, Ent],
	TextArrayAttr M1SampleTextArrayAttrI,
	TextArraySec M1SampleTextArraySecI[TextArrayAttr, Ent],
	Ent any,
	DML M1SampleEntityI[
		SymbolAttr, SymbolSec,
		U8ArrayAttr, U8ArraySec,
		U16ArrayAttr, U16ArraySec,
		U32ArrayAttr, U32ArraySec,
		U64ArrayAttr, U64ArraySec,
		F32ArrayAttr, F32ArraySec,
		F64ArrayAttr, F64ArraySec,
		BoolAttr, BoolSec,
		BlobArrayAttr, BlobArraySec,
		TimeArrayAttr, TimeArraySec,
		StringArrayAttr, StringArraySec,
		TextArrayAttr, TextArraySec,
		Ent,
	],
](dml DML, c *M1SampleColumns) (err error)

M1SampleBuildEntities 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 M1SampleEmitSectionBlobArray added in v0.0.20

func M1SampleEmitSectionBlobArray[
	BlobArrayAttr M1SampleBlobArrayAttrI,
	BlobArraySec M1SampleBlobArraySecI[BlobArrayAttr, Ent],
	Ent any,
](blobArraySec BlobArraySec, row M1Sample) (err error)

M1SampleEmitSectionBlobArray writes this kind's blobArray attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionBool added in v0.0.20

func M1SampleEmitSectionBool[
	BoolAttr M1SampleBoolAttrI,
	BoolSec M1SampleBoolSecI[BoolAttr, Ent],
	Ent any,
](boolSec BoolSec, row M1Sample) (err error)

M1SampleEmitSectionBool writes this kind's bool attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionF32Array added in v0.0.20

func M1SampleEmitSectionF32Array[
	F32ArrayAttr M1SampleF32ArrayAttrI,
	F32ArraySec M1SampleF32ArraySecI[F32ArrayAttr, Ent],
	Ent any,
](f32ArraySec F32ArraySec, row M1Sample) (err error)

M1SampleEmitSectionF32Array writes this kind's f32Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionF64Array added in v0.0.20

func M1SampleEmitSectionF64Array[
	F64ArrayAttr M1SampleF64ArrayAttrI,
	F64ArraySec M1SampleF64ArraySecI[F64ArrayAttr, Ent],
	Ent any,
](f64ArraySec F64ArraySec, row M1Sample) (err error)

M1SampleEmitSectionF64Array writes this kind's f64Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionStringArray added in v0.0.20

func M1SampleEmitSectionStringArray[
	StringArrayAttr M1SampleStringArrayAttrI,
	StringArraySec M1SampleStringArraySecI[StringArrayAttr, Ent],
	Ent any,
](stringArraySec StringArraySec, row M1Sample) (err error)

M1SampleEmitSectionStringArray writes this kind's stringArray attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionSymbol added in v0.0.20

func M1SampleEmitSectionSymbol[
	SymbolAttr M1SampleSymbolAttrI,
	SymbolSec M1SampleSymbolSecI[SymbolAttr, Ent],
	Ent any,
](symbolSec SymbolSec, row M1Sample) (err error)

M1SampleEmitSectionSymbol writes this kind's symbol attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionTextArray added in v0.0.20

func M1SampleEmitSectionTextArray[
	TextArrayAttr M1SampleTextArrayAttrI,
	TextArraySec M1SampleTextArraySecI[TextArrayAttr, Ent],
	Ent any,
](textArraySec TextArraySec, row M1Sample) (err error)

M1SampleEmitSectionTextArray writes this kind's textArray attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionTimeArray added in v0.0.20

func M1SampleEmitSectionTimeArray[
	TimeArrayAttr M1SampleTimeArrayAttrI,
	TimeArraySec M1SampleTimeArraySecI[TimeArrayAttr, Ent],
	Ent any,
](timeArraySec TimeArraySec, row M1Sample) (err error)

M1SampleEmitSectionTimeArray writes this kind's timeArray attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionU8Array added in v0.0.20

func M1SampleEmitSectionU8Array[
	U8ArrayAttr M1SampleU8ArrayAttrI,
	U8ArraySec M1SampleU8ArraySecI[U8ArrayAttr, Ent],
	Ent any,
](u8ArraySec U8ArraySec, row M1Sample) (err error)

M1SampleEmitSectionU8Array writes this kind's u8Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionU16Array added in v0.0.20

func M1SampleEmitSectionU16Array[
	U16ArrayAttr M1SampleU16ArrayAttrI,
	U16ArraySec M1SampleU16ArraySecI[U16ArrayAttr, Ent],
	Ent any,
](u16ArraySec U16ArraySec, row M1Sample) (err error)

M1SampleEmitSectionU16Array writes this kind's u16Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionU32Array added in v0.0.20

func M1SampleEmitSectionU32Array[
	U32ArrayAttr M1SampleU32ArrayAttrI,
	U32ArraySec M1SampleU32ArraySecI[U32ArrayAttr, Ent],
	Ent any,
](u32ArraySec U32ArraySec, row M1Sample) (err error)

M1SampleEmitSectionU32Array writes this kind's u32Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleEmitSectionU64Array added in v0.0.20

func M1SampleEmitSectionU64Array[
	U64ArrayAttr M1SampleU64ArrayAttrI,
	U64ArraySec M1SampleU64ArraySecI[U64ArrayAttr, Ent],
	Ent any,
](u64ArraySec U64ArraySec, row M1Sample) (err error)

M1SampleEmitSectionU64Array writes this kind's u64Array attributes into an ALREADY-OPEN section frame, and does not close it. The caller owns the frame: one kind's AddSections, or a builder deferring the close until every component that shares the section has written.

func M1SampleFillFromArrow

func M1SampleFillFromArrow[
	SymbolAttrs M1SampleSymbolAttrsReadI,
	SymbolMembs M1SampleSymbolMembsReadI,
	U8ArrayAttrs M1SampleU8ArrayAttrsReadI,
	U8ArrayMembs M1SampleU8ArrayMembsReadI,
	U16ArrayAttrs M1SampleU16ArrayAttrsReadI,
	U16ArrayMembs M1SampleU16ArrayMembsReadI,
	U32ArrayAttrs M1SampleU32ArrayAttrsReadI,
	U32ArrayMembs M1SampleU32ArrayMembsReadI,
	U64ArrayAttrs M1SampleU64ArrayAttrsReadI,
	U64ArrayMembs M1SampleU64ArrayMembsReadI,
	F32ArrayAttrs M1SampleF32ArrayAttrsReadI,
	F32ArrayMembs M1SampleF32ArrayMembsReadI,
	F64ArrayAttrs M1SampleF64ArrayAttrsReadI,
	F64ArrayMembs M1SampleF64ArrayMembsReadI,
	BoolAttrs M1SampleBoolAttrsReadI,
	BoolMembs M1SampleBoolMembsReadI,
	BlobArrayAttrs M1SampleBlobArrayAttrsReadI,
	BlobArrayMembs M1SampleBlobArrayMembsReadI,
	TimeArrayAttrs M1SampleTimeArrayAttrsReadI,
	TimeArrayMembs M1SampleTimeArrayMembsReadI,
	StringArrayAttrs M1SampleStringArrayAttrsReadI,
	StringArrayMembs M1SampleStringArrayMembsReadI,
	TextArrayAttrs M1SampleTextArrayAttrsReadI,
	TextArrayMembs M1SampleTextArrayMembsReadI,
](
	c *M1SampleColumns,
	n int,
	idCol *array.Uint64,
	nkCol *array.Binary,
	tsCol *array.Timestamp,
	symbolAttrs SymbolAttrs,
	symbolMembs SymbolMembs,
	u8ArrayAttrs U8ArrayAttrs,
	u8ArrayMembs U8ArrayMembs,
	u16ArrayAttrs U16ArrayAttrs,
	u16ArrayMembs U16ArrayMembs,
	u32ArrayAttrs U32ArrayAttrs,
	u32ArrayMembs U32ArrayMembs,
	u64ArrayAttrs U64ArrayAttrs,
	u64ArrayMembs U64ArrayMembs,
	f32ArrayAttrs F32ArrayAttrs,
	f32ArrayMembs F32ArrayMembs,
	f64ArrayAttrs F64ArrayAttrs,
	f64ArrayMembs F64ArrayMembs,
	boolAttrs BoolAttrs,
	boolMembs BoolMembs,
	blobArrayAttrs BlobArrayAttrs,
	blobArrayMembs BlobArrayMembs,
	timeArrayAttrs TimeArrayAttrs,
	timeArrayMembs TimeArrayMembs,
	stringArrayAttrs StringArrayAttrs,
	stringArrayMembs StringArrayMembs,
	textArrayAttrs TextArrayAttrs,
	textArrayMembs TextArrayMembs,
) (err error)

M1SampleFillFromArrow 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 M1Sample

type M1Sample struct {
	Id         uint64    `lw:",id"`
	NaturalKey []byte    `lw:",naturalKey"`
	Ts         time.Time `lw:",ts"`

	Source       string  `lw:"m1Source,symbol"`
	Severity     uint8   `lw:"m1Severity,u8Array"`
	MajorVer     uint16  `lw:"m1MajorVer,u16Array"`
	Sequence     uint32  `lw:"m1Sequence,u32Array"`
	LatencyNanos uint64  `lw:"m1LatencyNanos,u64Array"`
	CpuPct       float32 `lw:"m1CpuPct,f32Array"`
	LoadAvg1     float64 `lw:"m1LoadAvg1,f64Array"`
	Healthy      bool    `lw:"m1Healthy,bool"`

	PeerV4 [4]byte  `lw:"m1PeerV4,blobArray"`
	PeerV6 [16]byte `lw:"m1PeerV6,blobArray"`

	LastSuccess  option.Option[time.Time] `lw:"m1LastSuccess,timeArray"`
	OperatorName option.Option[string]    `lw:"m1OperatorName,stringArray"`
	Tags         []string                 `lw:"m1Tags,textArray"`
	CapBits      *roaring.Bitmap          `lw:"m1CapBits,u32Array"`
	// contains filtered or unexported fields
}

M1Sample is a synthetic fact kind: one row per "sample event"; the fields are chosen to exercise the M1 type matrix, not to model any real domain entity. Once the generator lands the first production fact kind, this fixture stays as a regression target.

Plain columns:

  • `id` (uint64) — caller-supplied row id
  • `naturalKey` ([]byte) — entity natural key (facts SetId is 2-arg)
  • `ts` (time.Time) — capture timestamp (UTC, nano precision via z64)

Tagged values:

  • Eight `Membership` + `ExactlyOne` fields covering symbol / u8 / u16 / u32 / u64 / f32 / f64 / bool.
  • Two `Membership` + `ExactlyOne` fixed-byte fields targeting the blob section (peerV4 = [4]byte IPv4, peerV6 = [16]byte IPv6).
  • Two `Membership` + `ZeroToOne` fields covering z64 (lastSuccess) and string (operatorName) via option.Option[T].

func M1SampleReadRow added in v0.0.12

func M1SampleReadRow[
	SymbolAttrs M1SampleSymbolAttrsReadI,
	SymbolMembs M1SampleSymbolMembsReadI,
	U8ArrayAttrs M1SampleU8ArrayAttrsReadI,
	U8ArrayMembs M1SampleU8ArrayMembsReadI,
	U16ArrayAttrs M1SampleU16ArrayAttrsReadI,
	U16ArrayMembs M1SampleU16ArrayMembsReadI,
	U32ArrayAttrs M1SampleU32ArrayAttrsReadI,
	U32ArrayMembs M1SampleU32ArrayMembsReadI,
	U64ArrayAttrs M1SampleU64ArrayAttrsReadI,
	U64ArrayMembs M1SampleU64ArrayMembsReadI,
	F32ArrayAttrs M1SampleF32ArrayAttrsReadI,
	F32ArrayMembs M1SampleF32ArrayMembsReadI,
	F64ArrayAttrs M1SampleF64ArrayAttrsReadI,
	F64ArrayMembs M1SampleF64ArrayMembsReadI,
	BoolAttrs M1SampleBoolAttrsReadI,
	BoolMembs M1SampleBoolMembsReadI,
	BlobArrayAttrs M1SampleBlobArrayAttrsReadI,
	BlobArrayMembs M1SampleBlobArrayMembsReadI,
	TimeArrayAttrs M1SampleTimeArrayAttrsReadI,
	TimeArrayMembs M1SampleTimeArrayMembsReadI,
	StringArrayAttrs M1SampleStringArrayAttrsReadI,
	StringArrayMembs M1SampleStringArrayMembsReadI,
	TextArrayAttrs M1SampleTextArrayAttrsReadI,
	TextArrayMembs M1SampleTextArrayMembsReadI,
](
	i int,
	symbolAttrs SymbolAttrs,
	symbolMembs SymbolMembs,
	u8ArrayAttrs U8ArrayAttrs,
	u8ArrayMembs U8ArrayMembs,
	u16ArrayAttrs U16ArrayAttrs,
	u16ArrayMembs U16ArrayMembs,
	u32ArrayAttrs U32ArrayAttrs,
	u32ArrayMembs U32ArrayMembs,
	u64ArrayAttrs U64ArrayAttrs,
	u64ArrayMembs U64ArrayMembs,
	f32ArrayAttrs F32ArrayAttrs,
	f32ArrayMembs F32ArrayMembs,
	f64ArrayAttrs F64ArrayAttrs,
	f64ArrayMembs F64ArrayMembs,
	boolAttrs BoolAttrs,
	boolMembs BoolMembs,
	blobArrayAttrs BlobArrayAttrs,
	blobArrayMembs BlobArrayMembs,
	timeArrayAttrs TimeArrayAttrs,
	timeArrayMembs TimeArrayMembs,
	stringArrayAttrs StringArrayAttrs,
	stringArrayMembs StringArrayMembs,
	textArrayAttrs TextArrayAttrs,
	textArrayMembs TextArrayMembs,
) (row M1Sample, present bool, err error)

M1SampleReadRow reads row i as one optional M1Sample component: presence- gated (a row carrying none of the kind's memberships yields present=false), membership-matched. A slot carrying more attributes than this kind's shape admits is an error, for every shape including containers. Plain- bound fields stay zero — the caller owns the envelope. The Attrs/Membs readers bind by type inference at the call site, as with FillFromArrow.

type M1SampleBlobArrayAttrI

type M1SampleBlobArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleBlobArrayAttrsReadI

type M1SampleBlobArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) ([]byte, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleBlobArrayAttrsReadI is the Attributes-side view of the blobArray section.

type M1SampleBlobArrayMembsReadI

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

M1SampleBlobArrayMembsReadI is the Memberships-side view of the blobArray section.

type M1SampleBlobArraySecI

type M1SampleBlobArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value []byte) Attr
	EndSection() Ent
}

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

type M1SampleBoolAttrI

type M1SampleBoolAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleBoolAttrsReadI

type M1SampleBoolAttrsReadI interface {
	GetAttrValueValue(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) bool
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleBoolAttrsReadI is the Attributes-side view of the bool section.

type M1SampleBoolMembsReadI

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

M1SampleBoolMembsReadI is the Memberships-side view of the bool section.

type M1SampleBoolSecI

type M1SampleBoolSecI[Attr any, Ent any] interface {
	BeginAttribute(value bool) Attr
	EndSection() Ent
}

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

type M1SampleCodec

type M1SampleCodec struct{}

M1SampleCodec is the buscodec.CodecI bridge for M1Sample. 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 (*M1SampleCodec) ContentType

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

func (*M1SampleCodec) Decode

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

func (*M1SampleCodec) Encode

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

func (*M1SampleCodec) Name

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

type M1SampleColumns

type M1SampleColumns struct {
	Id         []uint64
	NaturalKey [][]byte
	Ts         []time.Time

	Source          []string
	Severity        []uint8
	MajorVer        []uint16
	Sequence        []uint32
	LatencyNanos    []uint64
	CpuPct          []float32
	LoadAvg1        []float64
	Healthy         []bool
	PeerV4          [][4]byte
	PeerV6          [][16]byte
	LastSuccessVal  []time.Time
	LastSuccessHas  []bool
	OperatorNameVal []string
	OperatorNameHas []bool
	Tags            [][]string
	CapBits         []*roaring.Bitmap
}

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

func (*M1SampleColumns) Append

func (c *M1SampleColumns) Append(row M1Sample)

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 (*M1SampleColumns) Len

func (c *M1SampleColumns) Len() int

Len returns the number of rows currently in the batch.

func (*M1SampleColumns) Marshal

func (c *M1SampleColumns) 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 M1SampleBuildEntities — the per-row chain lives there and works against any leeway-DML class that structurally satisfies M1SampleEntityI.

func (*M1SampleColumns) Row

func (c *M1SampleColumns) Row(i int) (row M1Sample)

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

func (*M1SampleColumns) Unmarshal

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

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

type M1SampleEntityI

type M1SampleEntityI[
	SymbolAttr M1SampleSymbolAttrI,
	SymbolSec M1SampleSymbolSecI[SymbolAttr, Ent],
	U8ArrayAttr M1SampleU8ArrayAttrI,
	U8ArraySec M1SampleU8ArraySecI[U8ArrayAttr, Ent],
	U16ArrayAttr M1SampleU16ArrayAttrI,
	U16ArraySec M1SampleU16ArraySecI[U16ArrayAttr, Ent],
	U32ArrayAttr M1SampleU32ArrayAttrI,
	U32ArraySec M1SampleU32ArraySecI[U32ArrayAttr, Ent],
	U64ArrayAttr M1SampleU64ArrayAttrI,
	U64ArraySec M1SampleU64ArraySecI[U64ArrayAttr, Ent],
	F32ArrayAttr M1SampleF32ArrayAttrI,
	F32ArraySec M1SampleF32ArraySecI[F32ArrayAttr, Ent],
	F64ArrayAttr M1SampleF64ArrayAttrI,
	F64ArraySec M1SampleF64ArraySecI[F64ArrayAttr, Ent],
	BoolAttr M1SampleBoolAttrI,
	BoolSec M1SampleBoolSecI[BoolAttr, Ent],
	BlobArrayAttr M1SampleBlobArrayAttrI,
	BlobArraySec M1SampleBlobArraySecI[BlobArrayAttr, Ent],
	TimeArrayAttr M1SampleTimeArrayAttrI,
	TimeArraySec M1SampleTimeArraySecI[TimeArrayAttr, Ent],
	StringArrayAttr M1SampleStringArrayAttrI,
	StringArraySec M1SampleStringArraySecI[StringArrayAttr, Ent],
	TextArrayAttr M1SampleTextArrayAttrI,
	TextArraySec M1SampleTextArraySecI[TextArrayAttr, Ent],
	Ent any,
] interface {
	BeginEntity() Ent
	SetId(id uint64, naturalKey []byte) Ent
	SetTimestamp(ts time.Time) Ent
	GetSectionSymbol() SymbolSec
	GetSectionU8Array() U8ArraySec
	GetSectionU16Array() U16ArraySec
	GetSectionU32Array() U32ArraySec
	GetSectionU64Array() U64ArraySec
	GetSectionF32Array() F32ArraySec
	GetSectionF64Array() F64ArraySec
	GetSectionBool() BoolSec
	GetSectionBlobArray() BlobArraySec
	GetSectionTimeArray() TimeArraySec
	GetSectionStringArray() StringArraySec
	GetSectionTextArray() TextArraySec
	CommitEntity() (err error)
}

M1SampleEntityI is the entity-builder surface M1SampleAddSections drives. It always lists the per-section getters; the entity-frame methods (BeginEntity / plain setters / CommitEntity) are added only for the full codec's BuildEntities. AddSections stacks sections onto a frame the caller already owns, so it needs none of them — which lets a store drive it with a builder whose frame control is unexported (ADR-0100 SD6). Ent is the builder pointer.

type M1SampleF32ArrayAttrI

type M1SampleF32ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleF32ArrayAttrsReadI

type M1SampleF32ArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (float32, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleF32ArrayAttrsReadI is the Attributes-side view of the f32Array section.

type M1SampleF32ArrayMembsReadI

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

M1SampleF32ArrayMembsReadI is the Memberships-side view of the f32Array section.

type M1SampleF32ArraySecI

type M1SampleF32ArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value float32) Attr
	EndSection() Ent
}

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

type M1SampleF64ArrayAttrI

type M1SampleF64ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleF64ArrayAttrsReadI

type M1SampleF64ArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (float64, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleF64ArrayAttrsReadI is the Attributes-side view of the f64Array section.

type M1SampleF64ArrayMembsReadI

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

M1SampleF64ArrayMembsReadI is the Memberships-side view of the f64Array section.

type M1SampleF64ArraySecI

type M1SampleF64ArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value float64) Attr
	EndSection() Ent
}

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

type M1SampleStringArrayAttrI

type M1SampleStringArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

M1SampleStringArrayAttrI 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 M1SampleStringArrayAttrsReadI

type M1SampleStringArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (string, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

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

type M1SampleStringArrayMembsReadI

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

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

type M1SampleStringArraySecI

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

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

type M1SampleSymbolAttrI

type M1SampleSymbolAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleSymbolAttrsReadI

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

M1SampleSymbolAttrsReadI is the Attributes-side view of the symbol section.

type M1SampleSymbolMembsReadI

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

M1SampleSymbolMembsReadI is the Memberships-side view of the symbol section.

type M1SampleSymbolSecI

type M1SampleSymbolSecI[Attr any, Ent any] interface {
	BeginAttribute(value string) Attr
	EndSection() Ent
}

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

type M1SampleTextArrayAttrI

type M1SampleTextArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	AddToContainerP(value string)
	EndAttributeP()
}

M1SampleTextArrayAttrI 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 M1SampleTextArrayAttrsReadI

type M1SampleTextArrayAttrsReadI interface {
	GetAttrValueValue(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) iter.Seq[string]
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

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

type M1SampleTextArrayMembsReadI

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

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

type M1SampleTextArraySecI

type M1SampleTextArraySecI[Attr any, Ent any] interface {
	BeginAttribute() Attr
	EndSection() Ent
}

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

type M1SampleTimeArrayAttrI

type M1SampleTimeArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleTimeArrayAttrsReadI

type M1SampleTimeArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (time.Time, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleTimeArrayAttrsReadI is the Attributes-side view of the timeArray section.

type M1SampleTimeArrayMembsReadI

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

M1SampleTimeArrayMembsReadI is the Memberships-side view of the timeArray section.

type M1SampleTimeArraySecI

type M1SampleTimeArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value time.Time) Attr
	EndSection() Ent
}

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

type M1SampleU8ArrayAttrI

type M1SampleU8ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleU8ArrayAttrsReadI

type M1SampleU8ArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (uint8, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleU8ArrayAttrsReadI is the Attributes-side view of the u8Array section.

type M1SampleU8ArrayMembsReadI

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

M1SampleU8ArrayMembsReadI is the Memberships-side view of the u8Array section.

type M1SampleU8ArraySecI

type M1SampleU8ArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value uint8) Attr
	EndSection() Ent
}

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

type M1SampleU16ArrayAttrI

type M1SampleU16ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleU16ArrayAttrsReadI

type M1SampleU16ArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (uint16, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleU16ArrayAttrsReadI is the Attributes-side view of the u16Array section.

type M1SampleU16ArrayMembsReadI

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

M1SampleU16ArrayMembsReadI is the Memberships-side view of the u16Array section.

type M1SampleU16ArraySecI

type M1SampleU16ArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value uint16) Attr
	EndSection() Ent
}

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

type M1SampleU32ArrayAttrI

type M1SampleU32ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	AddToContainerP(value uint32)
	EndAttributeP()
}

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

type M1SampleU32ArrayAttrsReadI

type M1SampleU32ArrayAttrsReadI interface {
	GetAttrValueValue(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) iter.Seq[uint32]
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (uint32, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleU32ArrayAttrsReadI is the Attributes-side view of the u32Array section.

type M1SampleU32ArrayMembsReadI

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

M1SampleU32ArrayMembsReadI is the Memberships-side view of the u32Array section.

type M1SampleU32ArraySecI

type M1SampleU32ArraySecI[Attr any, Ent any] interface {
	BeginAttribute() Attr
	BeginAttributeSingle(value uint32) Attr
	EndSection() Ent
}

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

type M1SampleU64ArrayAttrI

type M1SampleU64ArrayAttrI interface {
	dmlruntime.InAttributeMembershipLowCardRefPI
	EndAttributeP()
}

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

type M1SampleU64ArrayAttrsReadI

type M1SampleU64ArrayAttrsReadI interface {
	GetAttrValueSingle(entityIdx raruntime.EntityIdx, attrIdx raruntime.AttributeIdx) (uint64, error)
	GetNumberOfAttributes(entityIdx raruntime.EntityIdx) int64
}

M1SampleU64ArrayAttrsReadI is the Attributes-side view of the u64Array section.

type M1SampleU64ArrayMembsReadI

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

M1SampleU64ArrayMembsReadI is the Memberships-side view of the u64Array section.

type M1SampleU64ArraySecI

type M1SampleU64ArraySecI[Attr any, Ent any] interface {
	BeginAttributeSingle(value uint64) Attr
	EndSection() Ent
}

M1SampleU64ArraySecI 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