diskview

package
v0.0.0-...-6719cd2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Overview

Package diskview implements a view service that serves facts from an ordered key-value store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskView

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

DiskView represents an instance of the DiskView service, it reads log entries from the log, applies them to a local database, and responds to lookup requests. It has both a local go interface, as well as a gRPC API for the API tier to use.

func New

func New(cfg *config.Akutan) (*DiskView, error)

New constructs a new DiskView instance based on the supplied configuration. This won't start processing the log or responding to API requests until you subsequently call Start()

func (*DiskView) Close

func (view *DiskView) Close()

Close will close the underlying database for this DiskView, its not valid for further use once closed. TODO: this probably needs to cleanly shutdown the log appender first

func (*DiskView) FactStats

func (view *DiskView) FactStats(ctx context.Context, req *rpc.FactStatsRequest) (*rpc.FactStatsResult, error)

FactStats returns the most recently collected statistics about the facts stored in this diskview

func (*DiskView) LastApplied

func (view *DiskView) LastApplied() blog.Index

LastApplied return the most recent log index that has been processed and applied to the db.

func (*DiskView) LastLogIndex

func (view *DiskView) LastLogIndex() (blog.Index, error)

LastLogIndex returns the most recent log index that we can see in the log, this view may not have processed this or prior entries yet.

func (*DiskView) LogStatus

func (view *DiskView) LogStatus(ctx context.Context, r *rpc.LogStatusRequest) (*rpc.LogStatusResult, error)

LogStatus returns a summary of the current log processing state of this diskview, it includes both the current applied log index, as well as the log index of the oldest pending we're tracking. If there are no outstanding transactions OldestPendingTxnIndex will return the same value as AtIndex.

func (*DiskView) LookupPO

func (view *DiskView) LookupPO(req *rpc.LookupPORequest, resServer rpc.ReadFactsPO_LookupPOServer) error

LookupPO implements the gRPC method ReadFactsPO.LookupPO. The real work happens in lookupPO, which is easier to unit test.

func (*DiskView) LookupPOCmp

func (view *DiskView) LookupPOCmp(req *rpc.LookupPOCmpRequest, resServer rpc.ReadFactsPO_LookupPOCmpServer) error

LookupPOCmp implements the gRPC method ReadFactsPO.LookupPO.

func (*DiskView) LookupS

func (view *DiskView) LookupS(req *rpc.LookupSRequest, resServer rpc.ReadFactsSP_LookupSServer) error

LookupS implements the gRPC method ReadFactsSP.LookupS.

func (*DiskView) LookupSP

func (view *DiskView) LookupSP(req *rpc.LookupSPRequest, resServer rpc.ReadFactsSP_LookupSPServer) error

LookupSP implements the gRPC method ReadFactsSP.LookupSP.

func (*DiskView) LookupSPO

func (view *DiskView) LookupSPO(req *rpc.LookupSPORequest, resServer rpc.ReadFactsSP_LookupSPOServer) error

LookupSPO implements the gRPC method ReadFactsSP.LookupSPO.

func (*DiskView) Profile

func (view *DiskView) Profile(ctx context.Context, req *rpc.ProfileRequest) (*rpc.ProfileResult, error)

Profile will run a CPU profile for the requested duration, writing the results to the indicated local file. This is primarily for diagnostics & development

func (*DiskView) Ride

func (view *DiskView) Ride(req *rpc.CarouselRequest, results rpc.Carousel_RideServer) error

Ride implements the gRPC Ride request, allowing a caller to see all (or some subset) of data from this diskview. Sets of facts are streamed to caller, multiple concurrent Ride's will share a single iteration of the underling database.

func (*DiskView) SetLogLevel

func (view *DiskView) SetLogLevel(ctx context.Context, req *rpc.LogLevelRequest) (*rpc.LogLevelResult, error)

SetLogLevel allows a gRPC client to dynamically adjust the logrus log level. This does not persist across service restarts. This is primarily for diagnostics & development

func (*DiskView) Start

func (view *DiskView) Start() error

Start will start the processing for this DiskView. First it'll start trying to consume the log, starting from its previous persisted log index. If that index is not available in the log any more, or if our last log position is now greater than the 'Carousel Catchup Lag' we start a carousel client to catch up the state. Once this is completed, the API server will be started.

func (*DiskView) Stats

func (view *DiskView) Stats(ctx context.Context, req *rpc.StatsRequest) (*rpc.StatsResult, error)

Stats returns the current state of the common view statistics

func (*DiskView) UpdateStats

func (view *DiskView) UpdateStats(ctx context.Context, req *rpc.UpdateStatsRequest) (*rpc.UpdateStatsResult, error)

UpdateStats allows for a gRPC client to force this disk view to update it statistics about facts it should only be used for diagnostics purposes [as this forces a caoursel to run]

Directories

Path Synopsis
Command akutan-diskview runs a DiskView daemon.
Command akutan-diskview runs a DiskView daemon.
Package database defines an abstract ordered Key/Value store that can be used as a backing store by the Disk View.
Package database defines an abstract ordered Key/Value store that can be used as a backing store by the Disk View.
Package keys provides support for building and parsing the DiskView's binary key format that facts are encoded into.
Package keys provides support for building and parsing the DiskView's binary key format that facts are encoded into.
Package rocksdb provides an implementation of the Database interface that is backed by a local RocksDB Key/Value store
Package rocksdb provides an implementation of the Database interface that is backed by a local RocksDB Key/Value store

Jump to

Keyboard shortcuts

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