Documentation ¶
Index ¶
- func ChooseParents(existingParents hash.Events, options hash.Events, strategies []SearchStrategy) hash.Events
- type DagIndex
- type DiffMetricFn
- type Matrix
- type Metric
- type MetricCache
- type MetricStrategy
- type PayloadIndexer
- type QuorumIndexer
- func (h *QuorumIndexer) GetGlobalMatrix() Matrix
- func (h *QuorumIndexer) GetGlobalMedianSeqs() []idx.Event
- func (h *QuorumIndexer) GetMetricOf(id hash.Event) Metric
- func (h *QuorumIndexer) GetSelfParentSeqs() []idx.Event
- func (h *QuorumIndexer) ProcessEvent(event dag.Event, selfEvent bool)
- func (h *QuorumIndexer) SearchStrategy() SearchStrategy
- type RandomStrategy
- type SearchStrategy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChooseParents ¶
func ChooseParents(existingParents hash.Events, options hash.Events, strategies []SearchStrategy) hash.Events
ChooseParents returns estimated parents subset, according to provided strategy max is max num of parents to link with (including self-parent) returns set of parents to link, len(res) <= max
Types ¶
type DagIndex ¶
type DagIndex interface { dagidx.VectorClock }
type DiffMetricFn ¶
type MetricCache ¶
type MetricCache struct {
// contains filtered or unexported fields
}
func NewMetricFnCache ¶
func NewMetricFnCache(metricFn func(hash.Event) Metric, cacheSize int) *MetricCache
func (*MetricCache) GetMetricOf ¶
func (c *MetricCache) GetMetricOf(id hash.Event) Metric
type MetricStrategy ¶
type MetricStrategy struct {
// contains filtered or unexported fields
}
func NewMetricStrategy ¶
func NewMetricStrategy(metricFn func(hash.Event) Metric) *MetricStrategy
type PayloadIndexer ¶
type PayloadIndexer struct {
// contains filtered or unexported fields
}
func NewPayloadIndexer ¶
func NewPayloadIndexer(cacheSize int) *PayloadIndexer
func (*PayloadIndexer) GetMetricOf ¶
func (h *PayloadIndexer) GetMetricOf(id hash.Event) Metric
func (*PayloadIndexer) ProcessEvent ¶
func (h *PayloadIndexer) ProcessEvent(event dag.Event, payloadMetric Metric)
func (*PayloadIndexer) SearchStrategy ¶
func (h *PayloadIndexer) SearchStrategy() SearchStrategy
type QuorumIndexer ¶
type QuorumIndexer struct {
// contains filtered or unexported fields
}
func NewQuorumIndexer ¶
func NewQuorumIndexer(validators *pos.Validators, dagi DagIndex, diffMetricFn DiffMetricFn) *QuorumIndexer
func (*QuorumIndexer) GetGlobalMatrix ¶
func (h *QuorumIndexer) GetGlobalMatrix() Matrix
func (*QuorumIndexer) GetGlobalMedianSeqs ¶
func (h *QuorumIndexer) GetGlobalMedianSeqs() []idx.Event
func (*QuorumIndexer) GetMetricOf ¶
func (h *QuorumIndexer) GetMetricOf(id hash.Event) Metric
func (*QuorumIndexer) GetSelfParentSeqs ¶
func (h *QuorumIndexer) GetSelfParentSeqs() []idx.Event
func (*QuorumIndexer) ProcessEvent ¶
func (h *QuorumIndexer) ProcessEvent(event dag.Event, selfEvent bool)
func (*QuorumIndexer) SearchStrategy ¶
func (h *QuorumIndexer) SearchStrategy() SearchStrategy
type RandomStrategy ¶
type RandomStrategy struct {
// contains filtered or unexported fields
}
RandomStrategy is used in tests, when vector clock isn't available
func NewRandomStrategy ¶
func NewRandomStrategy(r *rand.Rand) *RandomStrategy
Click to show internal directories.
Click to hide internal directories.