snapshot

package
v0.0.0-...-f429149 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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSnapshot   = fmt.Errorf("proto: integer overflow")
)

Functions

This section is empty.

Types

type Descriptor

type Descriptor struct {
	Index     github_com_atomix_atomix_raft_node_pkg_atomix_raft_protocol.Index `` /* 135-byte string literal not displayed */
	Timestamp *time.Time                                                        `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"`
}

Snapshot descriptor

func NewPopulatedDescriptor

func NewPopulatedDescriptor(r randySnapshot, easy bool) *Descriptor

func (*Descriptor) Descriptor

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

func (*Descriptor) Equal

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

func (*Descriptor) GetTimestamp

func (m *Descriptor) GetTimestamp() *time.Time

func (*Descriptor) Marshal

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

func (*Descriptor) MarshalTo

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

func (*Descriptor) MarshalToSizedBuffer

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

func (*Descriptor) ProtoMessage

func (*Descriptor) ProtoMessage()

func (*Descriptor) Reset

func (m *Descriptor) Reset()

func (*Descriptor) Size

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

func (*Descriptor) String

func (m *Descriptor) String() string

func (*Descriptor) Unmarshal

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

func (*Descriptor) XXX_DiscardUnknown

func (m *Descriptor) XXX_DiscardUnknown()

func (*Descriptor) XXX_Marshal

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

func (*Descriptor) XXX_Merge

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

func (*Descriptor) XXX_Size

func (m *Descriptor) XXX_Size() int

func (*Descriptor) XXX_Unmarshal

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

type Snapshot

type Snapshot interface {
	// Index is the index at which the snapshot was taken
	Index() raft.Index

	// Timestamp is the time at which the snapshot was taken
	Timestamp() time.Time

	// Reader returns a new snapshot reader
	Reader() io.ReadCloser

	// Writer returns a new snapshot writer
	Writer() io.WriteCloser
}

Snapshot is a single state machine snapshot

type Store

type Store interface {
	// NewSnapshot creates a new snapshot
	NewSnapshot(index raft.Index, timestamp time.Time) Snapshot

	// CurrentSnapshot returns the current snapshot
	CurrentSnapshot() Snapshot

	// Close closes the store
	Close() error
}

Store is an interface for managing snapshots

func NewMemoryStore

func NewMemoryStore() Store

NewMemoryStore creates a new in-memory snapshot store

Jump to

Keyboard shortcuts

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