Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvclient, roachpb: cleanup the CPut API
The CPut API was funky: it took an expected value as a roachpb.Value, but the checksum in it and the timestamp didn't matter. This was undocumented. The checksum in particular covers both the key and the value, so its relationship with a CPut is weird (since the key for which we're using the value might be different from the key from whence it came). This choice of Value had consequences for the Batch API: Batch.CPut() was taking a *roachpb.Value, for which it cleared and then re-initialized the checksum. This was all surprising, and meant that some callers had to copy the underlying bytes for the value before passing them to CPut(). This patch changes all the interfaces to just take []byte. There's no longer a checksum or a timestamp to speak of. CPut() now also internally copies the expected value's bytes, so the caller no longer needs to worry about ownership. Release note: None
- Loading branch information