server

package
v1.1.0-alpha-8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockResponse

type BlockResponse struct {
	Status    int8
	Sequences []uint64
}

BlockResponse defines response for block operations(recv, flush)

func (*BlockResponse) Write

func (r *BlockResponse) Write(w io.Writer, segmentBuf []byte) error

Write encode and writes this response to the given io.Writer

type Config

type Config struct {
	DataShards   int
	ParityShards int
	BlockSize    int // size of each block, used as hint for the flusher buffer size
	ListenAddr   string
	FlushSize    int
	FlushTime    int
	PrivKey      string
	AggMq        *aggmq.MQ
}

Config used for creating the tlogserver

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig creates a new config, using sane defaults

func (*Config) RequiredDataServers

func (conf *Config) RequiredDataServers() int

RequiredDataServers returns how many data servers are required, based on the DataShards and ParityShards values.

type Server

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

Server defines a tlog server

func NewServer

func NewServer(conf *Config, configSource config.Source) (*Server, error)

NewServer creates a new tlog server

func (*Server) Listen

func (s *Server) Listen(ctx context.Context)

Listen to incoming (tcp) Requests

func (*Server) ListenAddr

func (s *Server) ListenAddr() string

ListenAddr returns the address the (tcp) server is listening on

func (*Server) ReadDecodeClientMessage

func (s *Server) ReadDecodeClientMessage(r io.Reader) (*schema.TlogClientMessage, error)

ReadDecodeClientMessage reads and decodes tlog message from client

Jump to

Keyboard shortcuts

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