utils

package
v0.0.0-...-d807755 Latest Latest
Warning

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

Go to latest
Published: May 7, 2014 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Overview

This file presents a generic two phase commit type with associated method calls

this allows for less code duplicaton and inter module dependencies

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CV

func CV(in []uint64) float64

func Dev

func Dev(mean, v float64) float64

func Devs

func Devs(keys []uint64) []float64

func GenId

func GenId(machineid uint64, coor bool) uint64

func GenLogger

func GenLogger(verbose bool, prefix string, disableLog bool) (printer func(a ...interface{}), verbosePrinter func(a ...interface{}))

func GenMachineId

func GenMachineId() uint64

returns mac address of local computer

func GetTimeNano

func GetTimeNano() uint64

func MakeConnection

func MakeConnection(rs RemoteServer) (*rpc.Client, error)

right now doesn't do much right now will cache connections when I get around to it (Maxwell)

func Mean

func Mean(in []uint64) float64

func StdDev

func StdDev(in []uint64) float64

func Trace

func Trace(s string)

func Un

func Un(s string) int64

func ValidateIP

func ValidateIP(ip string) bool

func ValidatePort

func ValidatePort(port string) bool

Types

type StringStringMap

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

func NewStringStringFromMap

func NewStringStringFromMap(dirname string, old map[string]string) StringStringMap

func NewStringStringMap

func NewStringStringMap(dirname string) StringStringMap

func (*StringStringMap) Delete

func (m *StringStringMap) Delete(key string) error

func (*StringStringMap) Get

func (m *StringStringMap) Get(key string) (string, error)

func (*StringStringMap) KeyChan

func (m *StringStringMap) KeyChan() <-chan string

func (*StringStringMap) Map

func (m *StringStringMap) Map() map[string]string

func (*StringStringMap) Put

func (m *StringStringMap) Put(key, value string) error

type TwoPhaseCommit

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

func InitTPC

func InitTPC(acceptors map[uint64]RemoteServer, id uint64,
	localPreCommit func(), localCommit func(), localAbort func(),
	remotePreCommit func(rs RemoteServer) (bool, error), remoteCommit func(rs RemoteServer) map[string]string,
	remoteAbort func(rs RemoteServer) map[string]string, failure func(rs RemoteServer, e error), wait bool) TwoPhaseCommit

func (*TwoPhaseCommit) Run

func (t *TwoPhaseCommit) Run() (error, map[string]string)

type Uint64ServerMap

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

func NewUint64ServerFromMap

func NewUint64ServerFromMap(dirname string, old map[uint64]RemoteServer) Uint64ServerMap

func NewUint64ServerMap

func NewUint64ServerMap(dirname string) Uint64ServerMap

func (*Uint64ServerMap) Delete

func (m *Uint64ServerMap) Delete(key uint64) error

func (*Uint64ServerMap) Get

func (m *Uint64ServerMap) Get(key uint64) (RemoteServer, error)

func (*Uint64ServerMap) Map

func (m *Uint64ServerMap) Map() map[uint64]RemoteServer

func (*Uint64ServerMap) Put

func (m *Uint64ServerMap) Put(key uint64, rs RemoteServer) error

Uint64Server Map functions

Jump to

Keyboard shortcuts

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