luci: go.chromium.org/luci/rts/presubmit/eval/history Index | Files

package history

import "go.chromium.org/luci/rts/presubmit/eval/history"

Package history implements serialization and deserilization of historical records used for RTS evaluation.

RTS evaluation uses history files to emulate CQ behavior with a candidate RTS algorithm. Conceptually a history file is a sequence of Record protobuf messages, see https://source.chromium.org/chromium/infra/infra/+/master:go/src/go.chromium.org/luci/rts/presubmit/eval/proto/eval.proto. More specifically, it is a Zstd-compressed RecordIO-encoded sequence of Records.

TODO(nodir): consider generalizing. It might be needed for file graph storage.

Index

Package Files

doc.go reader.go writer.go

type Reader Uses

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

Reader deserializes historical records from an io.Reader.

func NewReader Uses

func NewReader(r io.Reader) *Reader

NewReader creates a Reader.

func OpenFile Uses

func OpenFile(path string) (*Reader, error)

OpenFile creates a Reader that reads data from a file. When done, call Close() on the returned Reader.

func (*Reader) Close Uses

func (r *Reader) Close() error

Close releases all resources and closes the underlying io.Reader.

func (*Reader) Read Uses

func (r *Reader) Read() (*evalpb.Record, error)

Read reads the next historical record. Returns io.EOF if there is no record.

type Writer Uses

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

Writer serializes historical records to an io.Writer.

func CreateFile Uses

func CreateFile(path string) (*Writer, error)

CreateFile returns Writer that persists data to a new file. When done, call Close() on the returned Writer.

func NewWriter Uses

func NewWriter(w io.Writer) *Writer

NewWriter creates a Writer.

func (*Writer) Close Uses

func (w *Writer) Close() error

Close flushes everything and closes the underlying io.Writer.

func (*Writer) Write Uses

func (w *Writer) Write(rec *evalpb.Record) error

Write writes a historical record.

Package history imports 6 packages (graph) and is imported by 1 packages. Updated 2020-11-27. Refresh now. Tools for package owners.