(ctx context.Context, shard string, obj *storobj.Object, l types.ConsistencyLevel, schemaVersion uint64, )
| 96 | } |
| 97 | |
| 98 | func (r *Replicator) PutObject(ctx context.Context, |
| 99 | shard string, |
| 100 | obj *storobj.Object, |
| 101 | l types.ConsistencyLevel, |
| 102 | schemaVersion uint64, |
| 103 | ) error { |
| 104 | coord := NewWriteCoordinator[SimpleResponse, error](r.client, r.router, r.metrics, r.class, shard, r.requestID(opPutObject), r.log) |
| 105 | release := r.inflight.register(shard) |
| 106 | defer release() |
| 107 | isReady := func(ctx context.Context, host, requestID string) error { |
| 108 | resp, err := r.client.PutObject(ctx, host, r.class, shard, requestID, obj, schemaVersion) |
| 109 | if err == nil { |
| 110 | err = resp.FirstError() |
| 111 | } |
| 112 | if err != nil { |
| 113 | return fmt.Errorf("%q: %w", host, err) |
| 114 | } |
| 115 | return nil |
| 116 | } |
| 117 | rs, err := coord.Push(ctx, l, isReady, r.simpleCommit(shard), r.readSimpleResponse, r.flattenErrors, 1) |
| 118 | if err != nil { |
| 119 | r.log.WithField("op", "push.one").WithField("class", r.class). |
| 120 | WithField("shard", shard).Error(err) |
| 121 | return fmt.Errorf("%s %q: %w", replicaerrors.MsgCLevel, l, replicaerrors.NewNotEnoughReplicasError(err)) |
| 122 | } |
| 123 | if err := firstError(rs); err != nil { |
| 124 | r.log.WithField("op", "put").WithField("class", r.class). |
| 125 | WithField("shard", shard).WithField("uuid", obj.ID()).Error(err) |
| 126 | return err |
| 127 | } |
| 128 | return nil |
| 129 | } |
| 130 | |
| 131 | func (r *Replicator) MergeObject(ctx context.Context, |
| 132 | shard string, |
nothing calls this directly
no test coverage detected