Documentation ¶
Index ¶
- Constants
- func Open(path securefilepath.SecureFilePath) (metastore.Client, error)
- type Sqlite3Storage
- func (store *Sqlite3Storage) Add(srv *datasrvstore.Server) (*datasrvstore.Server, error)
- func (store *Sqlite3Storage) All() ([]*datasrvstore.Server, error)
- func (store *Sqlite3Storage) DeleteBush(root snapshot.ID) error
- func (store *Sqlite3Storage) DeleteSnapshots(snaps []*snapshot.Snapshot, tip *snapshot.Snapshot) error
- func (store *Sqlite3Storage) DeleteVolume(vid volume.ID) error
- func (store *Sqlite3Storage) DeleteVolumeSet(id volumeset.ID) error
- func (store *Sqlite3Storage) ExtendBranch(snapshots ...*snapshot.Snapshot) error
- func (store *Sqlite3Storage) ForkBranch(branchName string, snapshots ...*snapshot.Snapshot) error
- func (store *Sqlite3Storage) Get(id int) (*datasrvstore.Server, error)
- func (store *Sqlite3Storage) GetBlobIDs(snapIDs []snapshot.ID) (map[snapshot.ID]blob.ID, error)
- func (store *Sqlite3Storage) GetBranches(q branch.Query) ([]*branch.Branch, error)
- func (store *Sqlite3Storage) GetBush(snapid snapshot.ID) (*bush.Bush, error)
- func (store *Sqlite3Storage) GetCurrent() (*datasrvstore.Server, error)
- func (store *Sqlite3Storage) GetSnapshotIDs(vsid volumeset.ID) ([]snapshot.ID, error)
- func (store *Sqlite3Storage) GetSnapshots(q snapshot.Query) ([]*snapshot.Snapshot, error)
- func (store *Sqlite3Storage) GetTip(vsid volumeset.ID, branch string) (*snapshot.Snapshot, error)
- func (store *Sqlite3Storage) GetVolume(vid volume.ID) (*volume.Volume, error)
- func (store *Sqlite3Storage) GetVolumeSets(q volumeset.Query) ([]*volumeset.VolumeSet, error)
- func (store *Sqlite3Storage) GetVolumes(vsid volumeset.ID) ([]*volume.Volume, error)
- func (store *Sqlite3Storage) ImportBranch(branchID branch.ID, branchName string, snapshots ...*snapshot.Snapshot) error
- func (store *Sqlite3Storage) ImportBush(b *bush.Bush) error
- func (store *Sqlite3Storage) ImportVolume(vol *volume.Volume) error
- func (store *Sqlite3Storage) ImportVolumeSet(vs *volumeset.VolumeSet) error
- func (store *Sqlite3Storage) NumChildren(snapid snapshot.ID) (int, error)
- func (store *Sqlite3Storage) NumVolumes(snapid snapshot.ID) (int, error)
- func (store *Sqlite3Storage) PullSnapshots(snaps []*metastore.SnapshotPair) ([]metastore.SnapMetaConflict, error)
- func (store *Sqlite3Storage) PullVolumeSet(vsCur, vsInit *volumeset.VolumeSet) (metastore.VSMetaConflict, error)
- func (store *Sqlite3Storage) RenameBranch(vsid volumeset.ID, oldName, newName string) error
- func (store *Sqlite3Storage) SetBlobIDAndSize(snapid snapshot.ID, blobid blob.ID, size uint64) error
- func (store *Sqlite3Storage) SetCurrent(id int) error
- func (store *Sqlite3Storage) SetVolumeSetSize(vsid volumeset.ID, size uint64) error
- func (store *Sqlite3Storage) UpdateSnapshot(snapCur, snapInit *snapshot.Snapshot) (metastore.SnapMetaConflict, error)
- func (store *Sqlite3Storage) UpdateSnapshots(snaps []*metastore.SnapshotPair) ([]metastore.SnapMetaConflict, error)
- func (store *Sqlite3Storage) UpdateVolume(vol *volume.Volume) error
- func (store *Sqlite3Storage) UpdateVolumeSet(vsCur, vsInit *volumeset.VolumeSet) (metastore.VSMetaConflict, error)
Constants ¶
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 ¶
func Open(path securefilepath.SecureFilePath) (metastore.Client, error)
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 ¶
func Create(path securefilepath.SecureFilePath) (*Sqlite3Storage, error)
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 ¶
func (store *Sqlite3Storage) Add(srv *datasrvstore.Server) (*datasrvstore.Server, error)
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 ¶
GetBlobIDs implements metastore.Store interface.
func (*Sqlite3Storage) GetBranches ¶
GetBranches ...
func (*Sqlite3Storage) GetCurrent ¶
func (store *Sqlite3Storage) GetCurrent() (*datasrvstore.Server, error)
GetCurrent ...
func (*Sqlite3Storage) GetSnapshotIDs ¶
GetSnapshotIDs implements metastore interface.
func (*Sqlite3Storage) GetSnapshots ¶
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) GetVolumeSets ¶
GetVolumeSets ...
func (*Sqlite3Storage) GetVolumes ¶
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 ...