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: 0

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