checkpoint

package
v0.0.0-...-c6e60ff Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package checkpoint persists event log state information so that event log consumer can resume from the last read event in the case of a restart or unexpected interruption.

Index

Constants

View Source
const (
	SchemeKafka  = "kafka"
	SchemeBinlog = "myslave"
)

All valid State scheme.

Variables

View Source
var (
	ErrStateNotFound = errors.New("state info not found")
)

Functions

This section is empty.

Types

type Checkpoint

type Checkpoint interface {

	// Shutdown stops the checkpoint and flush all inflight states to be persisted.
	Shutdown() error

	// Commit queues the given event state information to be persisted.
	Commit(state State) error

	// LastPersistedState returns the last committed and persisted state.
	LastPersistedState(state State) error
}

type Manager

type Manager interface {

	// AllStates dumps all event state information.
	AllStates() ([]State, error)
}

Manager is an interface that manages checkpoint.

type State

type State interface {

	// Marshal serialize the state data.
	Marshal() []byte

	// Unmarshal unserialize the state from byte array data.
	Unmarshal([]byte)

	// String returns the string form of the state position.
	String() string

	// DSN returns the data source of the state.
	DSN() string

	// Scheme returns the type of statte.
	Scheme() string

	// Name returns name of the state.
	Name() string

	// Delta returns difference of two state.
	Delta(that State) string
}

State is an interface for all event state information.

Directories

Path Synopsis
store
zk

Jump to

Keyboard shortcuts

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