Open
Description
Multiple WriteBatch APIs(e.g. Put, delete, etc.) accepting SliceParts args as below will return Status::InvalidArgument( "Cannot call this method on column family enabling timestamp")
error if I set key as user key + timestamp as described in comment. We need to use SliceParts as argument to avoid temporary buffer usage for concatenating our values. Could you please help check if new APIs are needed here for accepting timestamps with SliceParts or such restriction can be removed?
API description in write_batch.h
// Variant of Put() that gathers output like writev(2). The key and value
// that will be written to the database are concatenations of arrays of
// slices.
// The following Put(..., const SliceParts& key, ...) API can be used when
// user-defined timestamp is enabled as long as the timestamp is the last
// Slice in `key`, a SliceParts (array of Slices). The caller is responsible
// for setting up the `key` SliceParts object.
Status Put(ColumnFamilyHandle* column_family, const SliceParts& key,
const SliceParts& value) override;
API implementation in write_batch.cc
Status WriteBatch::Put(ColumnFamilyHandle* column_family, const SliceParts& key,
const SliceParts& value) {
size_t ts_sz = 0;
uint32_t cf_id = 0;
Status s;
std::tie(s, cf_id, ts_sz) =
WriteBatchInternal::GetColumnFamilyIdAndTimestampSize(this,
column_family);
if (!s.ok()) {
return s;
}
if (ts_sz == 0) {
return WriteBatchInternal::Put(this, cf_id, key, value);
}
return Status::InvalidArgument(
"Cannot call this method on column family enabling timestamp");
}
Metadata
Metadata
Assignees
Labels
No labels