MCPcopy
hub / github.com/weaviate/weaviate / simpleCommit

Method simpleCommit

usecases/replica/replicator.go:331–343  ·  view source on GitHub ↗

simpleCommit generate commit function for the coordinator

(shard string)

Source from the content-addressed store, hash-verified

329
330// simpleCommit generate commit function for the coordinator
331func (r *Replicator) simpleCommit(shard string) commitOp[SimpleResponse] {
332 return func(ctx context.Context, host, requestID string) (SimpleResponse, error) {
333 resp := SimpleResponse{}
334 err := r.client.Commit(ctx, host, r.class, shard, requestID, &resp)
335 if err == nil {
336 err = resp.FirstError()
337 }
338 if err != nil {
339 err = fmt.Errorf("%s: %w", host, err)
340 }
341 return resp, err
342 }
343}
344
345func (r *Replicator) readSimpleResponse(x Result[SimpleResponse], successes []SimpleResponse, failures []SimpleResponse) ([]SimpleResponse, []SimpleResponse, bool, error) {
346 var err error

Callers 5

PutObjectMethod · 0.95
MergeObjectMethod · 0.95
DeleteObjectMethod · 0.95
PutObjectsMethod · 0.95
AddReferencesMethod · 0.95

Calls 3

FirstErrorMethod · 0.95
ErrorfMethod · 0.80
CommitMethod · 0.65

Tested by

no test coverage detected