nativelog

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2026 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package nativelog holds the integration cases for native self-storage of a node's own log events. A suite starts one node at a time and describes how to start it in SharedContext.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DisabledFlags leaves native logging off, its default, and prints info
	// lines, so a case can see that a node logged a line it did not store.
	DisabledFlags = []string{"--logging-level=info"}
)

Functions

func AwaitQueryable

func AwaitQueryable(conn *grpc.ClientConn)

AwaitQueryable waits until a query of the log stream through conn succeeds. A cluster query fails while the liaison or a data node does not know the stream yet. A truncated answer is still an answer, so it ends the wait.

Types

type Context

type Context struct {
	// Start starts a node with native logging on, on a data directory of its
	// own.
	Start Starter
	// StartDisabled starts a node with native logging off, its default.
	StartDisabled Starter
	// Restart starts a node with native logging on, always on the same data
	// directory, so the recovery case can stop one and start the next on the
	// data of the first.
	Restart Starter
	// Console reports what the console has printed in this process.
	Console func() string
	// Distributed tells the cases that Start returns a data node whose rows
	// are read through a liaison, and that the suite owns the node's lifetime.
	Distributed bool
	// Producer tells the cases that Start returns a producer with no storage
	// engine, such as backup or an FODC agent, started in this process after
	// the servers it writes to. The lines the process logs are stored under
	// its identity, but the startup lines were logged before it started.
	Producer bool
}

Context is what a suite provides to the cases.

var SharedContext Context

SharedContext is set by the suite before the specs run.

type Node

type Node struct {
	// Conn reaches the node's data.
	Conn       *grpc.ClientConn
	NodeID     string
	NodeType   string
	MetricsURL string
}

Node is a running server the cases query.

type Starter

type Starter func(extraFlags ...string) (Node, func())

Starter starts one node with extraFlags and returns it with a function that stops it. Only one node runs at a time, because the native sink and its configuration are process-global: a second node in the same process takes the sink over, and a node with native logging off stops collection for the whole process.

Jump to

Keyboard shortcuts

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