migrator

package
v0.0.0-...-29a4dac Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

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

Migrator is used to migrate the Consul data storage format on servers with versions <= 0.5.0. Consul versions >= 0.5.1 use BoltDB internally as the store for the Raft log. During this transition, it is necessary to copy data out of our LMDB store and create a new BoltStore with the same data.

func New

func New(dataDir string) (*Migrator, error)

New creates a new Migrator given the path to a Consul data-dir. Returns the new Migrator and any error.

func (*Migrator) Migrate

func (m *Migrator) Migrate() (bool, error)

Migrate is the high-level function we call when we want to attempt to migrate all of our LMDB data into BoltDB. If an error is encountered, the BoltStore is nuked from disk, since it is useless. The migration can be attempted again, as the LMDB data should still be intact. Returns a bool indicating whether a migration was completed, and any error.

Jump to

Keyboard shortcuts

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