nopaxos

package
v0.0.0-...-39f1dcc Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthConfig        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowConfig          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupConfig = fmt.Errorf("proto: unexpected end of group")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	node.Client
	// contains filtered or unexported fields
}

Client is a service Client implementation for the NOPaxos consensus protocol

func NewClient

func NewClient(config cluster.Cluster, sequencerConfig *SequencerConfig) (*Client, error)

NewClient returns a new NOPaxos client

func (*Client) Close

func (c *Client) Close() error

Close closes the client

func (*Client) IsLeader

func (c *Client) IsLeader() bool

func (*Client) Leader

func (c *Client) Leader() string

func (*Client) MustLeader

func (c *Client) MustLeader() bool

func (*Client) Read

func (c *Client) Read(ctx context.Context, in []byte, stream stream.WriteStream) error

Read sends a read operation to the cluster

func (*Client) Write

func (c *Client) Write(ctx context.Context, in []byte, stream stream.WriteStream) error

Write sends a write operation to the cluster

type Cluster

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

Cluster manages the NOPaxos cluster configuration

func NewCluster

func NewCluster(config node.Cluster) *Cluster

NewCluster returns a new Cluster with the given configuration

func (*Cluster) GetStream

func (*Cluster) Member

func (c *Cluster) Member() MemberID

func (*Cluster) Members

func (c *Cluster) Members() []MemberID

func (*Cluster) QuorumSize

func (c *Cluster) QuorumSize() int

type MemberID

type MemberID string

MemberID is a member identifier

type Protocol

type Protocol struct {
	node.Protocol
	// contains filtered or unexported fields
}

Protocol is an implementation of the Client interface providing the NOPaxos consensus protocol

func NewProtocol

func NewProtocol(config *SequencerConfig) *Protocol

NewProtocol returns a new NOPaxos Protocol instance

func (*Protocol) Client

func (p *Protocol) Client() node.Client

Client returns the NOPaxos sequencer client

func (*Protocol) Start

func (p *Protocol) Start(config cluster.Cluster, registry *node.Registry) error

Start starts the NOPaxos protocol

func (*Protocol) Stop

func (p *Protocol) Stop() error

Stop stops the NOPaxos protocol

type SequencerConfig

type SequencerConfig struct {
	SessionId github_com_atomix_atomix_nopaxos_node_pkg_atomix_nopaxos_protocol.SessionID `` /* 170-byte string literal not displayed */
}

SequencerConfig is the sequencer configuration

func NewPopulatedSequencerConfig

func NewPopulatedSequencerConfig(r randyConfig, easy bool) *SequencerConfig

func (*SequencerConfig) Descriptor

func (*SequencerConfig) Descriptor() ([]byte, []int)

func (*SequencerConfig) Equal

func (this *SequencerConfig) Equal(that interface{}) bool

func (*SequencerConfig) Marshal

func (m *SequencerConfig) Marshal() (dAtA []byte, err error)

func (*SequencerConfig) MarshalTo

func (m *SequencerConfig) MarshalTo(dAtA []byte) (int, error)

func (*SequencerConfig) MarshalToSizedBuffer

func (m *SequencerConfig) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*SequencerConfig) ProtoMessage

func (*SequencerConfig) ProtoMessage()

func (*SequencerConfig) Reset

func (m *SequencerConfig) Reset()

func (*SequencerConfig) Size

func (m *SequencerConfig) Size() (n int)

func (*SequencerConfig) String

func (m *SequencerConfig) String() string

func (*SequencerConfig) Unmarshal

func (m *SequencerConfig) Unmarshal(dAtA []byte) error

func (*SequencerConfig) XXX_DiscardUnknown

func (m *SequencerConfig) XXX_DiscardUnknown()

func (*SequencerConfig) XXX_Marshal

func (m *SequencerConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SequencerConfig) XXX_Merge

func (m *SequencerConfig) XXX_Merge(src proto.Message)

func (*SequencerConfig) XXX_Size

func (m *SequencerConfig) XXX_Size() int

func (*SequencerConfig) XXX_Unmarshal

func (m *SequencerConfig) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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