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 ValidateConfig(class *models.Class, globalCfg replication.GlobalConfig) error
- func ValidateConfigUpdate(old, updated *models.Class, nodeCounter nodeCounter) error
- type AsyncCheckpointNodeStatus
- type AsyncCheckpointShardStatus
- type BatchReply
- type BoolTuple
- type Client
- type CompareHashTreeRootsReq
- type CompareHashTreeRootsResp
- type DeleteBatchResponse
- type DigestObjectsInRangeReq
- type DigestObjectsInRangeResp
- type Finder
- func (f *Finder) BroadcastCreateAsyncCheckpoint(ctx context.Context, shardNames []string, cutoffMs int64, createdAt time.Time) (successes, failures int)
- func (f *Finder) BroadcastDeleteAsyncCheckpoint(ctx context.Context, shardNames []string) (successes, failures int)
- func (f *Finder) BroadcastGetAsyncCheckpointStatus(ctx context.Context, shardNames []string) (statuses map[string][]AsyncCheckpointNodeStatus, successes, failures int)
- 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) CompareDigests(ctx context.Context, shardName string, host string, ...) ([]types.RepairResponse, error)
- func (f *Finder) CountObjects(ctx context.Context, shard string, cl types.ConsistencyLevel) (int, 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)
- func (f *Finder) PrefilterShardRoots(ctx context.Context, roots map[string]hashtree.Digest) (map[string]struct{}, PrefilterStats)
- type FinderClient
- func (fc FinderClient) CompareDigests(ctx context.Context, host, index, shard string, digests []types.RepairResponse) ([]types.RepairResponse, error)
- func (fc FinderClient) CompareHashTreeRoots(ctx context.Context, host, index string, roots map[string]hashtree.Digest) ([]string, error)
- 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) CompareDigests(ctx context.Context, host string, index string, shard string, ...) ([]types.RepairResponse, error)
- func (_m *MockRClient) CompareHashTreeRoots(ctx context.Context, host string, index string, ...) ([]string, error)
- func (_m *MockRClient) CountObjects(ctx context.Context, host string, index string, shard string) (int, error)
- func (_m *MockRClient) CreateAsyncCheckpoint(ctx context.Context, host string, index string, shardNames []string, ...) error
- func (_m *MockRClient) DeleteAsyncCheckpoint(ctx context.Context, host string, index string, shardNames []string) error
- 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) GetAsyncCheckpointStatus(ctx context.Context, host string, index string, shardNames []string) (map[string]AsyncCheckpointShardStatus, 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_CompareDigests_Call
- func (_c *MockRClient_CompareDigests_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_CompareDigests_Call
- func (_c *MockRClient_CompareDigests_Call) Run(run func(ctx context.Context, host string, index string, shard string, ...)) *MockRClient_CompareDigests_Call
- func (_c *MockRClient_CompareDigests_Call) RunAndReturn(...) *MockRClient_CompareDigests_Call
- type MockRClient_CompareHashTreeRoots_Call
- func (_c *MockRClient_CompareHashTreeRoots_Call) Return(divergingShards []string, err error) *MockRClient_CompareHashTreeRoots_Call
- func (_c *MockRClient_CompareHashTreeRoots_Call) Run(run func(ctx context.Context, host string, index string, ...)) *MockRClient_CompareHashTreeRoots_Call
- func (_c *MockRClient_CompareHashTreeRoots_Call) RunAndReturn(...) *MockRClient_CompareHashTreeRoots_Call
- type MockRClient_CountObjects_Call
- func (_c *MockRClient_CountObjects_Call) Return(_a0 int, _a1 error) *MockRClient_CountObjects_Call
- func (_c *MockRClient_CountObjects_Call) Run(run func(ctx context.Context, host string, index string, shard string)) *MockRClient_CountObjects_Call
- func (_c *MockRClient_CountObjects_Call) RunAndReturn(run func(context.Context, string, string, string) (int, error)) *MockRClient_CountObjects_Call
- type MockRClient_CreateAsyncCheckpoint_Call
- func (_c *MockRClient_CreateAsyncCheckpoint_Call) Return(_a0 error) *MockRClient_CreateAsyncCheckpoint_Call
- func (_c *MockRClient_CreateAsyncCheckpoint_Call) Run(...) *MockRClient_CreateAsyncCheckpoint_Call
- func (_c *MockRClient_CreateAsyncCheckpoint_Call) RunAndReturn(run func(context.Context, string, string, []string, int64, time.Time) error) *MockRClient_CreateAsyncCheckpoint_Call
- type MockRClient_DeleteAsyncCheckpoint_Call
- func (_c *MockRClient_DeleteAsyncCheckpoint_Call) Return(_a0 error) *MockRClient_DeleteAsyncCheckpoint_Call
- func (_c *MockRClient_DeleteAsyncCheckpoint_Call) Run(run func(ctx context.Context, host string, index string, shardNames []string)) *MockRClient_DeleteAsyncCheckpoint_Call
- func (_c *MockRClient_DeleteAsyncCheckpoint_Call) RunAndReturn(run func(context.Context, string, string, []string) error) *MockRClient_DeleteAsyncCheckpoint_Call
- 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) CompareDigests(ctx interface{}, host interface{}, index interface{}, shard interface{}, ...) *MockRClient_CompareDigests_Call
- func (_e *MockRClient_Expecter) CompareHashTreeRoots(ctx interface{}, host interface{}, index interface{}, roots interface{}) *MockRClient_CompareHashTreeRoots_Call
- func (_e *MockRClient_Expecter) CountObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}) *MockRClient_CountObjects_Call
- func (_e *MockRClient_Expecter) CreateAsyncCheckpoint(ctx interface{}, host interface{}, index interface{}, shardNames interface{}, ...) *MockRClient_CreateAsyncCheckpoint_Call
- func (_e *MockRClient_Expecter) DeleteAsyncCheckpoint(ctx interface{}, host interface{}, index interface{}, shardNames interface{}) *MockRClient_DeleteAsyncCheckpoint_Call
- 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) GetAsyncCheckpointStatus(ctx interface{}, host interface{}, index interface{}, shardNames interface{}) *MockRClient_GetAsyncCheckpointStatus_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_GetAsyncCheckpointStatus_Call
- func (_c *MockRClient_GetAsyncCheckpointStatus_Call) Return(_a0 map[string]AsyncCheckpointShardStatus, _a1 error) *MockRClient_GetAsyncCheckpointStatus_Call
- func (_c *MockRClient_GetAsyncCheckpointStatus_Call) Run(run func(ctx context.Context, host string, index string, shardNames []string)) *MockRClient_GetAsyncCheckpointStatus_Call
- func (_c *MockRClient_GetAsyncCheckpointStatus_Call) RunAndReturn(...) *MockRClient_GetAsyncCheckpointStatus_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 PrefilterStats
- 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
- func (r *Replicator) WaitForDrain(ctx context.Context, shard string) error
- type Result
- type ShardDesc
- type ShardDifferenceReader
- type ShardPart
- type SimpleResponse
- type UUID2Error
- type Vote
- type WClient
Constants ¶
const ( // RequestKey is used to marshalling request IDs RequestKey = "request_id" SchemaVersionKey = "schema_version" )
const AsyncCheckpointCreatedAtSkewTolerance = 5 * time.Minute
AsyncCheckpointCreatedAtSkewTolerance prevents a single far-future createdAt from blocking every later legitimate create via the strict-greater-than tie-breaker. 5 minutes covers plausible NTP drift.
const AsyncCheckpointMaxShardsPerRequest = 10_000
const CompareDigestsFlagDeleted byte = 0x01
CompareDigestsFlagDeleted is the flags-byte bit (byte 24) that mirrors RepairResponse.Deleted on the REST wire. Reserved for a future target-side deletion signal: the current target comparator never sets it (it reports tombstones as missing), so the bit is always zero today — but the REST encoder/decoder round-trips it so the protocol is ready.
const CompareDigestsMaxBodyBytes = 4 * 1024 * 1024
CompareDigestsMaxBodyBytes caps the size of a CompareDigests REST request body. The cap leaves enough headroom for the largest realistic diffBatchSize × CompareDigestsRecordLength; tests guard the headroom.
const CompareDigestsRecordLength = 25
CompareDigestsRecordLength is the byte size of one binary record on the compareDigests endpoint: same as above plus a trailing flags byte (see CompareDigestsFlagDeleted).
const CompareHashTreeRootsMaxShardsPerRequest = 10_000
CompareHashTreeRootsMaxShardsPerRequest bounds the shard map a receiver accepts, above the sender's prefilterMaxShardsPerRPC.
const DigestObjectsInRangeRecordLength = 24
DigestObjectsInRangeRecordLength is the byte size of one binary record on the digestsInRange endpoint: 16-byte UUID (RFC-4122 binary) + 8-byte UpdateTime (int64 big-endian). RepairResponse.Err/Deleted are not on the wire.
const MaxConcurrentFullReadRequests = 16
MaxConcurrentFullReadRequests bounds how many chunked FetchObjects requests are in flight at once against the single winning host, capping peak response memory at MaxConcurrentFullReadRequests * MaxFullReadIDsPerRequest whole objects per FullReads call. The repairer runs one FullReads per winning replica concurrently, so the ceiling per repaired batch is that product times the number of winning replicas (at most the replication factor).
const MaxFullReadIDsPerRequest = 256
MaxFullReadIDsPerRequest bounds ids per FetchObjects request. The REST transport base64-encodes them into the URL query string at ~53 bytes per id, so 256 ids is ~14 KB: well inside the receiving server's 1 MiB header cap (MaxHeaderBytes is unset) and the 60 KiB a service-mesh sidecar (Envoy default) allows on node-to-node traffic. An unbounded list would overflow those caps with a 414 that is not retried. The chunk also caps how many whole objects one response holds in memory.
Variables ¶
var ( // ErrAsyncCheckpointStale maps to HTTP 409 / AlreadyExists. ErrAsyncCheckpointStale = errors.New("checkpoint createdAt is not newer than the active one") // ErrAsyncReplicationNotActive maps to HTTP 412 / FailedPrecondition. ErrAsyncReplicationNotActive = errors.New("async replication is not active on this shard") // ErrAsyncCheckpointCutoffInPast maps to HTTP 412 / FailedPrecondition. ErrAsyncCheckpointCutoffInPast = errors.New("checkpoint cutoff is not in this node's future") // 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") // ErrCompareHashTreeRootsUnsupported: target node too old to serve the RPC // (gRPC Unimplemented or REST 404). Callers fall back to per-shard descent. ErrCompareHashTreeRootsUnsupported = errors.New("CompareHashTreeRoots not supported by target node") )
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 ValidateConfig ¶
func ValidateConfig(class *models.Class, globalCfg replication.GlobalConfig) error
func ValidateConfigUpdate ¶
Types ¶
type AsyncCheckpointNodeStatus ¶ added in v1.38.0
type AsyncCheckpointNodeStatus struct {
Node string
CutoffMs int64
CreatedAt time.Time
Root hashtree.Digest
}
AsyncCheckpointNodeStatus is the checkpoint state of one replica for one shard. CutoffMs == 0 + zero Root means no active checkpoint on that replica.
type AsyncCheckpointShardStatus ¶ added in v1.38.0
type BatchReply ¶ added in v1.31.1
type BatchReply struct {
// Sender hostname of the Sender
Sender string
// IsLocal marks the reply for the copy the caller already holds (exactly one per batch).
IsLocal bool
// DigestData holds one digest per requested object, in request order
DigestData []types.RepairResponse
}
BatchReply carries only digests, never object content: repair always fetches content fresh from the winning replica, so a projected search result can never become a repair payload.
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 CompareHashTreeRootsReq ¶ added in v1.37.12
CompareHashTreeRootsReq / Resp are the REST payloads for the batched root pre-filter; roots use raw [high,low] pairs since Digest's pointer-receiver JSON breaks for map values.
type CompareHashTreeRootsResp ¶ added in v1.37.12
type CompareHashTreeRootsResp struct {
DivergingShards []string `json:"divergingShards,omitempty"`
}
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 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) BroadcastCreateAsyncCheckpoint ¶ added in v1.38.0
func (f *Finder) BroadcastCreateAsyncCheckpoint(ctx context.Context, shardNames []string, cutoffMs int64, createdAt time.Time) (successes, failures int)
BroadcastCreateAsyncCheckpoint is best-effort: failures are counted and logged but never abort the fan-out — convergence retries on the next create cycle.
func (*Finder) BroadcastDeleteAsyncCheckpoint ¶ added in v1.38.0
func (*Finder) BroadcastGetAsyncCheckpointStatus ¶ added in v1.38.0
func (f *Finder) BroadcastGetAsyncCheckpointStatus(ctx context.Context, shardNames []string) (statuses map[string][]AsyncCheckpointNodeStatus, successes, failures int)
BroadcastGetAsyncCheckpointStatus omits unreachable nodes from the aggregate; status is routinely retried.
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) CompareDigests ¶ added in v1.37.4
func (f *Finder) CompareDigests(ctx context.Context, shardName string, host string, digests []types.RepairResponse, ) ([]types.RepairResponse, error)
CompareDigests is a thin transport wrapper around the remote shard's comparator; see RClient.CompareDigests for the contract.
func (*Finder) CountObjects ¶ added in v1.37.0
func (f *Finder) CountObjects(ctx context.Context, shard string, cl types.ConsistencyLevel) (int, error)
CountObjects returns an aggregated object count from all replicas the shard exists on.
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 given 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 given 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
func (*Finder) Overwrite ¶ added in v1.26.0
func (f *Finder) Overwrite(ctx context.Context, host, index, shard string, xs []*objects.VObject, ) ([]types.RepairResponse, error)
Overwrite specified object with most recent contents
func (*Finder) PrefilterShardRoots ¶ added in v1.37.12
func (f *Finder) PrefilterShardRoots(ctx context.Context, roots map[string]hashtree.Digest, ) (map[string]struct{}, PrefilterStats)
PrefilterShardRoots batches the level-0 root compare against replicas, returning the subset needing a full descent (absent ⇒ in-sync). Chunked serially per host.
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, log logrus.FieldLogger) FinderClient
func (FinderClient) CompareDigests ¶ added in v1.37.4
func (fc FinderClient) CompareDigests(ctx context.Context, host, index, shard string, digests []types.RepairResponse, ) ([]types.RepairResponse, error)
func (FinderClient) CompareHashTreeRoots ¶ added in v1.37.12
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 reads the current version of each id from host, one entry per requested id in request order. Ids are fetched in bounded chunks, chunks concurrently; any failed chunk fails the whole read. A response that does not line up with its request is rejected rather than returned: callers index the result positionally, so a mispair would repair the wrong object.
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) CompareDigests ¶ added in v1.37.4
func (_m *MockRClient) CompareDigests(ctx context.Context, host string, index string, shard string, digests []types.RepairResponse) ([]types.RepairResponse, error)
CompareDigests provides a mock function with given fields: ctx, host, index, shard, digests
func (*MockRClient) CompareHashTreeRoots ¶ added in v1.37.12
func (_m *MockRClient) CompareHashTreeRoots(ctx context.Context, host string, index string, roots map[string]hashtree.Digest) ([]string, error)
CompareHashTreeRoots provides a mock function with given fields: ctx, host, index, roots
func (*MockRClient) CountObjects ¶ added in v1.37.0
func (_m *MockRClient) CountObjects(ctx context.Context, host string, index string, shard string) (int, error)
CountObjects provides a mock function with given fields: ctx, host, index, shard
func (*MockRClient) CreateAsyncCheckpoint ¶ added in v1.38.0
func (_m *MockRClient) CreateAsyncCheckpoint(ctx context.Context, host string, index string, shardNames []string, cutoffMs int64, createdAt time.Time) error
CreateAsyncCheckpoint provides a mock function with given fields: ctx, host, index, shardNames, cutoffMs, createdAt
func (*MockRClient) DeleteAsyncCheckpoint ¶ added in v1.38.0
func (_m *MockRClient) DeleteAsyncCheckpoint(ctx context.Context, host string, index string, shardNames []string) error
DeleteAsyncCheckpoint provides a mock function with given fields: ctx, host, index, shardNames
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) GetAsyncCheckpointStatus ¶ added in v1.38.0
func (_m *MockRClient) GetAsyncCheckpointStatus(ctx context.Context, host string, index string, shardNames []string) (map[string]AsyncCheckpointShardStatus, error)
GetAsyncCheckpointStatus provides a mock function with given fields: ctx, host, index, shardNames
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_CompareDigests_Call ¶ added in v1.37.4
MockRClient_CompareDigests_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompareDigests'
func (*MockRClient_CompareDigests_Call) Return ¶ added in v1.37.4
func (_c *MockRClient_CompareDigests_Call) Return(_a0 []types.RepairResponse, _a1 error) *MockRClient_CompareDigests_Call
func (*MockRClient_CompareDigests_Call) Run ¶ added in v1.37.4
func (_c *MockRClient_CompareDigests_Call) Run(run func(ctx context.Context, host string, index string, shard string, digests []types.RepairResponse)) *MockRClient_CompareDigests_Call
func (*MockRClient_CompareDigests_Call) RunAndReturn ¶ added in v1.37.4
func (_c *MockRClient_CompareDigests_Call) RunAndReturn(run func(context.Context, string, string, string, []types.RepairResponse) ([]types.RepairResponse, error)) *MockRClient_CompareDigests_Call
type MockRClient_CompareHashTreeRoots_Call ¶ added in v1.37.12
MockRClient_CompareHashTreeRoots_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CompareHashTreeRoots'
func (*MockRClient_CompareHashTreeRoots_Call) Return ¶ added in v1.37.12
func (_c *MockRClient_CompareHashTreeRoots_Call) Return(divergingShards []string, err error) *MockRClient_CompareHashTreeRoots_Call
func (*MockRClient_CompareHashTreeRoots_Call) Run ¶ added in v1.37.12
func (_c *MockRClient_CompareHashTreeRoots_Call) Run(run func(ctx context.Context, host string, index string, roots map[string]hashtree.Digest)) *MockRClient_CompareHashTreeRoots_Call
func (*MockRClient_CompareHashTreeRoots_Call) RunAndReturn ¶ added in v1.37.12
type MockRClient_CountObjects_Call ¶ added in v1.37.0
MockRClient_CountObjects_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CountObjects'
func (*MockRClient_CountObjects_Call) Return ¶ added in v1.37.0
func (_c *MockRClient_CountObjects_Call) Return(_a0 int, _a1 error) *MockRClient_CountObjects_Call
func (*MockRClient_CountObjects_Call) Run ¶ added in v1.37.0
func (_c *MockRClient_CountObjects_Call) Run(run func(ctx context.Context, host string, index string, shard string)) *MockRClient_CountObjects_Call
func (*MockRClient_CountObjects_Call) RunAndReturn ¶ added in v1.37.0
func (_c *MockRClient_CountObjects_Call) RunAndReturn(run func(context.Context, string, string, string) (int, error)) *MockRClient_CountObjects_Call
type MockRClient_CreateAsyncCheckpoint_Call ¶ added in v1.38.0
MockRClient_CreateAsyncCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateAsyncCheckpoint'
func (*MockRClient_CreateAsyncCheckpoint_Call) Return ¶ added in v1.38.0
func (_c *MockRClient_CreateAsyncCheckpoint_Call) Return(_a0 error) *MockRClient_CreateAsyncCheckpoint_Call
func (*MockRClient_CreateAsyncCheckpoint_Call) Run ¶ added in v1.38.0
func (_c *MockRClient_CreateAsyncCheckpoint_Call) Run(run func(ctx context.Context, host string, index string, shardNames []string, cutoffMs int64, createdAt time.Time)) *MockRClient_CreateAsyncCheckpoint_Call
func (*MockRClient_CreateAsyncCheckpoint_Call) RunAndReturn ¶ added in v1.38.0
type MockRClient_DeleteAsyncCheckpoint_Call ¶ added in v1.38.0
MockRClient_DeleteAsyncCheckpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteAsyncCheckpoint'
func (*MockRClient_DeleteAsyncCheckpoint_Call) Return ¶ added in v1.38.0
func (_c *MockRClient_DeleteAsyncCheckpoint_Call) Return(_a0 error) *MockRClient_DeleteAsyncCheckpoint_Call
func (*MockRClient_DeleteAsyncCheckpoint_Call) Run ¶ added in v1.38.0
func (_c *MockRClient_DeleteAsyncCheckpoint_Call) Run(run func(ctx context.Context, host string, index string, shardNames []string)) *MockRClient_DeleteAsyncCheckpoint_Call
func (*MockRClient_DeleteAsyncCheckpoint_Call) RunAndReturn ¶ added in v1.38.0
func (_c *MockRClient_DeleteAsyncCheckpoint_Call) RunAndReturn(run func(context.Context, string, string, []string) error) *MockRClient_DeleteAsyncCheckpoint_Call
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) CompareDigests ¶ added in v1.37.4
func (_e *MockRClient_Expecter) CompareDigests(ctx interface{}, host interface{}, index interface{}, shard interface{}, digests interface{}) *MockRClient_CompareDigests_Call
CompareDigests is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
- digests []types.RepairResponse
func (*MockRClient_Expecter) CompareHashTreeRoots ¶ added in v1.37.12
func (_e *MockRClient_Expecter) CompareHashTreeRoots(ctx interface{}, host interface{}, index interface{}, roots interface{}) *MockRClient_CompareHashTreeRoots_Call
CompareHashTreeRoots is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- roots map[string]hashtree.Digest
func (*MockRClient_Expecter) CountObjects ¶ added in v1.37.0
func (_e *MockRClient_Expecter) CountObjects(ctx interface{}, host interface{}, index interface{}, shard interface{}) *MockRClient_CountObjects_Call
CountObjects is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shard string
func (*MockRClient_Expecter) CreateAsyncCheckpoint ¶ added in v1.38.0
func (_e *MockRClient_Expecter) CreateAsyncCheckpoint(ctx interface{}, host interface{}, index interface{}, shardNames interface{}, cutoffMs interface{}, createdAt interface{}) *MockRClient_CreateAsyncCheckpoint_Call
CreateAsyncCheckpoint is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shardNames []string
- cutoffMs int64
- createdAt time.Time
func (*MockRClient_Expecter) DeleteAsyncCheckpoint ¶ added in v1.38.0
func (_e *MockRClient_Expecter) DeleteAsyncCheckpoint(ctx interface{}, host interface{}, index interface{}, shardNames interface{}) *MockRClient_DeleteAsyncCheckpoint_Call
DeleteAsyncCheckpoint is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shardNames []string
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) GetAsyncCheckpointStatus ¶ added in v1.38.0
func (_e *MockRClient_Expecter) GetAsyncCheckpointStatus(ctx interface{}, host interface{}, index interface{}, shardNames interface{}) *MockRClient_GetAsyncCheckpointStatus_Call
GetAsyncCheckpointStatus is a helper method to define mock.On call
- ctx context.Context
- host string
- index string
- shardNames []string
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_GetAsyncCheckpointStatus_Call ¶ added in v1.38.0
MockRClient_GetAsyncCheckpointStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAsyncCheckpointStatus'
func (*MockRClient_GetAsyncCheckpointStatus_Call) Return ¶ added in v1.38.0
func (_c *MockRClient_GetAsyncCheckpointStatus_Call) Return(_a0 map[string]AsyncCheckpointShardStatus, _a1 error) *MockRClient_GetAsyncCheckpointStatus_Call
func (*MockRClient_GetAsyncCheckpointStatus_Call) Run ¶ added in v1.38.0
func (_c *MockRClient_GetAsyncCheckpointStatus_Call) Run(run func(ctx context.Context, host string, index string, shardNames []string)) *MockRClient_GetAsyncCheckpointStatus_Call
func (*MockRClient_GetAsyncCheckpointStatus_Call) RunAndReturn ¶ added in v1.38.0
func (_c *MockRClient_GetAsyncCheckpointStatus_Call) RunAndReturn(run func(context.Context, string, string, []string) (map[string]AsyncCheckpointShardStatus, error)) *MockRClient_GetAsyncCheckpointStatus_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 PrefilterStats ¶ added in v1.37.12
PrefilterStats reports the per-host root-compare RPC outcomes for observability.
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)
// CompareDigests sends the source's local digests to the target and returns
// only the subset needing source-side action: objects missing on the target
// (UpdateTime==0 — also how target-side tombstones surface; the source then
// proposes an Overwrite and settles any deletion conflict per DeletionStrategy)
// and objects the source holds a strictly newer version of. Equal-timestamp
// objects are never returned (identical hashtree digests, hence already
// invisible to the hashtree diff that drives this call).
CompareDigests(ctx context.Context, host, index, shard string,
digests []types.RepairResponse) ([]types.RepairResponse, error)
HashTreeLevel(ctx context.Context, host, index, shard string, level int,
discriminant *hashtree.Bitset) (digests []hashtree.Digest, err error)
// CompareHashTreeRoots batches the level-0 root compare of many shards, returning
// the diverging subset. Returns ErrCompareHashTreeRootsUnsupported on too-old targets.
CompareHashTreeRoots(ctx context.Context, host, index string,
roots map[string]hashtree.Digest) (divergingShards []string, err error)
CountObjects(ctx context.Context, host, index, shard string) (int, error)
// Async-checkpoint RPCs: createdAt is the initiator's value, propagated unchanged.
GetAsyncCheckpointStatus(ctx context.Context, host, index string, shardNames []string) (map[string]AsyncCheckpointShardStatus, error)
CreateAsyncCheckpoint(ctx context.Context, host, index string, shardNames []string, cutoffMs int64, createdAt time.Time) error
DeleteAsyncCheckpoint(ctx context.Context, host, index string, shardNames []string) 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
func (*Replicator) WaitForDrain ¶ added in v1.38.0
func (r *Replicator) WaitForDrain(ctx context.Context, shard string) 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
func (*ShardPart) Digests ¶ added in v1.37.14
func (b *ShardPart) Digests() ([]types.RepairResponse, []strfmt.UUID)
Digests returns update times and ids for the caller's own copies, in Index order. These are search results that may lack projected-away properties or a requested vector, so they can never serve as repair content.
type SimpleResponse ¶
type SimpleResponse struct {
Errors []replicaerrors.Error `json:"errors,omitempty"`
}
func (*SimpleResponse) FirstError ¶
func (r *SimpleResponse) FirstError() error
type UUID2Error ¶
type UUID2Error struct {
UUID string `json:"uuid,omitempty"`
Error replicaerrors.Error `json:"error,omitempty"`
}
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