sqlite3storage

package
v0.0.0-...-c5655c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2017 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const TXLOCKING = "immediate"

TXLOCKING - transaction locking. Can be 'auto', 'immediate' or 'exclusive'. 'immediate' means no other writes to db once the transaction is in progress. When we create our db with 'immediate' flag, all transactions will be in 'immediate' mode. Basically, that buys us locking across the query+upate operations if they are part of the same transaction. On the postgress side, the equivalent is the "QUERY FOR UPDATE" clause.

Variables

This section is empty.

Functions

func Open

Open returns a storage object backed by an existing SQLite3-based metadata storage database at the given path or fails if the DB is not found.

Types

type Sqlite3Storage

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

Sqlite3Storage ...

func Create

Create makes a brand new SQLite3-based metadata storage database at the given path or fails if something exists at that path already.

func (*Sqlite3Storage) Add

Add ...

func (*Sqlite3Storage) All

func (store *Sqlite3Storage) All() ([]*datasrvstore.Server, error)

All ...

func (*Sqlite3Storage) DeleteBush

func (store *Sqlite3Storage) DeleteBush(root snapshot.ID) error

DeleteBush ...

func (*Sqlite3Storage) DeleteSnapshots

func (store *Sqlite3Storage) DeleteSnapshots(snaps []*snapshot.Snapshot, tip *snapshot.Snapshot) error

DeleteSnapshots ...

func (*Sqlite3Storage) DeleteVolume

func (store *Sqlite3Storage) DeleteVolume(vid volume.ID) error

DeleteVolume ...

func (*Sqlite3Storage) DeleteVolumeSet

func (store *Sqlite3Storage) DeleteVolumeSet(id volumeset.ID) error

DeleteVolumeSet implements metastore interface

func (*Sqlite3Storage) ExtendBranch

func (store *Sqlite3Storage) ExtendBranch(snapshots ...*snapshot.Snapshot) error

ExtendBranch ...

func (*Sqlite3Storage) ForkBranch

func (store *Sqlite3Storage) ForkBranch(branchName string, snapshots ...*snapshot.Snapshot) error

ForkBranch ...

func (*Sqlite3Storage) Get

func (store *Sqlite3Storage) Get(id int) (*datasrvstore.Server, error)

Get ...

func (*Sqlite3Storage) GetBlobIDs

func (store *Sqlite3Storage) GetBlobIDs(snapIDs []snapshot.ID) (map[snapshot.ID]blob.ID, error)

GetBlobIDs implements metastore.Store interface.

func (*Sqlite3Storage) GetBranches

func (store *Sqlite3Storage) GetBranches(q branch.Query) ([]*branch.Branch, error)

GetBranches ...

func (*Sqlite3Storage) GetBush

func (store *Sqlite3Storage) GetBush(snapid snapshot.ID) (*bush.Bush, error)

GetBush implments metastore interface

func (*Sqlite3Storage) GetCurrent

func (store *Sqlite3Storage) GetCurrent() (*datasrvstore.Server, error)

GetCurrent ...

func (*Sqlite3Storage) GetSnapshotIDs

func (store *Sqlite3Storage) GetSnapshotIDs(vsid volumeset.ID) ([]snapshot.ID, error)

GetSnapshotIDs implements metastore interface.

func (*Sqlite3Storage) GetSnapshots

func (store *Sqlite3Storage) GetSnapshots(q snapshot.Query) ([]*snapshot.Snapshot, error)

GetSnapshots returns a list of snapshots ordered by specifications in passed-in query. Caller is responsible for actually filtering output based on query.

func (*Sqlite3Storage) GetTip

func (store *Sqlite3Storage) GetTip(vsid volumeset.ID, branch string) (*snapshot.Snapshot, error)

GetTip ...

func (*Sqlite3Storage) GetVolume

func (store *Sqlite3Storage) GetVolume(vid volume.ID) (*volume.Volume, error)

GetVolume ...

func (*Sqlite3Storage) GetVolumeSets

func (store *Sqlite3Storage) GetVolumeSets(q volumeset.Query) ([]*volumeset.VolumeSet, error)

GetVolumeSets ...

func (*Sqlite3Storage) GetVolumes

func (store *Sqlite3Storage) GetVolumes(vsid volumeset.ID) ([]*volume.Volume, error)

GetVolumes ...

func (*Sqlite3Storage) ImportBranch

func (store *Sqlite3Storage) ImportBranch(branchID branch.ID, branchName string,
	snapshots ...*snapshot.Snapshot) error

ImportBranch ...

func (*Sqlite3Storage) ImportBush

func (store *Sqlite3Storage) ImportBush(b *bush.Bush) error

ImportBush ...

func (*Sqlite3Storage) ImportVolume

func (store *Sqlite3Storage) ImportVolume(vol *volume.Volume) error

ImportVolume ...

func (*Sqlite3Storage) ImportVolumeSet

func (store *Sqlite3Storage) ImportVolumeSet(vs *volumeset.VolumeSet) error

ImportVolumeSet implements metastore interface

func (*Sqlite3Storage) NumChildren

func (store *Sqlite3Storage) NumChildren(snapid snapshot.ID) (int, error)

NumChildren ...

func (*Sqlite3Storage) NumVolumes

func (store *Sqlite3Storage) NumVolumes(snapid snapshot.ID) (int, error)

NumVolumes ...

func (*Sqlite3Storage) PullSnapshots

func (store *Sqlite3Storage) PullSnapshots(snaps []*metastore.SnapshotPair) ([]metastore.SnapMetaConflict, error)

PullSnapshots implements metastore interface Assumption: Snapshots pair are sorted by snapshot ID in snapshot.AEC order.

func (*Sqlite3Storage) PullVolumeSet

func (store *Sqlite3Storage) PullVolumeSet(
	vsCur, vsInit *volumeset.VolumeSet,
) (metastore.VSMetaConflict, error)

PullVolumeSet implements the metastore interface

func (*Sqlite3Storage) RenameBranch

func (store *Sqlite3Storage) RenameBranch(vsid volumeset.ID, oldName, newName string) error

RenameBranch ...

func (*Sqlite3Storage) SetBlobIDAndSize

func (store *Sqlite3Storage) SetBlobIDAndSize(
	snapid snapshot.ID,
	blobid blob.ID,
	size uint64,
) error

SetBlobIDAndSize implements metastore.Store interface

func (*Sqlite3Storage) SetCurrent

func (store *Sqlite3Storage) SetCurrent(id int) error

SetCurrent ...

func (*Sqlite3Storage) SetVolumeSetSize

func (store *Sqlite3Storage) SetVolumeSetSize(vsid volumeset.ID, size uint64) error

SetVolumeSetSize implements metastore.Store interface

func (*Sqlite3Storage) UpdateSnapshot

func (store *Sqlite3Storage) UpdateSnapshot(snapCur, snapInit *snapshot.Snapshot) (metastore.SnapMetaConflict, error)

UpdateSnapshot implements metastore interface

func (*Sqlite3Storage) UpdateSnapshots

func (store *Sqlite3Storage) UpdateSnapshots(snaps []*metastore.SnapshotPair) ([]metastore.SnapMetaConflict, error)

UpdateSnapshots implements metastore interface Assumption: Snapshots pair are sorted by snapshot ID in snapshot.AEC order.

func (*Sqlite3Storage) UpdateVolume

func (store *Sqlite3Storage) UpdateVolume(vol *volume.Volume) error

UpdateVolume ...

func (*Sqlite3Storage) UpdateVolumeSet

func (store *Sqlite3Storage) UpdateVolumeSet(
	vsCur, vsInit *volumeset.VolumeSet) (metastore.VSMetaConflict, error)

UpdateVolumeSet ...

Jump to

Keyboard shortcuts

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