Documentation ¶
Index ¶
- Variables
- func AdditionalGraphs(opts Opts) []core.Analyzer
- func CycleCases(graph core.DirectedGraph, pairExplainer core.DataExplainer, sccs []core.SCC) map[string][]core.Anomaly
- func CycleCasesInScc(graph core.DirectedGraph, filterGraph FilterGraphFn, ...) []core.CycleExplainerResult
- func Cycles(analyzer core.Analyzer, history core.History, opts ...interface{}) core.CheckResult
- func CyclesWithDraw()
- func FailedWrites(history core.History) map[string]map[core.MopValueType]*core.Op
- func Gen(mop []core.Mop) core.Op
- func IntArrayHash(array []int) uint32
- func IntermediateWrites(history core.History) map[string]map[core.MopValueType]*core.Op
- type CheckResult
- type CycleAnomalySpecType
- type CycleExplainerWrapper
- type DistMode
- type FilterExType
- type FilterGraphFn
- type KeyDist
- type MopIterator
- type OpMopIterator
- type Opts
- type WrTxnOpts
- type WrTxnState
Constants ¶
This section is empty.
Variables ¶
var CycleAnomalySpecs map[string]CycleAnomalySpecType
CycleAnomalySpecs defines anomaly specs
var CycleTypeNames map[string]struct{}
CycleTypeNames ...
var ProcessAnalysisTypes map[string]struct{}
ProcessAnalysisTypes saves types involving process edges
var RealtimeAnalysisTypes map[string]struct{}
RealtimeAnalysisTypes saves types involving realtime edges.
var UnknownAnomalyTypes map[string]struct{}
UnknownAnomalyTypes ...
Functions ¶
func AdditionalGraphs ¶
AdditionalGraphs determines what additional graphs we'll need to consider for this analysis.
func CycleCases ¶
func CycleCases(graph core.DirectedGraph, pairExplainer core.DataExplainer, sccs []core.SCC) map[string][]core.Anomaly
CycleCases finds anomaly cases and group them by there name
func CycleCasesInScc ¶
func CycleCasesInScc(graph core.DirectedGraph, filterGraph FilterGraphFn, explainer core.DataExplainer, scc core.SCC) []core.CycleExplainerResult
CycleCasesInScc searches a single SCC for cycle anomalies. TODO: add timeout logic.
func Cycles ¶
Cycles takes an options map, including a collection of expected consistency models
:consistency-models, a set of additional :anomalies, an analyzer function, and a history. Analyzes the history and yields the analysis, plus an anomaly map like {:G1c [...]}.
func CyclesWithDraw ¶
func CyclesWithDraw()
CyclesWithDraw means "cycles!" in clojure. TODO: This function contains some logic like draw, so I leave it unimplemented.
func FailedWrites ¶
FailedWrites is like IntermediateWrites, it returns map[key](map[aborted-value]abort-op).
func Gen ¶
Gen Takes a sequence of transactions and returns a sequence of invocation operations. Note: Currently we don't need :f.
func IntermediateWrites ¶
IntermediateWrites return a map likes map[key](map[old-version]overwrite-op). Note: This function is very very strange, please pay attention to it carefully.
Types ¶
type CheckResult ¶
type CheckResult struct { // valid? true | :unknown | false IsUnknown bool `json:"is_unknown"` Valid bool `json:"valid"` AnomalyTypes []string `json:"anomaly_types"` Anomalies core.Anomalies `json:"anomalies"` ImpossibleModels []interface{} `json:"impossible_models"` Not []string `json:"not"` AlsoNot []string `json:"also_not"` }
CheckResult records the check result
func ResultMap ¶
func ResultMap(opts Opts, anomalies core.Anomalies) CheckResult
ResultMap takes opts and processes anomalies
func (CheckResult) Error ¶
func (c CheckResult) Error() string
type CycleAnomalySpecType ¶
type CycleAnomalySpecType struct { // A set of relationships which must intersect with every edge in the cycle. Rels map[core.Rel]struct{} // A set of relationships which must intersect with the first edge in the cycle. FirstRel core.Rel // A set of relationships which must intersect with remaining edges. RestRels map[core.Rel]struct{} // A predicate over a cycle explanation. We use this to restrict cycles to e.g. *just* G2 instead of G-single. FilterEx FilterExType // A predicate over a cycle With core.CyclePredicate }
CycleAnomalySpecType specifies different anomalies
type CycleExplainerWrapper ¶
type CycleExplainerWrapper struct{}
CycleExplainerWrapper is a ICycleExplainer, it's also a wrapper for core.
func (CycleExplainerWrapper) ExplainCycle ¶
func (c CycleExplainerWrapper) ExplainCycle(pairExplainer core.DataExplainer, circle core.Circle) core.CycleExplainerResult
ExplainCycle ...
func (CycleExplainerWrapper) RenderCycleExplanation ¶
func (c CycleExplainerWrapper) RenderCycleExplanation(explainer core.DataExplainer, cr core.CycleExplainerResult) string
RenderCycleExplanation ...
type FilterExType ¶
type FilterExType = func(cycleCase *core.CycleExplainerResult) bool
FilterExType is a predication on a cycle case
type FilterGraphFn ¶
type FilterGraphFn = func(rels []core.Rel) *core.DirectedGraph
FilterGraphFn ...
func FilteredGraphs ¶
func FilteredGraphs(graph core.DirectedGraph) FilterGraphFn
FilteredGraphs receives a graph and a collection of relations, return a new Graph filtered to just those relationships Note: currently it use fork here, we can considering remove it.
type KeyDist ¶
type KeyDist struct {
DistMode DistMode
}
KeyDist means the distribution of the keys. Defaults to :exponential.
type MopIterator ¶
type MopIterator struct {
// contains filtered or unexported fields
}
MopIterator records the state of the mop generator
func (*MopIterator) Next ¶
func (mIter *MopIterator) Next() []core.Mop
Next iterates next element
If the operation is `read`, it will just return [:r key nil] If the operation is `write`, it will just return [:w key value]
type OpMopIterator ¶
type OpMopIterator struct {
// contains filtered or unexported fields
}
OpMopIterator builds a op-mop iterator
func OpMops ¶
func OpMops(history core.History) *OpMopIterator
OpMops return an iterator for history.
func (*OpMopIterator) HasNext ¶
func (omi *OpMopIterator) HasNext() bool
HasNext returns whether the iterator has ended
type Opts ¶
type Opts struct { // define what specific anomalies and consistency models to look for ConsistencyModels []core.ConsistencyModelName Anomalies []string AdditionalGraphs []core.Analyzer }
Opts contains consistencyModels, Anomalies and AdditionalGraphs etc
type WrTxnOpts ¶
type WrTxnOpts struct { KeyDist KeyDist // The base for an exponential distribution. // Defaults to 2, so the first key is twice as likely as the second, // which is twice as likely as the third, etc. KeyDistBase uint KeyCount uint MinTxnLength uint MaxTxnLength uint MaxWritesPerKey uint }
WrTxnOpts ...
type WrTxnState ¶
type WrTxnState struct {
// contains filtered or unexported fields
}
WrTxnState ...