core

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package core - Core Burrow logic. The core package is where all the internal logic for Burrow is located. It provides several helpers for setting up logging and application management (such as PID files), as well as the Start method that runs Burrow itself.

The documentation for the rest of the internals, including all the available modules, is available at https://godoc.org/github.com/linkedin/Burrow/core/internal/?m=all. For the most part, end users of Burrow should not need to refer to this documentation, as it is targeted at developers of Burrow modules. Details on what modules are available and how to configure them are available at https://github.com/linkedin/Burrow/wiki

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndCreatePidFile

func CheckAndCreatePidFile(filename string) bool

CheckAndCreatePidFile takes a single argument, which is the path to a PID file (a file that contains a single integer, which is the process ID of a running process). If this file exists, and if the PID is that of a running process, return false as that indicates another copy of this process is already running. Otherwise, create the file and write this process's PID to the file and return true. Any error doing this (such as not having permissions to write the file) will return false.

This func should be called when Burrow starts to prevent multiple copies from running.

func ConfigureLogger

func ConfigureLogger() (*zap.Logger, *zap.AtomicLevel)

ConfigureLogger returns a configured zap.Logger which can be used by Burrow for all logging. It also returns a zap.AtomicLevel, which can be used to dynamically adjust the level of the logger. The configuration for the logger is read from viper, with the following defaults:

logging.level = info

If logging.filename (path to the log file) is provided, a rolling log file is set up using lumberjack. The configuration for that log file is read from viper, with the following defaults:

logging.maxsize = 100 logging.maxbackups = 10 logging.maxage = 30 logging.use-localtime = false logging.use-compression = false

func OpenOutLog

func OpenOutLog(filename string) *os.File

OpenOutLog takes a single argument, which is the path to a log file. This process's stdout and stderr are redirected to this log file. The os.File object is returned so that it can be managed.

func RemovePidFile

func RemovePidFile(filename string)

RemovePidFile takes a single argument, which is the path to a PID file. That file is deleted. This func should be called when Burrow exits.

func Start

func Start(app *protocol.ApplicationContext, exitChannel chan os.Signal) int

Start is called to start the Burrow application. This is exposed so that it is possible to use Burrow as a library from within another application. Prior to calling this func, the configuration must have been loaded by viper from some underlying source (e.g. a TOML configuration file, or explicitly set in code after reading from another source). This func will block upon being called.

If the calling application would like to control logging, it can pass a pointer to an instantiated protocol.ApplicationContext struct that has the Logger and LogLevel fields set. Otherwise, Start will create a logger based on configurations in viper.

exitChannel is a signal channel that is provided by the calling application in order to signal Burrow to shut down. Burrow does not currently check the signal type: if any message is received on the channel, or if the channel is closed, Burrow will exit and Start will return 0.

Start will return a 1 on any failure, including invalid configurations or a failure to start Burrow modules.

Types

This section is empty.

Directories

Path Synopsis
Package internal - Here be dragons.
Package internal - Here be dragons.
cluster
Package cluster - Kafka cluster subsystem.
Package cluster - Kafka cluster subsystem.
consumer
Package consumer - Kafka consumer subsystem.
Package consumer - Kafka consumer subsystem.
evaluator
Package evaluator - Group evaluation subsystem.
Package evaluator - Group evaluation subsystem.
helpers
Package helpers - Common utilities.
Package helpers - Common utilities.
httpserver
Package httpserver - HTTP API endpoint The httpserver subsystem provides an HTTP interface to Burrow that can be used to fetch information about the clusters and consumers it is monitoring.
Package httpserver - HTTP API endpoint The httpserver subsystem provides an HTTP interface to Burrow that can be used to fetch information about the clusters and consumers it is monitoring.
notifier
Package notifier - Status notification subsystem.
Package notifier - Status notification subsystem.
storage
Package storage - Data storage subsystem.
Package storage - Data storage subsystem.
zookeeper
Package zookeeper - Common Zookeeper subsystem.
Package zookeeper - Common Zookeeper subsystem.
Package protocol - Burrow types and interfaces.
Package protocol - Burrow types and interfaces.

Jump to

Keyboard shortcuts

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