server

package
v1.1.0-alpha-7 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 26 Imported by: 4

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 {
	K          int
	M          int
	BlockSize  int // size of each block, used as hint for the flusher buffer size
	ListenAddr string
	FlushSize  int
	FlushTime  int
	PrivKey    string
	HexNonce   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 K and M 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, poolFactory tlog.RedisPoolFactory) (*Server, error)

NewServer creates a new tlog server

func (*Server) IgnoreSignalOnce

func (s *Server) IgnoreSignalOnce(sig os.Signal)

IgnoreSignalOnce ignore incoming signal once It only being executed during test

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) ReadDecodeBlock

func (s *Server) ReadDecodeBlock(r io.Reader) (*schema.TlogBlock, error)

ReadDecodeBlock reads and decodes tlog block message from client

Jump to

Keyboard shortcuts

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