distributor

package
v0.0.0-...-71dce46 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2017 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package distributor is a complex implementation of a Torus storage interface, that understands rebalancing it's underlying storage and fetching data from peers, as necessary.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoPeersBlock = errors.New("distributor: no peers available for a block")
)

Functions

func ListenReplication

func ListenReplication(s *torus.Server, addr *url.URL) error

ListenReplication opens the internal networking port and connects to the cluster

func OpenReplication

func OpenReplication(s *torus.Server) error

OpenReplication connects to the cluster without opening the internal networking.

Types

type Distributor

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

func (*Distributor) Block

func (d *Distributor) Block(ctx context.Context, ref torus.BlockRef) ([]byte, error)

func (*Distributor) BlockIterator

func (d *Distributor) BlockIterator() torus.BlockIterator

func (*Distributor) BlockSize

func (d *Distributor) BlockSize() uint64

func (*Distributor) Close

func (d *Distributor) Close() error

func (*Distributor) DeleteBlock

func (d *Distributor) DeleteBlock(ctx context.Context, i torus.BlockRef) error

func (*Distributor) Flush

func (d *Distributor) Flush() error

func (*Distributor) GetBlock

func (d *Distributor) GetBlock(ctx context.Context, i torus.BlockRef) ([]byte, error)

func (*Distributor) HasBlock

func (d *Distributor) HasBlock(ctx context.Context, i torus.BlockRef) (bool, error)

func (*Distributor) Kind

func (d *Distributor) Kind() string

func (*Distributor) NumBlocks

func (d *Distributor) NumBlocks() uint64

func (*Distributor) PutBlock

func (d *Distributor) PutBlock(ctx context.Context, ref torus.BlockRef, data []byte) error

PutBlock server side implementation which is called from RPC client.

func (*Distributor) RebalanceCheck

func (d *Distributor) RebalanceCheck(ctx context.Context, refs []torus.BlockRef) ([]bool, error)

func (*Distributor) Ring

func (d *Distributor) Ring() torus.Ring

func (*Distributor) UUID

func (d *Distributor) UUID() string

func (*Distributor) UsedBlocks

func (d *Distributor) UsedBlocks() uint64

func (*Distributor) WriteBlock

func (d *Distributor) WriteBlock(ctx context.Context, i torus.BlockRef, data []byte) error

func (*Distributor) WriteBuf

func (d *Distributor) WriteBuf(ctx context.Context, i torus.BlockRef) ([]byte, error)

Directories

Path Synopsis
Package protocols is the metapackage for the RPC protocols for how Torus' storage layer communicates with other storage servers.
Package protocols is the metapackage for the RPC protocols for how Torus' storage layer communicates with other storage servers.
tdp
Package rebalance provides the implementation of the rebalancer, which continually checks the data stored on a host, knows where data should live, and moves it to the appropriate servers.
Package rebalance provides the implementation of the rebalancer, which continually checks the data stored on a host, knows where data should live, and moves it to the appropriate servers.

Jump to

Keyboard shortcuts

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