server

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(ctx context.Context, cfg *Config) error

Start starts the logrange server using the configuration provided. It will stop it as soon as ctx is closed

Types

type Config

type Config struct {

	// BaseDir is the directory where ALL logrange data will be stored. Default is /opt/logrange/data
	BaseDir string

	// HostHostId defines the host unique identifier, if not set, then it will
	// be assigned automatically
	HostHostId cluster.HostId

	// HostLeaseTTLSec defines the Lease timeout in second, for registering
	// Host in the storage
	HostLeaseTTLSec int

	// HostRegisterTimeoutSec defines how long the host will try to register in
	// the storage until it is successfuly registered or stop. 0 value means
	// the timeout will be ignored
	HostRegisterTimeoutSec int

	// PublicApiRpc represents the transport configuration for public RPC API
	PublicApiRpc transport.Config

	// PrivateApiRpc represents the transport configuration for private RPC API
	PrivateApiRpc transport.Config

	// JrnlCtrlConfig an implementation of
	JrnlCtrlConfig JCtrlrConfig

	// PipesConfig contains default configuration for pipes
	PipesConfig pipe.PipesConfig

	// NewTIndexOk shows whether the new tindex file could be created if it doesn't exist
	NewTIndexOk bool
}

Config struct defines logragnge server settings

func GetDefaultConfig

func GetDefaultConfig() *Config

func ReadConfigFromFile

func ReadConfigFromFile(filename string) (*Config, error)

func (*Config) Apply

func (c *Config) Apply(cfg *Config)

Apply override c's properties by non-default values from cfg

func (*Config) HostId

func (c *Config) HostId() cluster.HostId

HostId is a part of model.HostRegistryConfig

func (*Config) LeaseTTL

func (c *Config) LeaseTTL() time.Duration

LeaseTTL is a part of model.HostRegistryConfig

func (*Config) Localhost

func (c *Config) Localhost() model.HostInfo

Localhost is a part of model.HostRegistryConfig

func (*Config) RegisterTimeout

func (c *Config) RegisterTimeout() time.Duration

RegisterTimeout is a part of model.HostRegistryConfig

func (*Config) String

func (c *Config) String() string

type JCtrlrConfig

type JCtrlrConfig struct {

	// JournalsDir the direcotry where journals are stored
	JournalsDir string

	// MaxOpenFileDescs defines how many file descriptors could be used
	// for read operations
	MaxOpenFileDescs int

	// CheckFullScan defines that the FullCheck() of IdxChecker will be
	// called. Normally LightCheck() is called only.
	CheckFullScan bool

	// RecoverDisabled flag defines that actual recover procedure should not
	// be run when the check chunk data test is failed.
	RecoverDisabled bool

	// RecoverLostDataOk flag defines that the chunk file could be truncated
	// if the file is partually corrupted.
	RecoverLostDataOk bool

	// WriteIdleSec specifies the writer idle timeout. It will be closed if no
	// write ops happens during the timeout
	WriteIdleSec int

	// WriteFlushMs specifies data sync timeout. Buffers will be synced after
	// last write operation.
	WriteFlushMs int

	// MaxChunkSize defines the maximum chunk size.
	MaxChunkSize int64

	// MaxRecordSize defines the maimum one record size
	MaxRecordSize int64
}

func GetDefaultJCtrlrConfig

func GetDefaultJCtrlrConfig() JCtrlrConfig

func (*JCtrlrConfig) Apply

func (c *JCtrlrConfig) Apply(cfg *JCtrlrConfig)

func (*JCtrlrConfig) FdPoolSize

func (c *JCtrlrConfig) FdPoolSize() int

FdPoolSize returns size of chunk.FdPool

func (*JCtrlrConfig) GetChunkConfig

func (c *JCtrlrConfig) GetChunkConfig() chunkfs.Config

GetChunkConfig returns chunkfs.Config object, which will be used for constructing chunks

func (*JCtrlrConfig) StorageDir

func (c *JCtrlrConfig) StorageDir() string

StorageDir returns path to the dir on the local File system, where journals are stored

func (JCtrlrConfig) String

func (c JCtrlrConfig) String() string

Jump to

Keyboard shortcuts

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