Skip to content

Commit

Permalink
kvpb: add ShallowCopy method to Response
Browse files Browse the repository at this point in the history
This mirrors the ShallowCopy method on Request.

Epic: None
Release note: None
  • Loading branch information
nvanbenschoten committed Mar 28, 2024
1 parent 2db94e4 commit 078defb
Showing 1 changed file with 290 additions and 0 deletions.
290 changes: 290 additions & 0 deletions pkg/kv/kvpb/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ type Response interface {
Header() ResponseHeader
// SetHeader sets the response header.
SetHeader(ResponseHeader)
// ShallowCopy returns a shallow copy of the receiver.
ShallowCopy() Response
// Verify verifies response integrity, as applicable.
Verify(req Request) error
}
Expand Down Expand Up @@ -1299,6 +1301,294 @@ func (r *IsSpanEmptyRequest) ShallowCopy() Request {
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (gr *GetResponse) ShallowCopy() Response {
shallowCopy := *gr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (pr *PutResponse) ShallowCopy() Response {
shallowCopy := *pr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (cpr *ConditionalPutResponse) ShallowCopy() Response {
shallowCopy := *cpr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (pr *InitPutResponse) ShallowCopy() Response {
shallowCopy := *pr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (ir *IncrementResponse) ShallowCopy() Response {
shallowCopy := *ir
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (dr *DeleteResponse) ShallowCopy() Response {
shallowCopy := *dr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (drr *DeleteRangeResponse) ShallowCopy() Response {
shallowCopy := *drr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (crr *ClearRangeResponse) ShallowCopy() Response {
shallowCopy := *crr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (crr *RevertRangeResponse) ShallowCopy() Response {
shallowCopy := *crr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (sr *ScanResponse) ShallowCopy() Response {
shallowCopy := *sr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (rsr *ReverseScanResponse) ShallowCopy() Response {
shallowCopy := *rsr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (ccr *CheckConsistencyResponse) ShallowCopy() Response {
shallowCopy := *ccr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (etr *EndTxnResponse) ShallowCopy() Response {
shallowCopy := *etr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (asr *AdminSplitResponse) ShallowCopy() Response {
shallowCopy := *asr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (aur *AdminUnsplitResponse) ShallowCopy() Response {
shallowCopy := *aur
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (amr *AdminMergeResponse) ShallowCopy() Response {
shallowCopy := *amr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (atlr *AdminTransferLeaseResponse) ShallowCopy() Response {
shallowCopy := *atlr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (acrr *AdminChangeReplicasResponse) ShallowCopy() Response {
shallowCopy := *acrr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (acrr *AdminRelocateRangeResponse) ShallowCopy() Response {
shallowCopy := *acrr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (htr *HeartbeatTxnResponse) ShallowCopy() Response {
shallowCopy := *htr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (gcr *GCResponse) ShallowCopy() Response {
shallowCopy := *gcr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (ptr *PushTxnResponse) ShallowCopy() Response {
shallowCopy := *ptr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (rtr *RecoverTxnResponse) ShallowCopy() Response {
shallowCopy := *rtr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (qtr *QueryTxnResponse) ShallowCopy() Response {
shallowCopy := *qtr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (pir *QueryIntentResponse) ShallowCopy() Response {
shallowCopy := *pir
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (pir *QueryLocksResponse) ShallowCopy() Response {
shallowCopy := *pir
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (rir *ResolveIntentResponse) ShallowCopy() Response {
shallowCopy := *rir
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (rirr *ResolveIntentRangeResponse) ShallowCopy() Response {
shallowCopy := *rirr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (mr *MergeResponse) ShallowCopy() Response {
shallowCopy := *mr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (tlr *TruncateLogResponse) ShallowCopy() Response {
shallowCopy := *tlr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (rlr *RequestLeaseResponse) ShallowCopy() Response {
shallowCopy := *rlr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *ProbeResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (lt *LeaseInfoResponse) ShallowCopy() Response {
shallowCopy := *lt
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (ccr *ComputeChecksumResponse) ShallowCopy() Response {
shallowCopy := *ccr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (ekr *ExportResponse) ShallowCopy() Response {
shallowCopy := *ekr
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *AdminScatterResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *AddSSTableResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *LinkExternalSSTableResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *MigrateResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *RecomputeStatsResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *RefreshResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *RefreshRangeResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *SubsumeResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *RangeStatsResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *AdminVerifyProtectedTimestampResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *QueryResolvedTimestampResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *BarrierResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// ShallowCopy implements the Response interface.
func (r *IsSpanEmptyResponse) ShallowCopy() Response {
shallowCopy := *r
return &shallowCopy
}

// NewLockingGet returns a Request initialized to get the value at key. A lock
// corresponding to the supplied lock strength and durability is acquired on the
// key, if it exists.
Expand Down

0 comments on commit 078defb

Please sign in to comment.