gen

package
Version: v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package gen is used in generating configurations for an entire Akutan cluster. It's used by the commands gen-local and gen-kube.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APISpec

type APISpec struct {
	// The number of API servers.
	Replicas int
	// Each API server is assigned an address on which to serve gRPC requests
	// from this list.
	GRPCPorts []string
	// Each API server is assigned an address on which to serve HTTP requests
	// from this list.
	HTTPPorts []string
}

An APISpec specifies the parameters of the API servers.

type Cluster

type Cluster []*Process

A Cluster is the output of Spec.Generate. It has one entry for every Akutan server, in some reasonable order. It does not describe the Akutan log or other dependencies; it only describes the Akutan servers.

func (Cluster) Filter

func (cluster Cluster) Filter(procType ProcessType) []*Process

Filter returns the processes in the cluster that have a Type matching 'procType'.

type HashPOSpec

type HashPOSpec struct {
	// The number of ways to split the HashPO space.
	Partitions int
	// The number of HashPO disk view servers per partition.
	Replicas int
}

A HashPOSpec specifies the parameters of the disk view servers for the hash(predicate+object) space.

type HashSPSpec

type HashSPSpec struct {
	// The number of ways to split the HashSP space.
	Partitions int
	// The number of HashSP disk view servers per partition.
	Replicas int
}

A HashSPSpec specifies the parameters of the disk view servers for the hash(subject+predicate) space.

type Process

type Process struct {
	// A human-readable name for the process, like "akutan-api-01".
	Name string
	// The role of the server.
	Type ProcessType
	// The dedicated configuration for this server.
	Cfg *config.Akutan
	// This is not set by this module but is convenient for users. If non-nil,
	// it is the filepath to where 'Cfg' should be written.
	CfgPath string
}

A Process describes one Akutan server.

type ProcessType

type ProcessType string

ProcessType is used in Process.Type to specify the role of the server. The string values are the same as the names of the executable binaries (like "akutan-api").

const (
	APIProcess      ProcessType = "akutan-api"
	DiskViewProcess ProcessType = "akutan-diskview"
	TxTimerProcess  ProcessType = "akutan-txview"
)

Possible values for ProcessType.

type Spec

type Spec struct {
	// A configuration to copy as the basis of each server's configuration. This
	// allows users to pass through various configuration options that this
	// package does not need to know about.
	BaseCfg *config.Akutan

	// Parameters for various aspects of the cluster.
	API       APISpec
	Views     ViewsSpec
	TxTimeout TxTimeoutSpec
	HashPO    HashPOSpec
	HashSP    HashSPSpec
}

A Spec specifies the parameters of the cluster. It does not describe the Akutan log or other dependencies; it only describes the Akutan servers.

func (*Spec) Generate

func (spec *Spec) Generate() (Cluster, error)

Generate produces a Cluster based on the given spec. If it cannot, it returns an error.

type TxTimeoutSpec

type TxTimeoutSpec struct {
	// The number of TxTimeout servers.
	Replicas int
}

A TxTimeoutSpec specifies the parameters of the transaction timeout view servers.

type ViewsSpec

type ViewsSpec struct {
	// Each view server is assigned an address on which to serve gRPC requests
	// from this list.
	GRPCPorts []string
	// Each view server is assigned an address on which to serve its metrics
	// from this list.
	HTTPPorts []string
}

A ViewsSpec specifies the parameters of the view servers.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL