Documentation ¶
Overview ¶
Package honu provides a thin wrapper over an embedded database (leveldb, sqlite) that provides version history to object changes and anti-entropy replication.
Index ¶
- type DB
- func (db *DB) Close() error
- func (db *DB) Delete(key []byte, options ...opts.Option) (_ *pb.Object, err error)
- func (db *DB) Engine() engine.Engine
- func (db *DB) Get(key []byte, options ...opts.Option) (value []byte, err error)
- func (db *DB) Iter(prefix []byte, options ...opts.Option) (i iterator.Iterator, err error)
- func (db *DB) Object(key []byte, options ...opts.Option) (_ *pb.Object, err error)
- func (db *DB) Put(key, value []byte, options ...opts.Option) (_ *pb.Object, err error)
- func (db *DB) Update(obj *pb.Object, options ...opts.Option) (update UpdateType, err error)
- type DSN
- type UpdateType
- type VersionManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB is a Honu embedded database. Currently DB simply wraps a leveldb database
func Open ¶
Open a replicated embedded database with the specified URI. Database URIs should specify protocol:///relative/path/to/db for embedded databases. For absolute paths, specify protocol:////absolute/path/to/db.
func (*DB) Iter ¶
Iter over a subset of keys specified by the prefix. TODO: provide better mechanisms for iteration.
func (*DB) Object ¶
Object returns metadata associated with the latest object stored by the key. Object is the Get function to use if you want to fetch tombstones, otherwise use Get which will return a not found error.
func (*DB) Update ¶ added in v0.2.6
Update an object directly in the database without modifying its version information. Update is to Put as Object is to Get - use Update when manually modifying the data store, for example during replication, but not for normal DB operations. Update also returns the type of update that ocurred, relative to the previous version.
type UpdateType ¶ added in v0.2.7
type UpdateType uint8
UpdateType is an intermediate solution to tracking what's happening to the version history when direct modifications are applied to the database. NOTE: this data type is subject to change in later versions and should be treated as a prototype only in production code.
const ( UpdateNoChange UpdateType = iota // No change occurred (nothing was written to disk) UpdateForced // The update was forced, so the previous version was not checked UpdateLinear // The previous version is the parent of the updating version UpdateStomp // The previous version is concurrent but has a lower precedence than the updating version UpdateSkip // The previous version is later but is not concurrent nor linear from the updating version )
func (UpdateType) String ¶ added in v0.2.7
func (u UpdateType) String() string
type VersionManager ¶
VersionManager is configured with information associated with the local Replica in order to correctly implement Lamport clocks for sequential, conflict-free replicated versions.
func NewVersionManager ¶
func NewVersionManager(conf config.ReplicaConfig) (v *VersionManager, err error)
NewVersionManager creates a new manager for handling lamport scalar versions.
Directories ¶
Path | Synopsis |
---|---|
Package iterator provides an interface and implementations to traverse over the contents of an embedded database while maintaining and reading replicated object metadata.
|
Package iterator provides an interface and implementations to traverse over the contents of an embedded database while maintaining and reading replicated object metadata. |