coordinator

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ID         string       `validate:"required"`
	Parameters *viper.Viper `validate:"required"`
	Hub        *hub.Hub     `validate:"required"`
}

Config defines the running paramers of the Coordinator

type Coordinator

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

Coordinator is a virtual proxy composed out of several coordinator.Coordinator processing layers

func New

func New(config Config) (*Coordinator, error)

New returns a logical proxy Coordinator. It is used to store metadata to third-party databases

func (*Coordinator) Capabilities

func (c *Coordinator) Capabilities() []selector.Capability

Capabilities returns the capabilities of the Coordinator

func (*Coordinator) Close

func (c *Coordinator) Close() error

Close terminates the coordinator

func (*Coordinator) CreateIfNotExist

func (c *Coordinator) CreateIfNotExist(key string) error

CreateIfNotExist creates a new logical file if it does not exists. If it exists, it returns an error

func (*Coordinator) CreateOrReset

func (c *Coordinator) CreateOrReset(key string) error

CreateOrReset creates a new logical file if it does not exist. If it exists, it resets all of the contents

func (*Coordinator) Info

func (c *Coordinator) Info(key string) ([][]byte, coordinator.Info, error)

Info returns information for the key

func (*Coordinator) Location

func (c *Coordinator) Location() string

Location returns the node where the Coordinator is running

func (*Coordinator) SetBackend

func (c *Coordinator) SetBackend(_ coordinator.Coordinator)

SetBackend defines the backend for the current device layer

func (*Coordinator) SetLandmark

func (c *Coordinator) SetLandmark(key string, mark coordinator.Landmark) error

SetLandmark appends a landmark to the update log.

func (*Coordinator) String

func (c *Coordinator) String() string

String returns a descriptor for the current device layer

func (*Coordinator) UpdateEnd

func (c *Coordinator) UpdateEnd(key string, tid string, record []byte) error

UpdateEnd appends a new entry on the update log to store metadata of a client transaction (tid). Once the write is complete, it atomically removes the respective entry from the transaction log

func (*Coordinator) UpdateStart

func (c *Coordinator) UpdateStart(key string, tid string, intentions coordinator.IntentionRecord) error

UpdateStart initiates a new transaction for writing to the logical file. It appends the intentions to the transaction log of the logical file identified by key

func (*Coordinator) ViewEnd

func (c *Coordinator) ViewEnd(tids []string) error

ViewEnd removes the leases allocated during ViewStart

func (*Coordinator) ViewStart

func (c *Coordinator) ViewStart(key string, filter []string) (records [][]byte, tids []string, err error)

ViewStart returns all the records (see landmark) for a logical file and keeps a lease to protect them from being garbage collected

Jump to

Keyboard shortcuts

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