sequence

package
v0.0.0-...-935c85c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// EtcdKeyPrefix                   = "/seaweedfs"
	EtcdKeySequence                 = "/master/sequence"
	EtcdContextTimeoutSecond        = 100 * time.Second
	DefaultEtcdSteps         uint64 = 500 // internal counter
	SequencerFileName               = "sequencer.dat"
	FileMaxSequenceLength           = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EtcdSequencer

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

func NewEtcdSequencer

func NewEtcdSequencer(etcdUrls string, metaFolder string) (*EtcdSequencer, error)

func (*EtcdSequencer) GetMax

func (es *EtcdSequencer) GetMax() uint64

func (*EtcdSequencer) NextFileId

func (es *EtcdSequencer) NextFileId(count uint64) uint64

func (*EtcdSequencer) Peek

func (es *EtcdSequencer) Peek() uint64

func (*EtcdSequencer) SetMax

func (es *EtcdSequencer) SetMax(seenValue uint64)

* instead of collecting the max value from volume server, the max value should be saved in local config file and ETCD cluster

type MemorySequencer

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

just for testing

func NewMemorySequencer

func NewMemorySequencer() (m *MemorySequencer)

func (*MemorySequencer) NextFileId

func (m *MemorySequencer) NextFileId(count uint64) uint64

func (*MemorySequencer) Peek

func (m *MemorySequencer) Peek() uint64

func (*MemorySequencer) SetMax

func (m *MemorySequencer) SetMax(seenValue uint64)

type Sequencer

type Sequencer interface {
	NextFileId(count uint64) uint64
	SetMax(uint64)
	Peek() uint64
}

Jump to

Keyboard shortcuts

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