executor

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2019 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

executor contains internal business logic object for light executor.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrWaiterNotLocked = errors.New("unlocked waiter unlock attempt")
	ErrWriteClosed     = errors.New("requested pulse is closed for writing")
)
View Source
var (
	// StatRequestsOpened specifies a metric about opened requests for the current light
	StatRequestsOpened = stats.Int64(
		"requests_opened",
		"How many requests are opened",
		stats.UnitDimensionless,
	)
	// StatRequestsClosed specifies a metric about closed requests for the current light
	StatRequestsClosed = stats.Int64(
		"requests_closed",
		"How many requests are closed",
		stats.UnitDimensionless,
	)
)

Functions

func OldestMutable added in v0.9.11

func OldestMutable(openRequests []record.CompositeFilamentRecord) *record.CompositeFilamentRecord

OldestMutable searches for a oldest mutable request through a provided list of open requests openRequests MUST be time-ascending order

Types

type ChannelWaiter

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

ChannelWaiter implements methods for locking and unlocking a certain jet id.

func NewChannelWaiter

func NewChannelWaiter() *ChannelWaiter

NewChannelWaiter creates new waiter instance.

func (*ChannelWaiter) CloseAllUntil

func (w *ChannelWaiter) CloseAllUntil(ctx context.Context, pulse insolar.PulseNumber)

CloseAllUntil raises timeouts on all waiters until pulse.

func (*ChannelWaiter) IsReceived

func (w *ChannelWaiter) IsReceived(ctx context.Context, jetID insolar.JetID, pn insolar.PulseNumber) bool

func (*ChannelWaiter) Unlock

func (w *ChannelWaiter) Unlock(ctx context.Context, pulse insolar.PulseNumber, jetID insolar.JetID) error

Unlock raises hotDataChannel

func (*ChannelWaiter) Wait

func (w *ChannelWaiter) Wait(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) error

Wait waits for the raising one of two channels. If hotDataChannel or timeoutChannel was raised, the method returns error Either nil or ErrHotDataTimeout

type Cleaner

type Cleaner interface {
	// NotifyAboutPulse notifies a component about a pulse
	NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

	Stop()
}

Cleaner is an interface that represents a cleaner-component It's supposed, that all the process of cleaning data from LME will be doing by it

type CleanerMock

type CleanerMock struct {
	NotifyAboutPulseMock mCleanerMockNotifyAboutPulse

	StopMock mCleanerMockStop
	// contains filtered or unexported fields
}

CleanerMock implements Cleaner

func NewCleanerMock

func NewCleanerMock(t minimock.Tester) *CleanerMock

NewCleanerMock returns a mock for Cleaner

func (*CleanerMock) MinimockFinish

func (m *CleanerMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*CleanerMock) MinimockNotifyAboutPulseDone

func (m *CleanerMock) MinimockNotifyAboutPulseDone() bool

MinimockNotifyAboutPulseDone returns true if the count of the NotifyAboutPulse invocations corresponds the number of defined expectations

func (*CleanerMock) MinimockNotifyAboutPulseInspect

func (m *CleanerMock) MinimockNotifyAboutPulseInspect()

MinimockNotifyAboutPulseInspect logs each unmet expectation

func (*CleanerMock) MinimockStopDone

func (m *CleanerMock) MinimockStopDone() bool

MinimockStopDone returns true if the count of the Stop invocations corresponds the number of defined expectations

func (*CleanerMock) MinimockStopInspect

func (m *CleanerMock) MinimockStopInspect()

MinimockStopInspect logs each unmet expectation

func (*CleanerMock) MinimockWait

func (m *CleanerMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*CleanerMock) NotifyAboutPulse

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse implements Cleaner

func (*CleanerMock) NotifyAboutPulseAfterCounter

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulseAfterCounter() uint64

NotifyAboutPulseAfterCounter returns a count of finished CleanerMock.NotifyAboutPulse invocations

func (*CleanerMock) NotifyAboutPulseBeforeCounter

func (mmNotifyAboutPulse *CleanerMock) NotifyAboutPulseBeforeCounter() uint64

NotifyAboutPulseBeforeCounter returns a count of CleanerMock.NotifyAboutPulse invocations

func (*CleanerMock) Stop

func (mmStop *CleanerMock) Stop()

Stop implements Cleaner

func (*CleanerMock) StopAfterCounter

func (mmStop *CleanerMock) StopAfterCounter() uint64

StopAfterCounter returns a count of finished CleanerMock.Stop invocations

func (*CleanerMock) StopBeforeCounter

func (mmStop *CleanerMock) StopBeforeCounter() uint64

StopBeforeCounter returns a count of CleanerMock.Stop invocations

type CleanerMockNotifyAboutPulseExpectation

type CleanerMockNotifyAboutPulseExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CleanerMockNotifyAboutPulseExpectation specifies expectation struct of the Cleaner.NotifyAboutPulse

type CleanerMockNotifyAboutPulseParams

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

CleanerMockNotifyAboutPulseParams contains parameters of the Cleaner.NotifyAboutPulse

type CleanerMockStopExpectation

type CleanerMockStopExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

CleanerMockStopExpectation specifies expectation struct of the Cleaner.Stop

type DetachedNotifier added in v0.9.5

type DetachedNotifier interface {
	Notify(
		ctx context.Context,
		openedRequests []record.CompositeFilamentRecord,
		objectID insolar.ID,
		closedRequestID insolar.ID,
	)
}

type DetachedNotifierDefault added in v0.9.5

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

func NewDetachedNotifierDefault added in v0.9.5

func NewDetachedNotifierDefault(
	sender bus.Sender,
) *DetachedNotifierDefault

func (*DetachedNotifierDefault) Notify added in v0.9.5

func (p *DetachedNotifierDefault) Notify(
	ctx context.Context,
	openedRequests []record.CompositeFilamentRecord,
	objectID insolar.ID,
	closedRequestID insolar.ID,
)

Notify sends notifications about detached requests that are ready for execution.

type DetachedNotifierMock added in v0.9.5

type DetachedNotifierMock struct {
	NotifyMock mDetachedNotifierMockNotify
	// contains filtered or unexported fields
}

DetachedNotifierMock implements DetachedNotifier

func NewDetachedNotifierMock added in v0.9.5

func NewDetachedNotifierMock(t minimock.Tester) *DetachedNotifierMock

NewDetachedNotifierMock returns a mock for DetachedNotifier

func (*DetachedNotifierMock) MinimockFinish added in v0.9.5

func (m *DetachedNotifierMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*DetachedNotifierMock) MinimockNotifyDone added in v0.9.5

func (m *DetachedNotifierMock) MinimockNotifyDone() bool

MinimockNotifyDone returns true if the count of the Notify invocations corresponds the number of defined expectations

func (*DetachedNotifierMock) MinimockNotifyInspect added in v0.9.5

func (m *DetachedNotifierMock) MinimockNotifyInspect()

MinimockNotifyInspect logs each unmet expectation

func (*DetachedNotifierMock) MinimockWait added in v0.9.5

func (m *DetachedNotifierMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*DetachedNotifierMock) Notify added in v0.9.5

func (mmNotify *DetachedNotifierMock) Notify(ctx context.Context, openedRequests []record.CompositeFilamentRecord, objectID insolar.ID, closedRequestID insolar.ID)

Notify implements DetachedNotifier

func (*DetachedNotifierMock) NotifyAfterCounter added in v0.9.5

func (mmNotify *DetachedNotifierMock) NotifyAfterCounter() uint64

NotifyAfterCounter returns a count of finished DetachedNotifierMock.Notify invocations

func (*DetachedNotifierMock) NotifyBeforeCounter added in v0.9.5

func (mmNotify *DetachedNotifierMock) NotifyBeforeCounter() uint64

NotifyBeforeCounter returns a count of DetachedNotifierMock.Notify invocations

type DetachedNotifierMockNotifyExpectation added in v0.9.5

type DetachedNotifierMockNotifyExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

DetachedNotifierMockNotifyExpectation specifies expectation struct of the DetachedNotifier.Notify

type DetachedNotifierMockNotifyParams added in v0.9.5

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

DetachedNotifierMockNotifyParams contains parameters of the DetachedNotifier.Notify

type FilamentCalculator

type FilamentCalculator interface {
	// Requests returns request records for objectID's chain, starts from provided id until provided pulse.
	// TODO: remove calcPulse param
	Requests(
		ctx context.Context,
		objectID, from insolar.ID,
		readUntil insolar.PulseNumber,
	) ([]record.CompositeFilamentRecord, error)

	// OpenedRequests returns all opened requests of object for provided pulse.
	OpenedRequests(
		ctx context.Context,
		pulse insolar.PulseNumber,
		objectID insolar.ID,
		pendingOnly bool,
	) ([]record.CompositeFilamentRecord, error)

	// RequestDuplicate searches two records on objectID chain:
	// First one with same ID as requestID param.
	// Second is the Result record Request field of which equals requestID param.
	// Uses request parameter to check if Reason is not empty and to set pulse for scan limit.
	RequestDuplicate(
		ctx context.Context,
		objectID, requestID insolar.ID,
		request record.Request,
	) (
		foundRequest *record.CompositeFilamentRecord,
		foundResult *record.CompositeFilamentRecord,
		err error,
	)

	ResultDuplicate(
		ctx context.Context,
		objectID, resultID insolar.ID,
		result record.Result,
	) (
		foundResult *record.CompositeFilamentRecord,
		err error,
	)

	// RequestInfo is searching for request and result by objectID, requestID and pulse number
	RequestInfo(
		ctx context.Context,
		objectID insolar.ID,
		requestID insolar.ID,
		pulse insolar.PulseNumber,
	) (
		requestInfo FilamentsRequestInfo,
		err error,
	)
}

type FilamentCalculatorDefault

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

func NewFilamentCalculator

func NewFilamentCalculator(
	indexes object.IndexAccessor,
	records object.RecordAccessor,
	coordinator jet.Coordinator,
	jetFetcher JetFetcher,
	sender bus.Sender,
	pulses pulse.Calculator,
) *FilamentCalculatorDefault

func (*FilamentCalculatorDefault) ClearIfLonger added in v0.9.8

func (c *FilamentCalculatorDefault) ClearIfLonger(objID insolar.ID, limit int)

func (*FilamentCalculatorDefault) OpenedRequests

func (c *FilamentCalculatorDefault) OpenedRequests(ctx context.Context, pulse insolar.PulseNumber, objectID insolar.ID, pendingOnly bool) ([]record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) RequestDuplicate

func (c *FilamentCalculatorDefault) RequestDuplicate(
	ctx context.Context, objectID, requestID insolar.ID, request record.Request,
) (*record.CompositeFilamentRecord, *record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) RequestInfo

func (c *FilamentCalculatorDefault) RequestInfo(
	ctx context.Context,
	objectID insolar.ID,
	requestID insolar.ID,
	pulse insolar.PulseNumber,
) (
	FilamentsRequestInfo,
	error,
)

func (*FilamentCalculatorDefault) Requests

func (c *FilamentCalculatorDefault) Requests(
	ctx context.Context,
	objectID,
	from insolar.ID,
	readUntil insolar.PulseNumber,
) ([]record.CompositeFilamentRecord, error)

func (*FilamentCalculatorDefault) ResultDuplicate

func (c *FilamentCalculatorDefault) ResultDuplicate(
	ctx context.Context, objectID, resultID insolar.ID, result record.Result,
) (*record.CompositeFilamentRecord, error)

type FilamentCalculatorMock

type FilamentCalculatorMock struct {
	OpenedRequestsMock mFilamentCalculatorMockOpenedRequests

	RequestDuplicateMock mFilamentCalculatorMockRequestDuplicate

	RequestInfoMock mFilamentCalculatorMockRequestInfo

	RequestsMock mFilamentCalculatorMockRequests

	ResultDuplicateMock mFilamentCalculatorMockResultDuplicate
	// contains filtered or unexported fields
}

FilamentCalculatorMock implements FilamentCalculator

func NewFilamentCalculatorMock

func NewFilamentCalculatorMock(t minimock.Tester) *FilamentCalculatorMock

NewFilamentCalculatorMock returns a mock for FilamentCalculator

func (*FilamentCalculatorMock) MinimockFinish

func (m *FilamentCalculatorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*FilamentCalculatorMock) MinimockOpenedRequestsDone

func (m *FilamentCalculatorMock) MinimockOpenedRequestsDone() bool

MinimockOpenedRequestsDone returns true if the count of the OpenedRequests invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockOpenedRequestsInspect

func (m *FilamentCalculatorMock) MinimockOpenedRequestsInspect()

MinimockOpenedRequestsInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestDuplicateDone

func (m *FilamentCalculatorMock) MinimockRequestDuplicateDone() bool

MinimockRequestDuplicateDone returns true if the count of the RequestDuplicate invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestDuplicateInspect

func (m *FilamentCalculatorMock) MinimockRequestDuplicateInspect()

MinimockRequestDuplicateInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestInfoDone

func (m *FilamentCalculatorMock) MinimockRequestInfoDone() bool

MinimockRequestInfoDone returns true if the count of the RequestInfo invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestInfoInspect

func (m *FilamentCalculatorMock) MinimockRequestInfoInspect()

MinimockRequestInfoInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockRequestsDone

func (m *FilamentCalculatorMock) MinimockRequestsDone() bool

MinimockRequestsDone returns true if the count of the Requests invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockRequestsInspect

func (m *FilamentCalculatorMock) MinimockRequestsInspect()

MinimockRequestsInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockResultDuplicateDone

func (m *FilamentCalculatorMock) MinimockResultDuplicateDone() bool

MinimockResultDuplicateDone returns true if the count of the ResultDuplicate invocations corresponds the number of defined expectations

func (*FilamentCalculatorMock) MinimockResultDuplicateInspect

func (m *FilamentCalculatorMock) MinimockResultDuplicateInspect()

MinimockResultDuplicateInspect logs each unmet expectation

func (*FilamentCalculatorMock) MinimockWait

func (m *FilamentCalculatorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*FilamentCalculatorMock) OpenedRequests

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequests(ctx context.Context, pulse insolar.PulseNumber, objectID insolar.ID, pendingOnly bool) (ca1 []record.CompositeFilamentRecord, err error)

OpenedRequests implements FilamentCalculator

func (*FilamentCalculatorMock) OpenedRequestsAfterCounter

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequestsAfterCounter() uint64

OpenedRequestsAfterCounter returns a count of finished FilamentCalculatorMock.OpenedRequests invocations

func (*FilamentCalculatorMock) OpenedRequestsBeforeCounter

func (mmOpenedRequests *FilamentCalculatorMock) OpenedRequestsBeforeCounter() uint64

OpenedRequestsBeforeCounter returns a count of FilamentCalculatorMock.OpenedRequests invocations

func (*FilamentCalculatorMock) RequestDuplicate

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicate(ctx context.Context, objectID insolar.ID, requestID insolar.ID, request record.Request) (foundRequest *record.CompositeFilamentRecord, foundResult *record.CompositeFilamentRecord, err error)

RequestDuplicate implements FilamentCalculator

func (*FilamentCalculatorMock) RequestDuplicateAfterCounter

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicateAfterCounter() uint64

RequestDuplicateAfterCounter returns a count of finished FilamentCalculatorMock.RequestDuplicate invocations

func (*FilamentCalculatorMock) RequestDuplicateBeforeCounter

func (mmRequestDuplicate *FilamentCalculatorMock) RequestDuplicateBeforeCounter() uint64

RequestDuplicateBeforeCounter returns a count of FilamentCalculatorMock.RequestDuplicate invocations

func (*FilamentCalculatorMock) RequestInfo

func (mmRequestInfo *FilamentCalculatorMock) RequestInfo(ctx context.Context, objectID insolar.ID, requestID insolar.ID, pulse insolar.PulseNumber) (requestInfo FilamentsRequestInfo, err error)

RequestInfo implements FilamentCalculator

func (*FilamentCalculatorMock) RequestInfoAfterCounter

func (mmRequestInfo *FilamentCalculatorMock) RequestInfoAfterCounter() uint64

RequestInfoAfterCounter returns a count of finished FilamentCalculatorMock.RequestInfo invocations

func (*FilamentCalculatorMock) RequestInfoBeforeCounter

func (mmRequestInfo *FilamentCalculatorMock) RequestInfoBeforeCounter() uint64

RequestInfoBeforeCounter returns a count of FilamentCalculatorMock.RequestInfo invocations

func (*FilamentCalculatorMock) Requests

func (mmRequests *FilamentCalculatorMock) Requests(ctx context.Context, objectID insolar.ID, from insolar.ID, readUntil insolar.PulseNumber) (ca1 []record.CompositeFilamentRecord, err error)

Requests implements FilamentCalculator

func (*FilamentCalculatorMock) RequestsAfterCounter

func (mmRequests *FilamentCalculatorMock) RequestsAfterCounter() uint64

RequestsAfterCounter returns a count of finished FilamentCalculatorMock.Requests invocations

func (*FilamentCalculatorMock) RequestsBeforeCounter

func (mmRequests *FilamentCalculatorMock) RequestsBeforeCounter() uint64

RequestsBeforeCounter returns a count of FilamentCalculatorMock.Requests invocations

func (*FilamentCalculatorMock) ResultDuplicate

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicate(ctx context.Context, objectID insolar.ID, resultID insolar.ID, result record.Result) (foundResult *record.CompositeFilamentRecord, err error)

ResultDuplicate implements FilamentCalculator

func (*FilamentCalculatorMock) ResultDuplicateAfterCounter

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicateAfterCounter() uint64

ResultDuplicateAfterCounter returns a count of finished FilamentCalculatorMock.ResultDuplicate invocations

func (*FilamentCalculatorMock) ResultDuplicateBeforeCounter

func (mmResultDuplicate *FilamentCalculatorMock) ResultDuplicateBeforeCounter() uint64

ResultDuplicateBeforeCounter returns a count of FilamentCalculatorMock.ResultDuplicate invocations

type FilamentCalculatorMockOpenedRequestsExpectation

type FilamentCalculatorMockOpenedRequestsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCalculatorMockOpenedRequestsExpectation specifies expectation struct of the FilamentCalculator.OpenedRequests

func (*FilamentCalculatorMockOpenedRequestsExpectation) Then

Then sets up FilamentCalculator.OpenedRequests return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockOpenedRequestsParams

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

FilamentCalculatorMockOpenedRequestsParams contains parameters of the FilamentCalculator.OpenedRequests

type FilamentCalculatorMockOpenedRequestsResults

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

FilamentCalculatorMockOpenedRequestsResults contains results of the FilamentCalculator.OpenedRequests

type FilamentCalculatorMockRequestDuplicateExpectation

type FilamentCalculatorMockRequestDuplicateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCalculatorMockRequestDuplicateExpectation specifies expectation struct of the FilamentCalculator.RequestDuplicate

func (*FilamentCalculatorMockRequestDuplicateExpectation) Then

Then sets up FilamentCalculator.RequestDuplicate return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestDuplicateParams

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

FilamentCalculatorMockRequestDuplicateParams contains parameters of the FilamentCalculator.RequestDuplicate

type FilamentCalculatorMockRequestDuplicateResults

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

FilamentCalculatorMockRequestDuplicateResults contains results of the FilamentCalculator.RequestDuplicate

type FilamentCalculatorMockRequestInfoExpectation

type FilamentCalculatorMockRequestInfoExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCalculatorMockRequestInfoExpectation specifies expectation struct of the FilamentCalculator.RequestInfo

func (*FilamentCalculatorMockRequestInfoExpectation) Then

Then sets up FilamentCalculator.RequestInfo return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestInfoParams

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

FilamentCalculatorMockRequestInfoParams contains parameters of the FilamentCalculator.RequestInfo

type FilamentCalculatorMockRequestInfoResults

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

FilamentCalculatorMockRequestInfoResults contains results of the FilamentCalculator.RequestInfo

type FilamentCalculatorMockRequestsExpectation

type FilamentCalculatorMockRequestsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCalculatorMockRequestsExpectation specifies expectation struct of the FilamentCalculator.Requests

func (*FilamentCalculatorMockRequestsExpectation) Then

Then sets up FilamentCalculator.Requests return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockRequestsParams

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

FilamentCalculatorMockRequestsParams contains parameters of the FilamentCalculator.Requests

type FilamentCalculatorMockRequestsResults

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

FilamentCalculatorMockRequestsResults contains results of the FilamentCalculator.Requests

type FilamentCalculatorMockResultDuplicateExpectation

type FilamentCalculatorMockResultDuplicateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCalculatorMockResultDuplicateExpectation specifies expectation struct of the FilamentCalculator.ResultDuplicate

func (*FilamentCalculatorMockResultDuplicateExpectation) Then

Then sets up FilamentCalculator.ResultDuplicate return parameters for the expectation previously defined by the When method

type FilamentCalculatorMockResultDuplicateParams

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

FilamentCalculatorMockResultDuplicateParams contains parameters of the FilamentCalculator.ResultDuplicate

type FilamentCalculatorMockResultDuplicateResults

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

FilamentCalculatorMockResultDuplicateResults contains results of the FilamentCalculator.ResultDuplicate

type FilamentCleaner

type FilamentCleaner interface {
	ClearIfLonger(objID insolar.ID, limit int)
}

type FilamentCleanerMock

type FilamentCleanerMock struct {
	ClearIfLongerMock mFilamentCleanerMockClearIfLonger
	// contains filtered or unexported fields
}

FilamentCleanerMock implements FilamentCleaner

func NewFilamentCleanerMock

func NewFilamentCleanerMock(t minimock.Tester) *FilamentCleanerMock

NewFilamentCleanerMock returns a mock for FilamentCleaner

func (*FilamentCleanerMock) ClearIfLonger added in v0.9.8

func (mmClearIfLonger *FilamentCleanerMock) ClearIfLonger(objID insolar.ID, limit int)

ClearIfLonger implements FilamentCleaner

func (*FilamentCleanerMock) ClearIfLongerAfterCounter added in v0.9.8

func (mmClearIfLonger *FilamentCleanerMock) ClearIfLongerAfterCounter() uint64

ClearIfLongerAfterCounter returns a count of finished FilamentCleanerMock.ClearIfLonger invocations

func (*FilamentCleanerMock) ClearIfLongerBeforeCounter added in v0.9.8

func (mmClearIfLonger *FilamentCleanerMock) ClearIfLongerBeforeCounter() uint64

ClearIfLongerBeforeCounter returns a count of FilamentCleanerMock.ClearIfLonger invocations

func (*FilamentCleanerMock) MinimockClearIfLongerDone added in v0.9.8

func (m *FilamentCleanerMock) MinimockClearIfLongerDone() bool

MinimockClearIfLongerDone returns true if the count of the ClearIfLonger invocations corresponds the number of defined expectations

func (*FilamentCleanerMock) MinimockClearIfLongerInspect added in v0.9.8

func (m *FilamentCleanerMock) MinimockClearIfLongerInspect()

MinimockClearIfLongerInspect logs each unmet expectation

func (*FilamentCleanerMock) MinimockFinish

func (m *FilamentCleanerMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*FilamentCleanerMock) MinimockWait

func (m *FilamentCleanerMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type FilamentCleanerMockClearIfLongerExpectation added in v0.9.8

type FilamentCleanerMockClearIfLongerExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

FilamentCleanerMockClearIfLongerExpectation specifies expectation struct of the FilamentCleaner.ClearIfLonger

type FilamentCleanerMockClearIfLongerParams added in v0.9.8

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

FilamentCleanerMockClearIfLongerParams contains parameters of the FilamentCleaner.ClearIfLonger

type FilamentsRequestInfo added in v0.9.11

type FilamentsRequestInfo struct {
	Request       *record.CompositeFilamentRecord
	Result        *record.CompositeFilamentRecord
	OldestMutable bool
}

type HotDataStatusChecker

type HotDataStatusChecker interface {
	IsReceived(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) bool
}

HotDataStatusChecker provides methods for checking receiving status of hot data.

type HotSender

type HotSender interface {
	SendHot(ctx context.Context, old, new insolar.PulseNumber, jets []insolar.JetID) error
}

HotSender provides sending hot records send for provided pulse.

type HotSenderDefault

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

HotSenderDefault implements HotSender.

func NewHotSender

func NewHotSender(
	dropAccessor drop.Accessor,
	indexAccessor object.IndexAccessor,
	pulseCalculator pulse.Calculator,
	jetAccessor jet.Accessor,
	lightChainLimit int,
	sender bus.Sender,
) *HotSenderDefault

NewHotSender returns a new instance of a default HotSender implementation.

func (*HotSenderDefault) SendHot

func (m *HotSenderDefault) SendHot(
	ctx context.Context, currentPulse, newPulse insolar.PulseNumber, jets []insolar.JetID,
) error

SendHot send hot records from oldPulse to all jets in newPulse.

type JetCalculator

type JetCalculator interface {
	// MineForPulse returns current node's jets for a provided pulse
	MineForPulse(ctx context.Context, pn insolar.PulseNumber) ([]insolar.JetID, error)
}

JetCalculator provides get jets method for provided pulse.

type JetCalculatorDefault

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

JetCalculatorDefault implements JetCalculator.

func NewJetCalculator

func NewJetCalculator(jetCoordinator jet.Coordinator, jetAccessor jet.Accessor) *JetCalculatorDefault

NewJetCalculator returns a new instance of a default jet calculator implementation.

func (*JetCalculatorDefault) MineForPulse

func (c *JetCalculatorDefault) MineForPulse(ctx context.Context, pn insolar.PulseNumber) ([]insolar.JetID, error)

MineForPulse returns current node's jets for a provided pulse.

type JetCalculatorMock

type JetCalculatorMock struct {
	MineForPulseMock mJetCalculatorMockMineForPulse
	// contains filtered or unexported fields
}

JetCalculatorMock implements JetCalculator

func NewJetCalculatorMock

func NewJetCalculatorMock(t minimock.Tester) *JetCalculatorMock

NewJetCalculatorMock returns a mock for JetCalculator

func (*JetCalculatorMock) MineForPulse

func (mmMineForPulse *JetCalculatorMock) MineForPulse(ctx context.Context, pn insolar.PulseNumber) (ja1 []insolar.JetID, err error)

MineForPulse implements JetCalculator

func (*JetCalculatorMock) MineForPulseAfterCounter

func (mmMineForPulse *JetCalculatorMock) MineForPulseAfterCounter() uint64

MineForPulseAfterCounter returns a count of finished JetCalculatorMock.MineForPulse invocations

func (*JetCalculatorMock) MineForPulseBeforeCounter

func (mmMineForPulse *JetCalculatorMock) MineForPulseBeforeCounter() uint64

MineForPulseBeforeCounter returns a count of JetCalculatorMock.MineForPulse invocations

func (*JetCalculatorMock) MinimockFinish

func (m *JetCalculatorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*JetCalculatorMock) MinimockMineForPulseDone

func (m *JetCalculatorMock) MinimockMineForPulseDone() bool

MinimockMineForPulseDone returns true if the count of the MineForPulse invocations corresponds the number of defined expectations

func (*JetCalculatorMock) MinimockMineForPulseInspect

func (m *JetCalculatorMock) MinimockMineForPulseInspect()

MinimockMineForPulseInspect logs each unmet expectation

func (*JetCalculatorMock) MinimockWait

func (m *JetCalculatorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type JetCalculatorMockMineForPulseExpectation

type JetCalculatorMockMineForPulseExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetCalculatorMockMineForPulseExpectation specifies expectation struct of the JetCalculator.MineForPulse

func (*JetCalculatorMockMineForPulseExpectation) Then

Then sets up JetCalculator.MineForPulse return parameters for the expectation previously defined by the When method

type JetCalculatorMockMineForPulseParams

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

JetCalculatorMockMineForPulseParams contains parameters of the JetCalculator.MineForPulse

type JetCalculatorMockMineForPulseResults

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

JetCalculatorMockMineForPulseResults contains results of the JetCalculator.MineForPulse

type JetFetcher

type JetFetcher interface {
	Fetch(ctx context.Context, target insolar.ID, pulse insolar.PulseNumber) (*insolar.ID, error)
	Release(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber)
}

JetFetcher can be used to get actual jets. It involves fetching jet from other nodes via network and updating local jet tree.

func NewFetcher

func NewFetcher(
	ans node.Accessor,
	js jet.Storage,
	s bus.Sender,
	jc jet.Coordinator,
) JetFetcher

NewFetcher creates new fetcher instance.

type JetFetcherMock

type JetFetcherMock struct {
	FetchMock mJetFetcherMockFetch

	ReleaseMock mJetFetcherMockRelease
	// contains filtered or unexported fields
}

JetFetcherMock implements JetFetcher

func NewJetFetcherMock

func NewJetFetcherMock(t minimock.Tester) *JetFetcherMock

NewJetFetcherMock returns a mock for JetFetcher

func (*JetFetcherMock) Fetch

func (mmFetch *JetFetcherMock) Fetch(ctx context.Context, target insolar.ID, pulse insolar.PulseNumber) (ip1 *insolar.ID, err error)

Fetch implements JetFetcher

func (*JetFetcherMock) FetchAfterCounter

func (mmFetch *JetFetcherMock) FetchAfterCounter() uint64

FetchAfterCounter returns a count of finished JetFetcherMock.Fetch invocations

func (*JetFetcherMock) FetchBeforeCounter

func (mmFetch *JetFetcherMock) FetchBeforeCounter() uint64

FetchBeforeCounter returns a count of JetFetcherMock.Fetch invocations

func (*JetFetcherMock) MinimockFetchDone

func (m *JetFetcherMock) MinimockFetchDone() bool

MinimockFetchDone returns true if the count of the Fetch invocations corresponds the number of defined expectations

func (*JetFetcherMock) MinimockFetchInspect

func (m *JetFetcherMock) MinimockFetchInspect()

MinimockFetchInspect logs each unmet expectation

func (*JetFetcherMock) MinimockFinish

func (m *JetFetcherMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*JetFetcherMock) MinimockReleaseDone

func (m *JetFetcherMock) MinimockReleaseDone() bool

MinimockReleaseDone returns true if the count of the Release invocations corresponds the number of defined expectations

func (*JetFetcherMock) MinimockReleaseInspect

func (m *JetFetcherMock) MinimockReleaseInspect()

MinimockReleaseInspect logs each unmet expectation

func (*JetFetcherMock) MinimockWait

func (m *JetFetcherMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*JetFetcherMock) Release

func (mmRelease *JetFetcherMock) Release(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber)

Release implements JetFetcher

func (*JetFetcherMock) ReleaseAfterCounter

func (mmRelease *JetFetcherMock) ReleaseAfterCounter() uint64

ReleaseAfterCounter returns a count of finished JetFetcherMock.Release invocations

func (*JetFetcherMock) ReleaseBeforeCounter

func (mmRelease *JetFetcherMock) ReleaseBeforeCounter() uint64

ReleaseBeforeCounter returns a count of JetFetcherMock.Release invocations

type JetFetcherMockFetchExpectation

type JetFetcherMockFetchExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetFetcherMockFetchExpectation specifies expectation struct of the JetFetcher.Fetch

func (*JetFetcherMockFetchExpectation) Then

Then sets up JetFetcher.Fetch return parameters for the expectation previously defined by the When method

type JetFetcherMockFetchParams

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

JetFetcherMockFetchParams contains parameters of the JetFetcher.Fetch

type JetFetcherMockFetchResults

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

JetFetcherMockFetchResults contains results of the JetFetcher.Fetch

type JetFetcherMockReleaseExpectation

type JetFetcherMockReleaseExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetFetcherMockReleaseExpectation specifies expectation struct of the JetFetcher.Release

type JetFetcherMockReleaseParams

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

JetFetcherMockReleaseParams contains parameters of the JetFetcher.Release

type JetInfo

type JetInfo struct {
	ID insolar.JetID
	// SplitIntent indicates what jet has intention to do split in next pulse.
	SplitIntent bool
	// MustSplit indicates what jet should be split in current pulse.
	MustSplit bool
}

JetInfo holds info about jet.

type JetReleaser

type JetReleaser interface {
	Unlock(ctx context.Context, pulse insolar.PulseNumber, jetID insolar.JetID) error
	CloseAllUntil(ctx context.Context, pulse insolar.PulseNumber)
}

JetReleaser provides methods for releasing jet waiters.

type JetReleaserMock

type JetReleaserMock struct {
	CloseAllUntilMock mJetReleaserMockCloseAllUntil

	UnlockMock mJetReleaserMockUnlock
	// contains filtered or unexported fields
}

JetReleaserMock implements JetReleaser

func NewJetReleaserMock

func NewJetReleaserMock(t minimock.Tester) *JetReleaserMock

NewJetReleaserMock returns a mock for JetReleaser

func (*JetReleaserMock) CloseAllUntil

func (mmCloseAllUntil *JetReleaserMock) CloseAllUntil(ctx context.Context, pulse insolar.PulseNumber)

CloseAllUntil implements JetReleaser

func (*JetReleaserMock) CloseAllUntilAfterCounter

func (mmCloseAllUntil *JetReleaserMock) CloseAllUntilAfterCounter() uint64

CloseAllUntilAfterCounter returns a count of finished JetReleaserMock.CloseAllUntil invocations

func (*JetReleaserMock) CloseAllUntilBeforeCounter

func (mmCloseAllUntil *JetReleaserMock) CloseAllUntilBeforeCounter() uint64

CloseAllUntilBeforeCounter returns a count of JetReleaserMock.CloseAllUntil invocations

func (*JetReleaserMock) MinimockCloseAllUntilDone

func (m *JetReleaserMock) MinimockCloseAllUntilDone() bool

MinimockCloseAllUntilDone returns true if the count of the CloseAllUntil invocations corresponds the number of defined expectations

func (*JetReleaserMock) MinimockCloseAllUntilInspect

func (m *JetReleaserMock) MinimockCloseAllUntilInspect()

MinimockCloseAllUntilInspect logs each unmet expectation

func (*JetReleaserMock) MinimockFinish

func (m *JetReleaserMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*JetReleaserMock) MinimockUnlockDone

func (m *JetReleaserMock) MinimockUnlockDone() bool

MinimockUnlockDone returns true if the count of the Unlock invocations corresponds the number of defined expectations

func (*JetReleaserMock) MinimockUnlockInspect

func (m *JetReleaserMock) MinimockUnlockInspect()

MinimockUnlockInspect logs each unmet expectation

func (*JetReleaserMock) MinimockWait

func (m *JetReleaserMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*JetReleaserMock) Unlock

func (mmUnlock *JetReleaserMock) Unlock(ctx context.Context, pulse insolar.PulseNumber, jetID insolar.JetID) (err error)

Unlock implements JetReleaser

func (*JetReleaserMock) UnlockAfterCounter

func (mmUnlock *JetReleaserMock) UnlockAfterCounter() uint64

UnlockAfterCounter returns a count of finished JetReleaserMock.Unlock invocations

func (*JetReleaserMock) UnlockBeforeCounter

func (mmUnlock *JetReleaserMock) UnlockBeforeCounter() uint64

UnlockBeforeCounter returns a count of JetReleaserMock.Unlock invocations

type JetReleaserMockCloseAllUntilExpectation

type JetReleaserMockCloseAllUntilExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetReleaserMockCloseAllUntilExpectation specifies expectation struct of the JetReleaser.CloseAllUntil

type JetReleaserMockCloseAllUntilParams

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

JetReleaserMockCloseAllUntilParams contains parameters of the JetReleaser.CloseAllUntil

type JetReleaserMockUnlockExpectation

type JetReleaserMockUnlockExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetReleaserMockUnlockExpectation specifies expectation struct of the JetReleaser.Unlock

func (*JetReleaserMockUnlockExpectation) Then

Then sets up JetReleaser.Unlock return parameters for the expectation previously defined by the When method

type JetReleaserMockUnlockParams

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

JetReleaserMockUnlockParams contains parameters of the JetReleaser.Unlock

type JetReleaserMockUnlockResults

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

JetReleaserMockUnlockResults contains results of the JetReleaser.Unlock

type JetSplitter

type JetSplitter interface {
	// Do performs jets processing, it decides which jets to split and returns list of resulting jets).
	Do(
		ctx context.Context,
		ended insolar.PulseNumber,
		new insolar.PulseNumber,
		jets []insolar.JetID,
		createDrops bool,
	) ([]insolar.JetID, error)
}

JetSplitter provides method for processing and splitting jets.

type JetSplitterDefault

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

JetSplitterDefault implements JetSplitter.

func NewJetSplitter

func NewJetSplitter(
	cfg configuration.JetSplit,
	jetCalculator JetCalculator,
	jetAccessor jet.Accessor,
	jetModifier jet.Modifier,
	dropAccessor drop.Accessor,
	dropModifier drop.Modifier,
	pulseCalculator pulse.Calculator,
	recordsAccessor object.RecordCollectionAccessor,
) *JetSplitterDefault

NewJetSplitter returns a new instance of a default jet splitter implementation.

func (*JetSplitterDefault) Do

func (js *JetSplitterDefault) Do(
	ctx context.Context,
	endedPulse insolar.PulseNumber,
	newPulse insolar.PulseNumber,
	jets []insolar.JetID,
	createDrops bool,
) ([]insolar.JetID, error)

Do performs jets processing, it decides which jets to split and returns list of resulting jets.

type JetWaiter

type JetWaiter interface {
	Wait(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) error
}

JetWaiter provides method for locking on jet id.

type JetWaiterMock added in v0.9.2

type JetWaiterMock struct {
	WaitMock mJetWaiterMockWait
	// contains filtered or unexported fields
}

JetWaiterMock implements JetWaiter

func NewJetWaiterMock added in v0.9.2

func NewJetWaiterMock(t minimock.Tester) *JetWaiterMock

NewJetWaiterMock returns a mock for JetWaiter

func (*JetWaiterMock) MinimockFinish added in v0.9.2

func (m *JetWaiterMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*JetWaiterMock) MinimockWait added in v0.9.2

func (m *JetWaiterMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*JetWaiterMock) MinimockWaitDone added in v0.9.2

func (m *JetWaiterMock) MinimockWaitDone() bool

MinimockWaitDone returns true if the count of the Wait invocations corresponds the number of defined expectations

func (*JetWaiterMock) MinimockWaitInspect added in v0.9.2

func (m *JetWaiterMock) MinimockWaitInspect()

MinimockWaitInspect logs each unmet expectation

func (*JetWaiterMock) Wait added in v0.9.2

func (mmWait *JetWaiterMock) Wait(ctx context.Context, jetID insolar.JetID, pulse insolar.PulseNumber) (err error)

Wait implements JetWaiter

func (*JetWaiterMock) WaitAfterCounter added in v0.9.2

func (mmWait *JetWaiterMock) WaitAfterCounter() uint64

WaitAfterCounter returns a count of finished JetWaiterMock.Wait invocations

func (*JetWaiterMock) WaitBeforeCounter added in v0.9.2

func (mmWait *JetWaiterMock) WaitBeforeCounter() uint64

WaitBeforeCounter returns a count of JetWaiterMock.Wait invocations

type JetWaiterMockWaitExpectation added in v0.9.2

type JetWaiterMockWaitExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

JetWaiterMockWaitExpectation specifies expectation struct of the JetWaiter.Wait

func (*JetWaiterMockWaitExpectation) Then added in v0.9.2

Then sets up JetWaiter.Wait return parameters for the expectation previously defined by the When method

type JetWaiterMockWaitParams added in v0.9.2

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

JetWaiterMockWaitParams contains parameters of the JetWaiter.Wait

type JetWaiterMockWaitResults added in v0.9.2

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

JetWaiterMockWaitResults contains results of the JetWaiter.Wait

type LightCleaner

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

LightCleaner is an implementation of Cleaner interface

func NewCleaner

func NewCleaner(
	jetCleaner jet.Cleaner,
	nodeModifier node.Modifier,
	dropCleaner drop.Cleaner,
	recCleaner object.RecordCleaner,
	indexCleaner object.IndexCleaner,
	pulseShifter pulse.Shifter,
	pulseCalculator pulse.Calculator,
	indexAccessor object.IndexAccessor,
	filamentCleaner FilamentCleaner,
	lightChainLimit int,
	cleanerDelay int,
	filamentLimit int,
) *LightCleaner

NewCleaner creates a new instance of LightCleaner

func (*LightCleaner) NotifyAboutPulse

func (c *LightCleaner) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse cleans a light's data. When it's called, it tries to fetch pulse, which is backwards by a size of lightChainLimit. If a pulse is fetched successfully, all the data for it will be cleaned

func (*LightCleaner) Stop

func (c *LightCleaner) Stop()

type LightReplicator

type LightReplicator interface {
	// NotifyAboutPulse is method for notifying a sync component about new pulse
	NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

	// Stop stops the component
	Stop()
}

LightReplicator is a base interface for a sync component

type LightReplicatorDefault

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

LightReplicatorDefault is a base impl of LightReplicator

func NewReplicatorDefault

func NewReplicatorDefault(
	jetCalculator JetCalculator,
	cleaner Cleaner,
	sender bus.Sender,
	calculator pulse.Calculator,
	dropAccessor drop.Accessor,
	recsAccessor object.RecordCollectionAccessor,
	idxAccessor object.IndexAccessor,
	jetAccessor jet.Accessor,
) *LightReplicatorDefault

NewReplicatorDefault creates new instance of LightReplicator

func (*LightReplicatorDefault) NotifyAboutPulse

func (lr *LightReplicatorDefault) NotifyAboutPulse(ctx context.Context, pn insolar.PulseNumber)

NotifyAboutPulse is method for notifying a sync component about new pulse When it's called, a provided pulse is added to a channel. There is a special gorutine that is reading that channel. When a new pulse is being received, the routine starts to gather data (with using of LightDataGatherer). After gathering all the data, it attempts to send it to the heavy. After sending a heavy payload to a heavy, data is deleted with help of Cleaner

func (*LightReplicatorDefault) Stop

func (lr *LightReplicatorDefault) Stop()

type MetricsRegistry added in v0.9.12

type MetricsRegistry interface {
	SetOldestAbandonedRequestAge(age int)
	UpdateMetrics(ctx context.Context)
}

go:generate minimock -i github.com/insolar/insolar/ledger/light/executor.MetricsRegistry -o ./ -s _mock.go -g

func NewMetricsRegistry added in v0.9.12

func NewMetricsRegistry() MetricsRegistry

type MetricsRegistryMock added in v0.9.12

type MetricsRegistryMock struct {
	SetOldestAbandonedRequestAgeMock mMetricsRegistryMockSetOldestAbandonedRequestAge

	UpdateMetricsMock mMetricsRegistryMockUpdateMetrics
	// contains filtered or unexported fields
}

MetricsRegistryMock implements MetricsRegistry

func NewMetricsRegistryMock added in v0.9.12

func NewMetricsRegistryMock(t minimock.Tester) *MetricsRegistryMock

NewMetricsRegistryMock returns a mock for MetricsRegistry

func (*MetricsRegistryMock) MinimockFinish added in v0.9.12

func (m *MetricsRegistryMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*MetricsRegistryMock) MinimockSetOldestAbandonedRequestAgeDone added in v0.9.12

func (m *MetricsRegistryMock) MinimockSetOldestAbandonedRequestAgeDone() bool

MinimockSetOldestAbandonedRequestAgeDone returns true if the count of the SetOldestAbandonedRequestAge invocations corresponds the number of defined expectations

func (*MetricsRegistryMock) MinimockSetOldestAbandonedRequestAgeInspect added in v0.9.12

func (m *MetricsRegistryMock) MinimockSetOldestAbandonedRequestAgeInspect()

MinimockSetOldestAbandonedRequestAgeInspect logs each unmet expectation

func (*MetricsRegistryMock) MinimockUpdateMetricsDone added in v0.9.12

func (m *MetricsRegistryMock) MinimockUpdateMetricsDone() bool

MinimockUpdateMetricsDone returns true if the count of the UpdateMetrics invocations corresponds the number of defined expectations

func (*MetricsRegistryMock) MinimockUpdateMetricsInspect added in v0.9.12

func (m *MetricsRegistryMock) MinimockUpdateMetricsInspect()

MinimockUpdateMetricsInspect logs each unmet expectation

func (*MetricsRegistryMock) MinimockWait added in v0.9.12

func (m *MetricsRegistryMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*MetricsRegistryMock) SetOldestAbandonedRequestAge added in v0.9.12

func (mmSetOldestAbandonedRequestAge *MetricsRegistryMock) SetOldestAbandonedRequestAge(age int)

SetOldestAbandonedRequestAge implements MetricsRegistry

func (*MetricsRegistryMock) SetOldestAbandonedRequestAgeAfterCounter added in v0.9.12

func (mmSetOldestAbandonedRequestAge *MetricsRegistryMock) SetOldestAbandonedRequestAgeAfterCounter() uint64

SetOldestAbandonedRequestAgeAfterCounter returns a count of finished MetricsRegistryMock.SetOldestAbandonedRequestAge invocations

func (*MetricsRegistryMock) SetOldestAbandonedRequestAgeBeforeCounter added in v0.9.12

func (mmSetOldestAbandonedRequestAge *MetricsRegistryMock) SetOldestAbandonedRequestAgeBeforeCounter() uint64

SetOldestAbandonedRequestAgeBeforeCounter returns a count of MetricsRegistryMock.SetOldestAbandonedRequestAge invocations

func (*MetricsRegistryMock) UpdateMetrics added in v0.9.12

func (mmUpdateMetrics *MetricsRegistryMock) UpdateMetrics(ctx context.Context)

UpdateMetrics implements MetricsRegistry

func (*MetricsRegistryMock) UpdateMetricsAfterCounter added in v0.9.12

func (mmUpdateMetrics *MetricsRegistryMock) UpdateMetricsAfterCounter() uint64

UpdateMetricsAfterCounter returns a count of finished MetricsRegistryMock.UpdateMetrics invocations

func (*MetricsRegistryMock) UpdateMetricsBeforeCounter added in v0.9.12

func (mmUpdateMetrics *MetricsRegistryMock) UpdateMetricsBeforeCounter() uint64

UpdateMetricsBeforeCounter returns a count of MetricsRegistryMock.UpdateMetrics invocations

type MetricsRegistryMockSetOldestAbandonedRequestAgeExpectation added in v0.9.12

type MetricsRegistryMockSetOldestAbandonedRequestAgeExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

MetricsRegistryMockSetOldestAbandonedRequestAgeExpectation specifies expectation struct of the MetricsRegistry.SetOldestAbandonedRequestAge

type MetricsRegistryMockSetOldestAbandonedRequestAgeParams added in v0.9.12

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

MetricsRegistryMockSetOldestAbandonedRequestAgeParams contains parameters of the MetricsRegistry.SetOldestAbandonedRequestAge

type MetricsRegistryMockUpdateMetricsExpectation added in v0.9.12

type MetricsRegistryMockUpdateMetricsExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

MetricsRegistryMockUpdateMetricsExpectation specifies expectation struct of the MetricsRegistry.UpdateMetrics

type MetricsRegistryMockUpdateMetricsParams added in v0.9.12

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

MetricsRegistryMockUpdateMetricsParams contains parameters of the MetricsRegistry.UpdateMetrics

type PulseManager

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

PulseManager implements insolar.PulseManager.

func NewPulseManager

func NewPulseManager(
	nodeNet network.NodeNetwork,
	dispatchers []dispatcher.Dispatcher,
	nodeSetter node.Modifier,
	pulseAccessor pulse.Accessor,
	pulseAppender pulse.Appender,
	jetReleaser JetReleaser,
	jetSplitter JetSplitter,
	lightReplicator LightReplicator,
	hotSender HotSender,
	writeManager WriteManager,
	stateIniter StateIniter,
	hotStatusChecker HotDataStatusChecker,
	registry MetricsRegistry,
) *PulseManager

NewPulseManager creates PulseManager instance.

func (*PulseManager) Set

func (m *PulseManager) Set(ctx context.Context, newPulse insolar.Pulse) error

Set set's new pulse and closes current jet drop.

type RequestChecker

type RequestChecker interface {
	// ValidateRequest is a smoke test. It doesn't perform expensive checks. Good to check requests before deduplication.
	ValidateRequest(ctx context.Context, requestID insolar.ID, request record.Request) error
	// CheckRequest performs a complete expensive request check.
	CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) error
}

type RequestCheckerDefault

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

func (*RequestCheckerDefault) CheckRequest

func (c *RequestCheckerDefault) CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) error

func (*RequestCheckerDefault) ValidateRequest added in v0.9.11

func (c *RequestCheckerDefault) ValidateRequest(ctx context.Context, requestID insolar.ID, request record.Request) error

type RequestCheckerMock

type RequestCheckerMock struct {
	CheckRequestMock mRequestCheckerMockCheckRequest

	ValidateRequestMock mRequestCheckerMockValidateRequest
	// contains filtered or unexported fields
}

RequestCheckerMock implements RequestChecker

func NewRequestCheckerMock

func NewRequestCheckerMock(t minimock.Tester) *RequestCheckerMock

NewRequestCheckerMock returns a mock for RequestChecker

func (*RequestCheckerMock) CheckRequest

func (mmCheckRequest *RequestCheckerMock) CheckRequest(ctx context.Context, requestID insolar.ID, request record.Request) (err error)

CheckRequest implements RequestChecker

func (*RequestCheckerMock) CheckRequestAfterCounter

func (mmCheckRequest *RequestCheckerMock) CheckRequestAfterCounter() uint64

CheckRequestAfterCounter returns a count of finished RequestCheckerMock.CheckRequest invocations

func (*RequestCheckerMock) CheckRequestBeforeCounter

func (mmCheckRequest *RequestCheckerMock) CheckRequestBeforeCounter() uint64

CheckRequestBeforeCounter returns a count of RequestCheckerMock.CheckRequest invocations

func (*RequestCheckerMock) MinimockCheckRequestDone

func (m *RequestCheckerMock) MinimockCheckRequestDone() bool

MinimockCheckRequestDone returns true if the count of the CheckRequest invocations corresponds the number of defined expectations

func (*RequestCheckerMock) MinimockCheckRequestInspect

func (m *RequestCheckerMock) MinimockCheckRequestInspect()

MinimockCheckRequestInspect logs each unmet expectation

func (*RequestCheckerMock) MinimockFinish

func (m *RequestCheckerMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*RequestCheckerMock) MinimockValidateRequestDone added in v0.9.11

func (m *RequestCheckerMock) MinimockValidateRequestDone() bool

MinimockValidateRequestDone returns true if the count of the ValidateRequest invocations corresponds the number of defined expectations

func (*RequestCheckerMock) MinimockValidateRequestInspect added in v0.9.11

func (m *RequestCheckerMock) MinimockValidateRequestInspect()

MinimockValidateRequestInspect logs each unmet expectation

func (*RequestCheckerMock) MinimockWait

func (m *RequestCheckerMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*RequestCheckerMock) ValidateRequest added in v0.9.11

func (mmValidateRequest *RequestCheckerMock) ValidateRequest(ctx context.Context, requestID insolar.ID, request record.Request) (err error)

ValidateRequest implements RequestChecker

func (*RequestCheckerMock) ValidateRequestAfterCounter added in v0.9.11

func (mmValidateRequest *RequestCheckerMock) ValidateRequestAfterCounter() uint64

ValidateRequestAfterCounter returns a count of finished RequestCheckerMock.ValidateRequest invocations

func (*RequestCheckerMock) ValidateRequestBeforeCounter added in v0.9.11

func (mmValidateRequest *RequestCheckerMock) ValidateRequestBeforeCounter() uint64

ValidateRequestBeforeCounter returns a count of RequestCheckerMock.ValidateRequest invocations

type RequestCheckerMockCheckRequestExpectation

type RequestCheckerMockCheckRequestExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

RequestCheckerMockCheckRequestExpectation specifies expectation struct of the RequestChecker.CheckRequest

func (*RequestCheckerMockCheckRequestExpectation) Then

Then sets up RequestChecker.CheckRequest return parameters for the expectation previously defined by the When method

type RequestCheckerMockCheckRequestParams

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

RequestCheckerMockCheckRequestParams contains parameters of the RequestChecker.CheckRequest

type RequestCheckerMockCheckRequestResults

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

RequestCheckerMockCheckRequestResults contains results of the RequestChecker.CheckRequest

type RequestCheckerMockValidateRequestExpectation added in v0.9.11

type RequestCheckerMockValidateRequestExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

RequestCheckerMockValidateRequestExpectation specifies expectation struct of the RequestChecker.ValidateRequest

func (*RequestCheckerMockValidateRequestExpectation) Then added in v0.9.11

Then sets up RequestChecker.ValidateRequest return parameters for the expectation previously defined by the When method

type RequestCheckerMockValidateRequestParams added in v0.9.11

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

RequestCheckerMockValidateRequestParams contains parameters of the RequestChecker.ValidateRequest

type RequestCheckerMockValidateRequestResults added in v0.9.11

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

RequestCheckerMockValidateRequestResults contains results of the RequestChecker.ValidateRequest

type StateIniter

type StateIniter interface {
	// PrepareState prepares actual data to get the light started.
	// Fetch necessary jets and drops from heavy.
	PrepareState(ctx context.Context, pulse insolar.PulseNumber) (justJoined bool, jets []insolar.JetID, err error)
}

type StateIniterDefault

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

StateIniterDefault implements StateIniter.

func NewStateIniter

func NewStateIniter(
	jetModifier jet.Modifier,
	jetReleaser JetReleaser,
	drops drop.Modifier,
	nodes node.Accessor,
	sender bus.Sender,
	pulseAppender insolarPulse.Appender,
	pulseAccessor insolarPulse.Accessor,
	calc JetCalculator,
	indexes object.MemoryIndexModifier,
) *StateIniterDefault

NewStateIniter creates StateIniterDefault with all required components.

func (*StateIniterDefault) PrepareState

func (s *StateIniterDefault) PrepareState(
	ctx context.Context,
	forPulse insolar.PulseNumber,
) (bool, []insolar.JetID, error)

type StateIniterMock

type StateIniterMock struct {
	PrepareStateMock mStateIniterMockPrepareState
	// contains filtered or unexported fields
}

StateIniterMock implements StateIniter

func NewStateIniterMock

func NewStateIniterMock(t minimock.Tester) *StateIniterMock

NewStateIniterMock returns a mock for StateIniter

func (*StateIniterMock) MinimockFinish

func (m *StateIniterMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*StateIniterMock) MinimockPrepareStateDone

func (m *StateIniterMock) MinimockPrepareStateDone() bool

MinimockPrepareStateDone returns true if the count of the PrepareState invocations corresponds the number of defined expectations

func (*StateIniterMock) MinimockPrepareStateInspect

func (m *StateIniterMock) MinimockPrepareStateInspect()

MinimockPrepareStateInspect logs each unmet expectation

func (*StateIniterMock) MinimockWait

func (m *StateIniterMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*StateIniterMock) PrepareState

func (mmPrepareState *StateIniterMock) PrepareState(ctx context.Context, pulse insolar.PulseNumber) (justJoined bool, jets []insolar.JetID, err error)

PrepareState implements StateIniter

func (*StateIniterMock) PrepareStateAfterCounter

func (mmPrepareState *StateIniterMock) PrepareStateAfterCounter() uint64

PrepareStateAfterCounter returns a count of finished StateIniterMock.PrepareState invocations

func (*StateIniterMock) PrepareStateBeforeCounter

func (mmPrepareState *StateIniterMock) PrepareStateBeforeCounter() uint64

PrepareStateBeforeCounter returns a count of StateIniterMock.PrepareState invocations

type StateIniterMockPrepareStateExpectation

type StateIniterMockPrepareStateExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

StateIniterMockPrepareStateExpectation specifies expectation struct of the StateIniter.PrepareState

func (*StateIniterMockPrepareStateExpectation) Then

Then sets up StateIniter.PrepareState return parameters for the expectation previously defined by the When method

type StateIniterMockPrepareStateParams

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

StateIniterMockPrepareStateParams contains parameters of the StateIniter.PrepareState

type StateIniterMockPrepareStateResults

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

StateIniterMockPrepareStateResults contains results of the StateIniter.PrepareState

type WriteAccessor

type WriteAccessor interface {
	// Begin requests writing access for pulse number. If requested pulse is closed, ErrWriteClosed will be returned.
	// The caller must call returned "done" function when finished writing.
	Begin(context.Context, insolar.PulseNumber) (done func(), err error)
}

type WriteAccessorMock

type WriteAccessorMock struct {
	BeginMock mWriteAccessorMockBegin
	// contains filtered or unexported fields
}

WriteAccessorMock implements WriteAccessor

func NewWriteAccessorMock

func NewWriteAccessorMock(t minimock.Tester) *WriteAccessorMock

NewWriteAccessorMock returns a mock for WriteAccessor

func (*WriteAccessorMock) Begin

func (mmBegin *WriteAccessorMock) Begin(ctx context.Context, p1 insolar.PulseNumber) (done func(), err error)

Begin implements WriteAccessor

func (*WriteAccessorMock) BeginAfterCounter

func (mmBegin *WriteAccessorMock) BeginAfterCounter() uint64

BeginAfterCounter returns a count of finished WriteAccessorMock.Begin invocations

func (*WriteAccessorMock) BeginBeforeCounter

func (mmBegin *WriteAccessorMock) BeginBeforeCounter() uint64

BeginBeforeCounter returns a count of WriteAccessorMock.Begin invocations

func (*WriteAccessorMock) MinimockBeginDone

func (m *WriteAccessorMock) MinimockBeginDone() bool

MinimockBeginDone returns true if the count of the Begin invocations corresponds the number of defined expectations

func (*WriteAccessorMock) MinimockBeginInspect

func (m *WriteAccessorMock) MinimockBeginInspect()

MinimockBeginInspect logs each unmet expectation

func (*WriteAccessorMock) MinimockFinish

func (m *WriteAccessorMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*WriteAccessorMock) MinimockWait

func (m *WriteAccessorMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

type WriteAccessorMockBeginExpectation

type WriteAccessorMockBeginExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

WriteAccessorMockBeginExpectation specifies expectation struct of the WriteAccessor.Begin

func (*WriteAccessorMockBeginExpectation) Then

func (e *WriteAccessorMockBeginExpectation) Then(done func(), err error) *WriteAccessorMock

Then sets up WriteAccessor.Begin return parameters for the expectation previously defined by the When method

type WriteAccessorMockBeginParams

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

WriteAccessorMockBeginParams contains parameters of the WriteAccessor.Begin

type WriteAccessorMockBeginResults

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

WriteAccessorMockBeginResults contains results of the WriteAccessor.Begin

type WriteController

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

func NewWriteController

func NewWriteController() *WriteController

func (*WriteController) Begin

func (m *WriteController) Begin(ctx context.Context, pulse insolar.PulseNumber) (func(), error)

func (*WriteController) CloseAndWait

func (m *WriteController) CloseAndWait(ctx context.Context, pulse insolar.PulseNumber) error

func (*WriteController) Open

type WriteManager

type WriteManager interface {
	// Open marks pulse number as opened for writing. It can be used later by Begin from accessor.
	Open(context.Context, insolar.PulseNumber) error
	// CloseAndWait immediately marks pulse number as closed for writing and blocks until all writes are done.
	CloseAndWait(context.Context, insolar.PulseNumber) error
}

type WriteManagerMock

type WriteManagerMock struct {
	CloseAndWaitMock mWriteManagerMockCloseAndWait

	OpenMock mWriteManagerMockOpen
	// contains filtered or unexported fields
}

WriteManagerMock implements WriteManager

func NewWriteManagerMock

func NewWriteManagerMock(t minimock.Tester) *WriteManagerMock

NewWriteManagerMock returns a mock for WriteManager

func (*WriteManagerMock) CloseAndWait

func (mmCloseAndWait *WriteManagerMock) CloseAndWait(ctx context.Context, p1 insolar.PulseNumber) (err error)

CloseAndWait implements WriteManager

func (*WriteManagerMock) CloseAndWaitAfterCounter

func (mmCloseAndWait *WriteManagerMock) CloseAndWaitAfterCounter() uint64

CloseAndWaitAfterCounter returns a count of finished WriteManagerMock.CloseAndWait invocations

func (*WriteManagerMock) CloseAndWaitBeforeCounter

func (mmCloseAndWait *WriteManagerMock) CloseAndWaitBeforeCounter() uint64

CloseAndWaitBeforeCounter returns a count of WriteManagerMock.CloseAndWait invocations

func (*WriteManagerMock) MinimockCloseAndWaitDone

func (m *WriteManagerMock) MinimockCloseAndWaitDone() bool

MinimockCloseAndWaitDone returns true if the count of the CloseAndWait invocations corresponds the number of defined expectations

func (*WriteManagerMock) MinimockCloseAndWaitInspect

func (m *WriteManagerMock) MinimockCloseAndWaitInspect()

MinimockCloseAndWaitInspect logs each unmet expectation

func (*WriteManagerMock) MinimockFinish

func (m *WriteManagerMock) MinimockFinish()

MinimockFinish checks that all mocked methods have been called the expected number of times

func (*WriteManagerMock) MinimockOpenDone

func (m *WriteManagerMock) MinimockOpenDone() bool

MinimockOpenDone returns true if the count of the Open invocations corresponds the number of defined expectations

func (*WriteManagerMock) MinimockOpenInspect

func (m *WriteManagerMock) MinimockOpenInspect()

MinimockOpenInspect logs each unmet expectation

func (*WriteManagerMock) MinimockWait

func (m *WriteManagerMock) MinimockWait(timeout mm_time.Duration)

MinimockWait waits for all mocked methods to be called the expected number of times

func (*WriteManagerMock) Open

func (mmOpen *WriteManagerMock) Open(ctx context.Context, p1 insolar.PulseNumber) (err error)

Open implements WriteManager

func (*WriteManagerMock) OpenAfterCounter

func (mmOpen *WriteManagerMock) OpenAfterCounter() uint64

OpenAfterCounter returns a count of finished WriteManagerMock.Open invocations

func (*WriteManagerMock) OpenBeforeCounter

func (mmOpen *WriteManagerMock) OpenBeforeCounter() uint64

OpenBeforeCounter returns a count of WriteManagerMock.Open invocations

type WriteManagerMockCloseAndWaitExpectation

type WriteManagerMockCloseAndWaitExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

WriteManagerMockCloseAndWaitExpectation specifies expectation struct of the WriteManager.CloseAndWait

func (*WriteManagerMockCloseAndWaitExpectation) Then

Then sets up WriteManager.CloseAndWait return parameters for the expectation previously defined by the When method

type WriteManagerMockCloseAndWaitParams

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

WriteManagerMockCloseAndWaitParams contains parameters of the WriteManager.CloseAndWait

type WriteManagerMockCloseAndWaitResults

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

WriteManagerMockCloseAndWaitResults contains results of the WriteManager.CloseAndWait

type WriteManagerMockOpenExpectation

type WriteManagerMockOpenExpectation struct {
	Counter uint64
	// contains filtered or unexported fields
}

WriteManagerMockOpenExpectation specifies expectation struct of the WriteManager.Open

func (*WriteManagerMockOpenExpectation) Then

Then sets up WriteManager.Open return parameters for the expectation previously defined by the When method

type WriteManagerMockOpenParams

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

WriteManagerMockOpenParams contains parameters of the WriteManager.Open

type WriteManagerMockOpenResults

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

WriteManagerMockOpenResults contains results of the WriteManager.Open

Jump to

Keyboard shortcuts

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