clientlib

package
v0.0.0-...-24eec3b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientLib

type ClientLib interface {
	/* Chooses a Paxos or Fast Paxos instance to propose the command
	 * Returns (isFastUsed, isCommitted, isFast, execution result)
	 */
	Propose(cmd *dynamic.Command) (bool, bool, bool, string)

	/* Uses an Fast Paxos instance to propose the command
	 * Returns (isCommitted, isFast, execution result)
	 */
	FpPropose(cmd *dynamic.Command) (bool, bool, string)

	/* Uses a Paxos instance to propose the command
	 * Returns (isCommitted, execution result)
	 */
	PaxosPropose(cmd *dynamic.Command) (bool, string)

	// Shuts down the client lib
	Close()

	// Static network configuration
	Test()
}

func NewClientLib

func NewClientLib(id, dcId, configFile, replicaFile, targetReplicaDcId string) ClientLib

type DynamicClientLib

type DynamicClientLib struct {
	Id                   string // client id
	IsReplicaColocated   bool   // true if colocated with a replica in the same datacenter
	ColocatedReplicaAddr string // the net addr of the colocated replica
	// contains filtered or unexported fields
}

func (*DynamicClientLib) Close

func (lib *DynamicClientLib) Close()

func (*DynamicClientLib) FpPropose

func (lib *DynamicClientLib) FpPropose(cmd *dynamic.Command) (bool, bool, string)

func (*DynamicClientLib) IsPaxosLeaderColocated

func (lib *DynamicClientLib) IsPaxosLeaderColocated() (bool, string)

Returns true and colocated paxos leasder's net addr TODO: The colocated replica may not be a Paxos leader

func (*DynamicClientLib) PaxosPropose

func (lib *DynamicClientLib) PaxosPropose(cmd *dynamic.Command) (bool, string)

func (*DynamicClientLib) Propose

func (lib *DynamicClientLib) Propose(cmd *dynamic.Command) (bool, bool, bool, string)

func (*DynamicClientLib) Test

func (lib *DynamicClientLib) Test()

type LatInfo

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

type LatTimeInfo

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

Jump to

Keyboard shortcuts

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