Documentation
¶
Index ¶
- Constants
- Variables
- func NewReadCoordinator[T any](router types.Router, metrics *Metrics, ...) *coordinator[T, any]
- func NewWriteCoordinator[T, R any](client Client, router types.Router, metrics *Metrics, ...) *coordinator[T, R]
- func StatusText(code StatusCode) string
- func ValidateConfig(class *models.Class, globalCfg replication.GlobalConfig) error
- func ValidateConfigUpdate(old, updated *models.Class, nodeCounter nodeCounter) error
- type BatchReply
- type BoolTuple
- type Client
- type DeleteBatchResponse
- type DigestObjectsInRangeReq
- type DigestObjectsInRangeResp
- type Error
- type Finder
- func (f *Finder) CheckConsistency(ctx context.Context, l types.ConsistencyLevel, xs []*storobj.Object) error
- func (f *Finder) CollectShardDifferences(ctx context.Context, shardName string, ht hashtree.AggregatedHashTree, ...) (diffReader *ShardDifferenceReader, err error)
- func (f *Finder) DigestObjectsInRange(ctx context.Context, shardName string, host string, ...) (ds []types.RepairResponse, err error)
- func (f *Finder) Exists(ctx context.Context, l types.ConsistencyLevel, shard string, id strfmt.UUID) (bool, error)
- func (f *Finder) FindUUIDs(ctx context.Context, className, shard string, filters *filters.LocalFilter, ...) (uuids []strfmt.UUID, err error)
- func (f *Finder) GetOne(ctx context.Context, l types.ConsistencyLevel, shard string, id strfmt.UUID, ...) (*storobj.Object, error)
- func (f *Finder) LocalNodeName() string
- func (f *Finder) NodeObject(ctx context.Context, nodeName, shard string, id strfmt.UUID, ...) (*storobj.Object, error)
- func (f *Finder) Overwrite(ctx context.Context, host, index, shard string, xs []*objects.VObject) ([]types.RepairResponse, error)
- type FinderClient
- func (fc FinderClient) DigestObjectsInRange(ctx context.Context, host, index, shard string, ...) ([]types.RepairResponse, error)
- func (fc FinderClient) DigestReads(ctx context.Context, host, index, shard string, ids []strfmt.UUID, ...) ([]types.RepairResponse, error)
- func (fc FinderClient) FindUUIDs(ctx context.Context, host, class, shard string, filters *filters.LocalFilter, ...) ([]strfmt.UUID, error)
- func (fc FinderClient) FullRead(ctx context.Context, host, index, shard string, id strfmt.UUID, ...) (Replica, error)
- func (fc FinderClient) FullReads(ctx context.Context, host, index, shard string, ids []strfmt.UUID) ([]Replica, error)
- func (fc FinderClient) HashTreeLevel(ctx context.Context, host, index, shard string, level int, ...) (digests []hashtree.Digest, err error)
- func (fc FinderClient) Overwrite(ctx context.Context, host, index, shard string, xs []*objects.VObject) ([]types.RepairResponse, error)
- type IndexedBatch
- type Metrics
- func (m *Metrics) IncReadRepairCount()
- func (m *Metrics) IncReadRepairFailure()
- func (m *Metrics) IncReadsFailed()
- func (m *Metrics) IncReadsSucceedAll()
- func (m *Metrics) IncReadsSucceedSome()
- func (m *Metrics) IncWritesFailed()
- func (m *Metrics) IncWritesSucceedAll()
- func (m *Metrics) IncWritesSucceedSome()
- func (m *Metrics) ObserveReadDuration(d time.Duration)
- func (m *Metrics) ObserveReadRepairDuration(d time.Duration)
- func (m *Metrics) ObserveWriteDuration(d time.Duration)
- type MockRClient
- func (_m *MockRClient) DigestObjects(ctx context.Context, host string, index string, shard string, ...) ([]types.RepairResponse, error)
- func (_m *MockRClient) DigestObjectsInRange(ctx context.Context, host string, index string, shard string, ...) ([]types.RepairResponse, error)
- func (_m *MockRClient) EXPECT() *MockRClient_Expecter
- func (_m *MockRClient) FetchObject(_a0 context.Context, host string, index string, shard string, id strfmt.UUID, ...) (Replica, error)
- func (_m *MockRClient) FetchObjects(_a0 context.Context, host string, index string, shard string, ...) ([]Replica, error)
- func (_m *MockRClient) FindUUIDs(ctx context.Context, host string, index string, shard string, ...) ([]strfmt.UUID, error)
- func (_m *MockRClient) HashTreeLevel(ctx context.Context, host string, index string, shard string, level int, ...) ([]hashtree.Digest, error)
- func (_m *MockRClient) OverwriteObjects(_a0 context.Context, host string, index string, shard string, ...) ([]types.RepairResponse, error)
- type MockRClient_DigestObjectsInRange_Call
- func (_c *MockRClient_DigestObjectsInRange_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_DigestObjectsInRange_Call
- func (_c *MockRClient_DigestObjectsInRange_Call) Run(run func(ctx context.Context, host string, index string, shard string, ...)) *MockRClient_DigestObjectsInRange_Call
- func (_c *MockRClient_DigestObjectsInRange_Call) RunAndReturn(...) *MockRClient_DigestObjectsInRange_Call
- type MockRClient_DigestObjects_Call
- func (_c *MockRClient_DigestObjects_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_DigestObjects_Call
- func (_c *MockRClient_DigestObjects_Call) Run(run func(ctx context.Context, host string, index string, shard string, ...)) *MockRClient_DigestObjects_Call
- func (_c *MockRClient_DigestObjects_Call) RunAndReturn(...) *MockRClient_DigestObjects_Call
- type MockRClient_Expecter
- func (_e *MockRClient_Expecter) DigestObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_DigestObjects_Call
- func (_e *MockRClient_Expecter) DigestObjectsInRange(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_DigestObjectsInRange_Call
- func (_e *MockRClient_Expecter) FetchObject(_a0 interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_FetchObject_Call
- func (_e *MockRClient_Expecter) FetchObjects(_a0 interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_FetchObjects_Call
- func (_e *MockRClient_Expecter) FindUUIDs(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_FindUUIDs_Call
- func (_e *MockRClient_Expecter) HashTreeLevel(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_HashTreeLevel_Call
- func (_e *MockRClient_Expecter) OverwriteObjects(_a0 interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_OverwriteObjects_Call
- type MockRClient_FetchObject_Call
- type MockRClient_FetchObjects_Call
- func (_c *MockRClient_FetchObjects_Call) Return(_a0 []Replica, _a1 error) *MockRClient_FetchObjects_Call
- func (_c *MockRClient_FetchObjects_Call) Run(run func(_a0 context.Context, host string, index string, shard string, ...)) *MockRClient_FetchObjects_Call
- func (_c *MockRClient_FetchObjects_Call) RunAndReturn(...) *MockRClient_FetchObjects_Call
- type MockRClient_FindUUIDs_Call
- func (_c *MockRClient_FindUUIDs_Call) Return(_a0 []strfmt.UUID, _a1 error) *MockRClient_FindUUIDs_Call
- func (_c *MockRClient_FindUUIDs_Call) Run(run func(ctx context.Context, host string, index string, shard string, ...)) *MockRClient_FindUUIDs_Call
- func (_c *MockRClient_FindUUIDs_Call) RunAndReturn(...) *MockRClient_FindUUIDs_Call
- type MockRClient_HashTreeLevel_Call
- type MockRClient_OverwriteObjects_Call
- func (_c *MockRClient_OverwriteObjects_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_OverwriteObjects_Call
- func (_c *MockRClient_OverwriteObjects_Call) Run(run func(_a0 context.Context, host string, index string, shard string, ...)) *MockRClient_OverwriteObjects_Call
- func (_c *MockRClient_OverwriteObjects_Call) RunAndReturn(...) *MockRClient_OverwriteObjects_Call
- type MockWClient
- func (_m *MockWClient) Abort(ctx context.Context, host string, index string, shard string, requestID string) (SimpleResponse, error)
- func (_m *MockWClient) AddReferences(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- func (_m *MockWClient) Commit(ctx context.Context, host string, index string, shard string, requestID string, ...) error
- func (_m *MockWClient) DeleteObject(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- func (_m *MockWClient) DeleteObjects(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- func (_m *MockWClient) EXPECT() *MockWClient_Expecter
- func (_m *MockWClient) MergeObject(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- func (_m *MockWClient) PutObject(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- func (_m *MockWClient) PutObjects(ctx context.Context, host string, index string, shard string, requestID string, ...) (SimpleResponse, error)
- type MockWClient_Abort_Call
- type MockWClient_AddReferences_Call
- type MockWClient_Commit_Call
- type MockWClient_DeleteObject_Call
- type MockWClient_DeleteObjects_Call
- type MockWClient_Expecter
- func (_e *MockWClient_Expecter) Abort(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_Abort_Call
- func (_e *MockWClient_Expecter) AddReferences(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_AddReferences_Call
- func (_e *MockWClient_Expecter) Commit(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_Commit_Call
- func (_e *MockWClient_Expecter) DeleteObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_DeleteObject_Call
- func (_e *MockWClient_Expecter) DeleteObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_DeleteObjects_Call
- func (_e *MockWClient_Expecter) MergeObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_MergeObject_Call
- func (_e *MockWClient_Expecter) PutObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_PutObject_Call
- func (_e *MockWClient_Expecter) PutObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockWClient_PutObjects_Call
- type MockWClient_MergeObject_Call
- type MockWClient_PutObject_Call
- type MockWClient_PutObjects_Call
- type ObjResult
- type ObjTuple
- type RClient
- type Replica
- type Replicas
- type Replicator
- func (r *Replicator) AddReferences(ctx context.Context, shard string, refs []objects.BatchReference, ...) []error
- func (r *Replicator) DeleteObject(ctx context.Context, shard string, id strfmt.UUID, deletionTime time.Time, ...) error
- func (r *Replicator) DeleteObjects(ctx context.Context, shard string, uuids []strfmt.UUID, deletionTime time.Time, ...) []objects.BatchSimpleObject
- func (r *Replicator) MergeObject(ctx context.Context, shard string, doc *objects.MergeDocument, ...) error
- func (r *Replicator) PutObject(ctx context.Context, shard string, obj *storobj.Object, ...) error
- func (r *Replicator) PutObjects(ctx context.Context, shard string, objs []*storobj.Object, ...) []error
- type Result
- type ShardDesc
- type ShardDifferenceReader
- type ShardPart
- type SimpleResponse
- type StatusCode
- type UUID2Error
- type Vote
- type WClient
Constants ¶
const ( // RequestKey is used to marshalling request IDs RequestKey = "request_id" SchemaVersionKey = "schema_version" )
const ( StatusOK = 0 StatusClassNotFound = iota + 200 StatusShardNotFound StatusNotFound StatusAlreadyExisted StatusNotReady StatusConflict = iota + 300 StatusPreconditionFailed StatusReadOnly StatusObjectNotFound )
Variables ¶
var ( // MsgCLevel consistency level cannot be achieved MsgCLevel = "cannot achieve consistency level" ErrReplicas = errors.New("cannot reach enough replicas") ErrRepair = errors.New("read repair error") ErrRead = errors.New("read error") ErrNoDiffFound = errors.New("no diff found") )
var ( ErrConflictExistOrDeleted = errors.New("conflict: object has been deleted on another replica") // ErrConflictObjectChanged object changed since last time and cannot be repaired ErrConflictObjectChanged = errors.New("source object changed during repair") )
Functions ¶
func NewReadCoordinator ¶ added in v1.36.0
func NewReadCoordinator[T any](router types.Router, metrics *Metrics, className, shard, deletionStrategy string, log logrus.FieldLogger, ) *coordinator[T, any]
NewReadCoordinator used by the Finder to read objects from replicas
func NewWriteCoordinator ¶ added in v1.36.0
func NewWriteCoordinator[T, R any](client Client, router types.Router, metrics *Metrics, className, shard, requestID string, l logrus.FieldLogger, ) *coordinator[T, R]
NewWriteCoordinator used by the replicator to write objects to replicas
func StatusText ¶ added in v1.31.1
func StatusText(code StatusCode) string
StatusText returns a text for the status code. It returns the empty string if the code is unknown.
func ValidateConfig ¶
func ValidateConfig(class *models.Class, globalCfg replication.GlobalConfig) error
func ValidateConfigUpdate ¶
Types ¶
type BatchReply ¶ added in v1.31.1
type BatchReply struct {
// Sender hostname of the Sender
Sender string
// IsDigest is this reply from a digest read?
IsDigest bool
// FullData returned from a full read request
FullData []Replica
// DigestData returned from a digest read request
DigestData []types.RepairResponse
}
BatchReply is a container of the batch received from a replica The returned data may result from a full or digest read request
func (BatchReply) UpdateTimeAt ¶ added in v1.31.1
func (r BatchReply) UpdateTimeAt(idx int) int64
UpdateTimeAt gets update time from reply
type BoolTuple ¶ added in v1.31.1
type BoolTuple tuple[types.RepairResponse]
type DeleteBatchResponse ¶
type DeleteBatchResponse struct {
Batch []UUID2Error `json:"batch,omitempty"`
}
DeleteBatchResponse represents the response returned by DeleteObjects
func (*DeleteBatchResponse) FirstError ¶
func (r *DeleteBatchResponse) FirstError() error
FirstError returns the first found error
type DigestObjectsInRangeReq ¶ added in v1.28.5
type DigestObjectsInRangeResp ¶ added in v1.28.5
type DigestObjectsInRangeResp struct {
Digests []types.RepairResponse `json:"digests,omitempty"`
}
type Error ¶
type Error struct {
Code StatusCode `json:"code"`
Msg string `json:"msg,omitempty"`
Err error `json:"-"`
}
Error reports error happening during replication
func NewError ¶
func NewError(code StatusCode, msg string) *Error
NewError create new replication error
func (*Error) IsStatusCode ¶
func (e *Error) IsStatusCode(sc StatusCode) bool
type Finder ¶
type Finder struct {
// contains filtered or unexported fields
}
Finder finds replicated objects
func NewFinder ¶
func NewFinder(className string, router types.Router, nodeResolver cluster.NodeResolver, nodeName string, client RClient, metrics *Metrics, l logrus.FieldLogger, getDeletionStrategy func() string, ) *Finder
NewFinder constructs a new finder instance
func (*Finder) CheckConsistency ¶ added in v1.19.0
func (f *Finder) CheckConsistency(ctx context.Context, l types.ConsistencyLevel, xs []*storobj.Object, ) error
CheckConsistency for objects belonging to different physical shards.
For each x in xs the fields BelongsToNode and BelongsToShard must be set non empty
func (*Finder) CollectShardDifferences ¶ added in v1.26.0
func (f *Finder) CollectShardDifferences(ctx context.Context, shardName string, ht hashtree.AggregatedHashTree, diffTimeoutPerNode time.Duration, targetNodeOverrides []additional.AsyncReplicationTargetNodeOverride, ) (diffReader *ShardDifferenceReader, err error)
CollectShardDifferences collects the differences between the local node and the target nodes. It returns a ShardDifferenceReader that contains the differences and the target node name/address. If no differences are found, it returns ErrNoDiffFound. When ErrNoDiffFound is returned as the error, the returned *ShardDifferenceReader may exist and have some (but not all) of its fields set.
func (*Finder) DigestObjectsInRange ¶ added in v1.28.5
func (*Finder) Exists ¶ added in v1.18.0
func (f *Finder) Exists(ctx context.Context, l types.ConsistencyLevel, shard string, id strfmt.UUID, ) (bool, error)
Exists checks if an object exists which satisfies the giving consistency
func (*Finder) GetOne ¶ added in v1.18.0
func (f *Finder) GetOne(ctx context.Context, l types.ConsistencyLevel, shard string, id strfmt.UUID, props search.SelectProperties, adds additional.Properties, ) (*storobj.Object, error)
GetOne gets object which satisfies the giving consistency
func (*Finder) LocalNodeName ¶ added in v1.31.0
func (*Finder) NodeObject ¶
func (f *Finder) NodeObject(ctx context.Context, nodeName, shard string, id strfmt.UUID, props search.SelectProperties, adds additional.Properties, ) (*storobj.Object, error)
NodeObject gets object from a specific node. it is used mainly for debugging purposes
type FinderClient ¶ added in v1.31.1
type FinderClient struct {
// contains filtered or unexported fields
}
FinderClient extends RClient with consistency checks
func NewFinderClient ¶ added in v1.36.0
func NewFinderClient(cl RClient) FinderClient
func (FinderClient) DigestObjectsInRange ¶ added in v1.31.1
func (fc FinderClient) DigestObjectsInRange(ctx context.Context, host, index, shard string, initialUUID, finalUUID strfmt.UUID, limit int, ) ([]types.RepairResponse, error)
func (FinderClient) DigestReads ¶ added in v1.31.1
func (fc FinderClient) DigestReads(ctx context.Context, host, index, shard string, ids []strfmt.UUID, numRetries int, ) ([]types.RepairResponse, error)
DigestReads reads digests of all specified objects
func (FinderClient) FindUUIDs ¶ added in v1.31.1
func (fc FinderClient) FindUUIDs(ctx context.Context, host, class, shard string, filters *filters.LocalFilter, limit int, ) ([]strfmt.UUID, error)
func (FinderClient) FullRead ¶ added in v1.31.1
func (fc FinderClient) FullRead(ctx context.Context, host, index, shard string, id strfmt.UUID, props search.SelectProperties, additional additional.Properties, numRetries int, ) (Replica, error)
FullRead reads full object
func (FinderClient) FullReads ¶ added in v1.31.1
func (fc FinderClient) FullReads(ctx context.Context, host, index, shard string, ids []strfmt.UUID, ) ([]Replica, error)
FullReads read full objects
func (FinderClient) HashTreeLevel ¶ added in v1.31.1
type IndexedBatch ¶ added in v1.31.1
type IndexedBatch struct {
Data []*storobj.Object
// Index is z-index used to maintain object's order
Index []int
}
IndexedBatch holds an indexed list of objects
type Metrics ¶ added in v1.31.16
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶ added in v1.31.16
func NewMetrics(prom *monitoring.PrometheusMetrics) (*Metrics, error)
func (*Metrics) IncReadRepairCount ¶ added in v1.31.16
func (m *Metrics) IncReadRepairCount()
func (*Metrics) IncReadRepairFailure ¶ added in v1.31.16
func (m *Metrics) IncReadRepairFailure()
func (*Metrics) IncReadsFailed ¶ added in v1.31.16
func (m *Metrics) IncReadsFailed()
func (*Metrics) IncReadsSucceedAll ¶ added in v1.31.16
func (m *Metrics) IncReadsSucceedAll()
func (*Metrics) IncReadsSucceedSome ¶ added in v1.31.16
func (m *Metrics) IncReadsSucceedSome()
func (*Metrics) IncWritesFailed ¶ added in v1.31.16
func (m *Metrics) IncWritesFailed()
func (*Metrics) IncWritesSucceedAll ¶ added in v1.31.16
func (m *Metrics) IncWritesSucceedAll()
func (*Metrics) IncWritesSucceedSome ¶ added in v1.31.16
func (m *Metrics) IncWritesSucceedSome()
func (*Metrics) ObserveReadDuration ¶ added in v1.31.16
func (*Metrics) ObserveReadRepairDuration ¶ added in v1.31.16
func (*Metrics) ObserveWriteDuration ¶ added in v1.31.16
type MockRClient ¶ added in v1.36.0
MockRClient is an autogenerated mock type for the RClient type
func NewMockRClient ¶ added in v1.36.0
func NewMockRClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockRClient
NewMockRClient creates a new instance of MockRClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRClient) DigestObjects ¶ added in v1.36.0
func (_m *MockRClient) DigestObjects(ctx context.Context, host string, index string, shard string, ids []strfmt.UUID, numRetries int) ([]types.RepairResponse, error)
DigestObjects provides a mock function with given fields: ctx, host, index, shard, ids, numRetries
func (*MockRClient) DigestObjectsInRange ¶ added in v1.36.0
func (_m *MockRClient) DigestObjectsInRange(ctx context.Context, host string, index string, shard string, initialUUID strfmt.UUID, finalUUID strfmt.UUID, limit int) ([]types.RepairResponse, error)
DigestObjectsInRange provides a mock function with given fields: ctx, host, index, shard, initialUUID, finalUUID, limit
func (*MockRClient) EXPECT ¶ added in v1.36.0
func (_m *MockRClient) EXPECT() *MockRClient_Expecter
func (*MockRClient) FetchObject ¶ added in v1.36.0
func (_m *MockRClient) FetchObject(_a0 context.Context, host string, index string, shard string, id strfmt.UUID, props search.SelectProperties, _a6 additional.Properties, numRetries int) (Replica, error)
FetchObject provides a mock function with given fields: _a0, host, index, shard, id, props, _a6, numRetries
func (*MockRClient) FetchObjects ¶ added in v1.36.0
func (_m *MockRClient) FetchObjects(_a0 context.Context, host string, index string, shard string, ids []strfmt.UUID) ([]Replica, error)
FetchObjects provides a mock function with given fields: _a0, host, index, shard, ids
func (*MockRClient) FindUUIDs ¶ added in v1.36.0
func (_m *MockRClient) FindUUIDs(ctx context.Context, host string, index string, shard string, _a4 *filters.LocalFilter, limit int) ([]strfmt.UUID, error)
FindUUIDs provides a mock function with given fields: ctx, host, index, shard, _a4, limit
func (*MockRClient) HashTreeLevel ¶ added in v1.36.0
func (_m *MockRClient) HashTreeLevel(ctx context.Context, host string, index string, shard string, level int, discriminant *hashtree.Bitset) ([]hashtree.Digest, error)
HashTreeLevel provides a mock function with given fields: ctx, host, index, shard, level, discriminant
func (*MockRClient) OverwriteObjects ¶ added in v1.36.0
func (_m *MockRClient) OverwriteObjects(_a0 context.Context, host string, index string, shard string, _a4 []*objects.VObject) ([]types.RepairResponse, error)
OverwriteObjects provides a mock function with given fields: _a0, host, index, shard, _a4
type MockRClient_DigestObjectsInRange_Call ¶ added in v1.36.0
MockRClient_DigestObjectsInRange_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DigestObjectsInRange'
func (*MockRClient_DigestObjectsInRange_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_DigestObjectsInRange_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_DigestObjectsInRange_Call
func (*MockRClient_DigestObjectsInRange_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockRClient_DigestObjectsInRange_Call) RunAndReturn(run func(context.Context, string, string, string, strfmt.UUID, strfmt.UUID, int) ([]types.RepairResponse, error)) *MockRClient_DigestObjectsInRange_Call
type MockRClient_DigestObjects_Call ¶ added in v1.36.0
MockRClient_DigestObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DigestObjects'
func (*MockRClient_DigestObjects_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_DigestObjects_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_DigestObjects_Call
func (*MockRClient_DigestObjects_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_DigestObjects_Call) Run(run func(ctx context.Context, host string, index string, shard string, ids []strfmt.UUID, numRetries int)) *MockRClient_DigestObjects_Call
func (*MockRClient_DigestObjects_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockRClient_DigestObjects_Call) RunAndReturn(run func(context.Context, string, string, string, []strfmt.UUID, int) ([]types.RepairResponse, error)) *MockRClient_DigestObjects_Call
type MockRClient_Expecter ¶ added in v1.36.0
type MockRClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRClient_Expecter) DigestObjects ¶ added in v1.36.0
func (_e *MockRClient_Expecter) DigestObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, ids interface{}, numRetries interface{}) *MockRClient_DigestObjects_Call
DigestObjects is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- ids []strfmt.UUID
- numRetries int
func (*MockRClient_Expecter) DigestObjectsInRange ¶ added in v1.36.0
func (_e *MockRClient_Expecter) DigestObjectsInRange(ctx interface{}, host interface{}, index interface{}, shard interface{}, initialUUID interface{}, finalUUID interface{}, limit interface{}) *MockRClient_DigestObjectsInRange_Call
DigestObjectsInRange is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- initialUUID strfmt.UUID
- finalUUID strfmt.UUID
- limit int
func (*MockRClient_Expecter) FetchObject ¶ added in v1.36.0
func (_e *MockRClient_Expecter) FetchObject(_a0 interface{}, host interface{}, index interface{}, shard interface{}, id interface{}, props interface{}, _a6 interface{}, numRetries interface{}) *MockRClient_FetchObject_Call
FetchObject is a helper method to define mock.On call
- _a0 context.Context
- host string
- index string
- shard string
- id strfmt.UUID
- props search.SelectProperties
- _a6 additional.Properties
- numRetries int
func (*MockRClient_Expecter) FetchObjects ¶ added in v1.36.0
func (_e *MockRClient_Expecter) FetchObjects(_a0 interface{}, host interface{}, index interface{}, shard interface{}, ids interface{}) *MockRClient_FetchObjects_Call
FetchObjects is a helper method to define mock.On call
- _a0 context.Context
- host string
- index string
- shard string
- ids []strfmt.UUID
func (*MockRClient_Expecter) FindUUIDs ¶ added in v1.36.0
func (_e *MockRClient_Expecter) FindUUIDs(ctx interface{}, host interface{}, index interface{}, shard interface{}, _a4 interface{}, limit interface{}) *MockRClient_FindUUIDs_Call
FindUUIDs is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- _a4 *filters.LocalFilter
- limit int
func (*MockRClient_Expecter) HashTreeLevel ¶ added in v1.36.0
func (_e *MockRClient_Expecter) HashTreeLevel(ctx interface{}, host interface{}, index interface{}, shard interface{}, level interface{}, discriminant interface{}) *MockRClient_HashTreeLevel_Call
HashTreeLevel is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- level int
- discriminant *hashtree.Bitset
func (*MockRClient_Expecter) OverwriteObjects ¶ added in v1.36.0
func (_e *MockRClient_Expecter) OverwriteObjects(_a0 interface{}, host interface{}, index interface{}, shard interface{}, _a4 interface{}) *MockRClient_OverwriteObjects_Call
OverwriteObjects is a helper method to define mock.On call
- _a0 context.Context
- host string
- index string
- shard string
- _a4 []*objects.VObject
type MockRClient_FetchObject_Call ¶ added in v1.36.0
MockRClient_FetchObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchObject'
func (*MockRClient_FetchObject_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_FetchObject_Call) Return(_a0 Replica, _a1 error) *MockRClient_FetchObject_Call
func (*MockRClient_FetchObject_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_FetchObject_Call) Run(run func(_a0 context.Context, host string, index string, shard string, id strfmt.UUID, props search.SelectProperties, _a6 additional.Properties, numRetries int)) *MockRClient_FetchObject_Call
func (*MockRClient_FetchObject_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockRClient_FetchObject_Call) RunAndReturn(run func(context.Context, string, string, string, strfmt.UUID, search.SelectProperties, additional.Properties, int) (Replica, error)) *MockRClient_FetchObject_Call
type MockRClient_FetchObjects_Call ¶ added in v1.36.0
MockRClient_FetchObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FetchObjects'
func (*MockRClient_FetchObjects_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_FetchObjects_Call) Return(_a0 []Replica, _a1 error) *MockRClient_FetchObjects_Call
func (*MockRClient_FetchObjects_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_FetchObjects_Call) Run(run func(_a0 context.Context, host string, index string, shard string, ids []strfmt.UUID)) *MockRClient_FetchObjects_Call
func (*MockRClient_FetchObjects_Call) RunAndReturn ¶ added in v1.36.0
type MockRClient_FindUUIDs_Call ¶ added in v1.36.0
MockRClient_FindUUIDs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindUUIDs'
func (*MockRClient_FindUUIDs_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_FindUUIDs_Call) Return(_a0 []strfmt.UUID, _a1 error) *MockRClient_FindUUIDs_Call
func (*MockRClient_FindUUIDs_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_FindUUIDs_Call) Run(run func(ctx context.Context, host string, index string, shard string, _a4 *filters.LocalFilter, limit int)) *MockRClient_FindUUIDs_Call
func (*MockRClient_FindUUIDs_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockRClient_FindUUIDs_Call) RunAndReturn(run func(context.Context, string, string, string, *filters.LocalFilter, int) ([]strfmt.UUID, error)) *MockRClient_FindUUIDs_Call
type MockRClient_HashTreeLevel_Call ¶ added in v1.36.0
MockRClient_HashTreeLevel_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HashTreeLevel'
func (*MockRClient_HashTreeLevel_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_HashTreeLevel_Call) Return(digests []hashtree.Digest, err error) *MockRClient_HashTreeLevel_Call
func (*MockRClient_HashTreeLevel_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_HashTreeLevel_Call) Run(run func(ctx context.Context, host string, index string, shard string, level int, discriminant *hashtree.Bitset)) *MockRClient_HashTreeLevel_Call
func (*MockRClient_HashTreeLevel_Call) RunAndReturn ¶ added in v1.36.0
type MockRClient_OverwriteObjects_Call ¶ added in v1.36.0
MockRClient_OverwriteObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OverwriteObjects'
func (*MockRClient_OverwriteObjects_Call) Return ¶ added in v1.36.0
func (_c *MockRClient_OverwriteObjects_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_OverwriteObjects_Call
func (*MockRClient_OverwriteObjects_Call) Run ¶ added in v1.36.0
func (_c *MockRClient_OverwriteObjects_Call) Run(run func(_a0 context.Context, host string, index string, shard string, _a4 []*objects.VObject)) *MockRClient_OverwriteObjects_Call
func (*MockRClient_OverwriteObjects_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockRClient_OverwriteObjects_Call) RunAndReturn(run func(context.Context, string, string, string, []*objects.VObject) ([]types.RepairResponse, error)) *MockRClient_OverwriteObjects_Call
type MockWClient ¶ added in v1.36.0
MockWClient is an autogenerated mock type for the WClient type
func NewMockWClient ¶ added in v1.36.0
func NewMockWClient(t interface {
mock.TestingT
Cleanup(func())
}) *MockWClient
NewMockWClient creates a new instance of MockWClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockWClient) Abort ¶ added in v1.36.0
func (_m *MockWClient) Abort(ctx context.Context, host string, index string, shard string, requestID string) (SimpleResponse, error)
Abort provides a mock function with given fields: ctx, host, index, shard, requestID
func (*MockWClient) AddReferences ¶ added in v1.36.0
func (_m *MockWClient) AddReferences(ctx context.Context, host string, index string, shard string, requestID string, refs []objects.BatchReference, schemaVersion uint64) (SimpleResponse, error)
AddReferences provides a mock function with given fields: ctx, host, index, shard, requestID, refs, schemaVersion
func (*MockWClient) Commit ¶ added in v1.36.0
func (_m *MockWClient) Commit(ctx context.Context, host string, index string, shard string, requestID string, resp interface{}) error
Commit provides a mock function with given fields: ctx, host, index, shard, requestID, resp
func (*MockWClient) DeleteObject ¶ added in v1.36.0
func (_m *MockWClient) DeleteObject(ctx context.Context, host string, index string, shard string, requestID string, id strfmt.UUID, deletionTime time.Time, schemaVersion uint64) (SimpleResponse, error)
DeleteObject provides a mock function with given fields: ctx, host, index, shard, requestID, id, deletionTime, schemaVersion
func (*MockWClient) DeleteObjects ¶ added in v1.36.0
func (_m *MockWClient) DeleteObjects(ctx context.Context, host string, index string, shard string, requestID string, uuids []strfmt.UUID, deletionTime time.Time, dryRun bool, schemaVersion uint64) (SimpleResponse, error)
DeleteObjects provides a mock function with given fields: ctx, host, index, shard, requestID, uuids, deletionTime, dryRun, schemaVersion
func (*MockWClient) EXPECT ¶ added in v1.36.0
func (_m *MockWClient) EXPECT() *MockWClient_Expecter
func (*MockWClient) MergeObject ¶ added in v1.36.0
func (_m *MockWClient) MergeObject(ctx context.Context, host string, index string, shard string, requestID string, mergeDoc *objects.MergeDocument, schemaVersion uint64) (SimpleResponse, error)
MergeObject provides a mock function with given fields: ctx, host, index, shard, requestID, mergeDoc, schemaVersion
func (*MockWClient) PutObject ¶ added in v1.36.0
func (_m *MockWClient) PutObject(ctx context.Context, host string, index string, shard string, requestID string, obj *storobj.Object, schemaVersion uint64) (SimpleResponse, error)
PutObject provides a mock function with given fields: ctx, host, index, shard, requestID, obj, schemaVersion
func (*MockWClient) PutObjects ¶ added in v1.36.0
func (_m *MockWClient) PutObjects(ctx context.Context, host string, index string, shard string, requestID string, objs []*storobj.Object, schemaVersion uint64) (SimpleResponse, error)
PutObjects provides a mock function with given fields: ctx, host, index, shard, requestID, objs, schemaVersion
type MockWClient_Abort_Call ¶ added in v1.36.0
MockWClient_Abort_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Abort'
func (*MockWClient_Abort_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_Abort_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_Abort_Call
func (*MockWClient_Abort_Call) Run ¶ added in v1.36.0
func (_c *MockWClient_Abort_Call) Run(run func(ctx context.Context, host string, index string, shard string, requestID string)) *MockWClient_Abort_Call
func (*MockWClient_Abort_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_Abort_Call) RunAndReturn(run func(context.Context, string, string, string, string) (SimpleResponse, error)) *MockWClient_Abort_Call
type MockWClient_AddReferences_Call ¶ added in v1.36.0
MockWClient_AddReferences_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddReferences'
func (*MockWClient_AddReferences_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_AddReferences_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_AddReferences_Call
func (*MockWClient_AddReferences_Call) Run ¶ added in v1.36.0
func (_c *MockWClient_AddReferences_Call) Run(run func(ctx context.Context, host string, index string, shard string, requestID string, refs []objects.BatchReference, schemaVersion uint64)) *MockWClient_AddReferences_Call
func (*MockWClient_AddReferences_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_AddReferences_Call) RunAndReturn(run func(context.Context, string, string, string, string, []objects.BatchReference, uint64) (SimpleResponse, error)) *MockWClient_AddReferences_Call
type MockWClient_Commit_Call ¶ added in v1.36.0
MockWClient_Commit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Commit'
func (*MockWClient_Commit_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_Commit_Call) Return(_a0 error) *MockWClient_Commit_Call
func (*MockWClient_Commit_Call) Run ¶ added in v1.36.0
func (_c *MockWClient_Commit_Call) Run(run func(ctx context.Context, host string, index string, shard string, requestID string, resp interface{})) *MockWClient_Commit_Call
func (*MockWClient_Commit_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_Commit_Call) RunAndReturn(run func(context.Context, string, string, string, string, interface{}) error) *MockWClient_Commit_Call
type MockWClient_DeleteObject_Call ¶ added in v1.36.0
MockWClient_DeleteObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteObject'
func (*MockWClient_DeleteObject_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_DeleteObject_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_DeleteObject_Call
func (*MockWClient_DeleteObject_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_DeleteObject_Call) RunAndReturn(run func(context.Context, string, string, string, string, strfmt.UUID, time.Time, uint64) (SimpleResponse, error)) *MockWClient_DeleteObject_Call
type MockWClient_DeleteObjects_Call ¶ added in v1.36.0
MockWClient_DeleteObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteObjects'
func (*MockWClient_DeleteObjects_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_DeleteObjects_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_DeleteObjects_Call
func (*MockWClient_DeleteObjects_Call) RunAndReturn ¶ added in v1.36.0
type MockWClient_Expecter ¶ added in v1.36.0
type MockWClient_Expecter struct {
// contains filtered or unexported fields
}
func (*MockWClient_Expecter) Abort ¶ added in v1.36.0
func (_e *MockWClient_Expecter) Abort(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}) *MockWClient_Abort_Call
Abort is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
func (*MockWClient_Expecter) AddReferences ¶ added in v1.36.0
func (_e *MockWClient_Expecter) AddReferences(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, refs interface{}, schemaVersion interface{}) *MockWClient_AddReferences_Call
AddReferences is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- refs []objects.BatchReference
- schemaVersion uint64
func (*MockWClient_Expecter) Commit ¶ added in v1.36.0
func (_e *MockWClient_Expecter) Commit(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, resp interface{}) *MockWClient_Commit_Call
Commit is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- resp interface{}
func (*MockWClient_Expecter) DeleteObject ¶ added in v1.36.0
func (_e *MockWClient_Expecter) DeleteObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, id interface{}, deletionTime interface{}, schemaVersion interface{}) *MockWClient_DeleteObject_Call
DeleteObject is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- id strfmt.UUID
- deletionTime time.Time
- schemaVersion uint64
func (*MockWClient_Expecter) DeleteObjects ¶ added in v1.36.0
func (_e *MockWClient_Expecter) DeleteObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, uuids interface{}, deletionTime interface{}, dryRun interface{}, schemaVersion interface{}) *MockWClient_DeleteObjects_Call
DeleteObjects is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- uuids []strfmt.UUID
- deletionTime time.Time
- dryRun bool
- schemaVersion uint64
func (*MockWClient_Expecter) MergeObject ¶ added in v1.36.0
func (_e *MockWClient_Expecter) MergeObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, mergeDoc interface{}, schemaVersion interface{}) *MockWClient_MergeObject_Call
MergeObject is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- mergeDoc *objects.MergeDocument
- schemaVersion uint64
func (*MockWClient_Expecter) PutObject ¶ added in v1.36.0
func (_e *MockWClient_Expecter) PutObject(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, obj interface{}, schemaVersion interface{}) *MockWClient_PutObject_Call
PutObject is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- obj *storobj.Object
- schemaVersion uint64
func (*MockWClient_Expecter) PutObjects ¶ added in v1.36.0
func (_e *MockWClient_Expecter) PutObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}, requestID interface{}, objs interface{}, schemaVersion interface{}) *MockWClient_PutObjects_Call
PutObjects is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- requestID string
- objs []*storobj.Object
- schemaVersion uint64
type MockWClient_MergeObject_Call ¶ added in v1.36.0
MockWClient_MergeObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'MergeObject'
func (*MockWClient_MergeObject_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_MergeObject_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_MergeObject_Call
func (*MockWClient_MergeObject_Call) Run ¶ added in v1.36.0
func (_c *MockWClient_MergeObject_Call) Run(run func(ctx context.Context, host string, index string, shard string, requestID string, mergeDoc *objects.MergeDocument, schemaVersion uint64)) *MockWClient_MergeObject_Call
func (*MockWClient_MergeObject_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_MergeObject_Call) RunAndReturn(run func(context.Context, string, string, string, string, *objects.MergeDocument, uint64) (SimpleResponse, error)) *MockWClient_MergeObject_Call
type MockWClient_PutObject_Call ¶ added in v1.36.0
MockWClient_PutObject_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutObject'
func (*MockWClient_PutObject_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_PutObject_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_PutObject_Call
func (*MockWClient_PutObject_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_PutObject_Call) RunAndReturn(run func(context.Context, string, string, string, string, *storobj.Object, uint64) (SimpleResponse, error)) *MockWClient_PutObject_Call
type MockWClient_PutObjects_Call ¶ added in v1.36.0
MockWClient_PutObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PutObjects'
func (*MockWClient_PutObjects_Call) Return ¶ added in v1.36.0
func (_c *MockWClient_PutObjects_Call) Return(_a0 SimpleResponse, _a1 error) *MockWClient_PutObjects_Call
func (*MockWClient_PutObjects_Call) RunAndReturn ¶ added in v1.36.0
func (_c *MockWClient_PutObjects_Call) RunAndReturn(run func(context.Context, string, string, string, string, []*storobj.Object, uint64) (SimpleResponse, error)) *MockWClient_PutObjects_Call
type RClient ¶
type RClient interface {
// FetchObject fetches one object
FetchObject(_ context.Context, host, index, shard string,
id strfmt.UUID, props search.SelectProperties,
additional additional.Properties, numRetries int) (Replica, error)
// FetchObjects fetches objects specified in ids list.
FetchObjects(_ context.Context, host, index, shard string,
ids []strfmt.UUID) ([]Replica, error)
// OverwriteObjects conditionally updates existing objects.
OverwriteObjects(_ context.Context, host, index, shard string,
_ []*objects.VObject) ([]types.RepairResponse, error)
// DigestObjects finds a list of objects and returns a compact representation
// of a list of the objects. This is used by the replicator to optimize the
// number of bytes transferred over the network when fetching a replicated
// object
DigestObjects(ctx context.Context, host, index, shard string,
ids []strfmt.UUID, numRetries int) ([]types.RepairResponse, error)
FindUUIDs(ctx context.Context, host, index, shard string,
filters *filters.LocalFilter, limit int) ([]strfmt.UUID, error)
DigestObjectsInRange(ctx context.Context, host, index, shard string,
initialUUID, finalUUID strfmt.UUID, limit int) ([]types.RepairResponse, error)
HashTreeLevel(ctx context.Context, host, index, shard string, level int,
discriminant *hashtree.Bitset) (digests []hashtree.Digest, err error)
}
RClient is the client used to read from remote replicas
type Replica ¶ added in v1.31.1
type Replica struct {
ID strfmt.UUID `json:"id,omitempty"`
Deleted bool `json:"deleted"`
Object *storobj.Object `json:"object,omitempty"`
LastUpdateTimeUnixMilli int64 `json:"lastUpdateTimeUnixMilli"`
}
Replica represents a replicated data item
func (*Replica) MarshalBinary ¶ added in v1.31.1
func (*Replica) UnmarshalBinary ¶ added in v1.31.1
func (Replica) UpdateTime ¶ added in v1.31.1
UpdateTime return update time if it exists and 0 otherwise
type Replicas ¶ added in v1.31.1
type Replicas []Replica
func (Replicas) MarshalBinary ¶ added in v1.31.1
func (*Replicas) UnmarshalBinary ¶ added in v1.31.1
type Replicator ¶
type Replicator struct {
*Finder
// contains filtered or unexported fields
}
func NewReplicator ¶
func NewReplicator(className string, router types.Router, nodeResolver cluster.NodeResolver, nodeName string, getDeletionStrategy func() string, client Client, promMetrics *monitoring.PrometheusMetrics, l logrus.FieldLogger, ) (*Replicator, error)
func (*Replicator) AddReferences ¶
func (r *Replicator) AddReferences(ctx context.Context, shard string, refs []objects.BatchReference, l types.ConsistencyLevel, schemaVersion uint64, ) []error
func (*Replicator) DeleteObject ¶
func (*Replicator) DeleteObjects ¶
func (r *Replicator) DeleteObjects(ctx context.Context, shard string, uuids []strfmt.UUID, deletionTime time.Time, dryRun bool, l types.ConsistencyLevel, schemaVersion uint64, ) []objects.BatchSimpleObject
func (*Replicator) MergeObject ¶
func (r *Replicator) MergeObject(ctx context.Context, shard string, doc *objects.MergeDocument, l types.ConsistencyLevel, schemaVersion uint64, ) error
func (*Replicator) PutObject ¶
func (r *Replicator) PutObject(ctx context.Context, shard string, obj *storobj.Object, l types.ConsistencyLevel, schemaVersion uint64, ) error
func (*Replicator) PutObjects ¶
func (r *Replicator) PutObjects(ctx context.Context, shard string, objs []*storobj.Object, l types.ConsistencyLevel, schemaVersion uint64, ) []error
type ShardDifferenceReader ¶ added in v1.26.0
type ShardDifferenceReader struct {
TargetNodeName string
TargetNodeAddress string
RangeReader hashtree.AggregatedHashTreeRangeReader
}
type ShardPart ¶ added in v1.31.1
type ShardPart struct {
Shard string // one-to-one mapping between Shard and Node
Node string
Data []*storobj.Object
Index []int // index for data
}
ShardPart represents a data partition belonging to a physical shard
type SimpleResponse ¶
type SimpleResponse struct {
Errors []Error `json:"errors,omitempty"`
}
func (*SimpleResponse) FirstError ¶
func (r *SimpleResponse) FirstError() error
type StatusCode ¶
type StatusCode int
StatusCode is communicate the cause of failure during replication
type UUID2Error ¶
type Vote ¶ added in v1.31.1
type Vote struct {
BatchReply // reply from a replica
Count []int // number of votes per object
Err error
}
Vote represents objects received from a specific replica and the number of votes per object.
type WClient ¶ added in v1.18.0
type WClient interface {
PutObject(ctx context.Context, host, index, shard, requestID string,
obj *storobj.Object, schemaVersion uint64) (SimpleResponse, error)
DeleteObject(ctx context.Context, host, index, shard, requestID string,
id strfmt.UUID, deletionTime time.Time, schemaVersion uint64) (SimpleResponse, error)
PutObjects(ctx context.Context, host, index, shard, requestID string,
objs []*storobj.Object, schemaVersion uint64) (SimpleResponse, error)
MergeObject(ctx context.Context, host, index, shard, requestID string,
mergeDoc *objects.MergeDocument, schemaVersion uint64) (SimpleResponse, error)
DeleteObjects(ctx context.Context, host, index, shard, requestID string,
uuids []strfmt.UUID, deletionTime time.Time, dryRun bool, schemaVersion uint64) (SimpleResponse, error)
AddReferences(ctx context.Context, host, index, shard, requestID string,
refs []objects.BatchReference, schemaVersion uint64) (SimpleResponse, error)
Commit(ctx context.Context, host, index, shard, requestID string, resp interface{}) error
Abort(ctx context.Context, host, index, shard, requestID string) (SimpleResponse, error)
}
WClient is the client used to write to replicas