server

package
v1.1.0-alpha-4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: Apache-2.0 Imports: 23 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 {
	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
	ConfigPath string // config file path
	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, poolFactory tlog.RedisPoolFactory) (*Server, error)

NewServer creates a new tlog server

func (*Server) Listen

func (s *Server) Listen()

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