Skip to content

Commit

Permalink
Expose seqno for multi-batch-write (#307)
Browse files Browse the repository at this point in the history
* expose seqno for multi-batch-write

Signed-off-by: 5kbpers <[email protected]>

* format

Signed-off-by: 5kbpers <[email protected]>

Signed-off-by: 5kbpers <[email protected]>
  • Loading branch information
5kbpers authored Aug 19, 2022
1 parent f4cba2f commit 3cd757c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion db/db_impl/db_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ class DBImpl : public DB {

using DB::MultiBatchWrite;
virtual Status MultiBatchWrite(const WriteOptions& options,
std::vector<WriteBatch*>&& updates) override;
std::vector<WriteBatch*>&& updates,
uint64_t* seq) override;

using DB::Get;
virtual Status Get(const ReadOptions& options,
Expand Down
6 changes: 4 additions & 2 deletions db/db_impl/db_impl_write.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ void DBImpl::MultiBatchWriteCommit(CommitRequest* request) {
}

Status DBImpl::MultiBatchWrite(const WriteOptions& options,
std::vector<WriteBatch*>&& updates) {
std::vector<WriteBatch*>&& updates,
uint64_t* seq) {
if (immutable_db_options_.enable_multi_batch_write) {
return MultiBatchWriteImpl(options, std::move(updates), nullptr, nullptr);
return MultiBatchWriteImpl(options, std::move(updates), nullptr, nullptr, 0,
seq);
} else {
return Status::NotSupported();
}
Expand Down
8 changes: 7 additions & 1 deletion include/rocksdb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,16 @@ class DB {
}

virtual Status MultiBatchWrite(const WriteOptions& /*options*/,
std::vector<WriteBatch*>&& /*updates*/) {
std::vector<WriteBatch*>&& /*updates*/,
uint64_t* /*seq*/) {
return Status::NotSupported();
}

virtual Status MultiBatchWrite(const WriteOptions& options,
std::vector<WriteBatch*>&& updates) {
return MultiBatchWrite(options, std::move(updates), nullptr);
}

// If the database contains an entry for "key" store the
// corresponding value in *value and return OK.
//
Expand Down

0 comments on commit 3cd757c

Please sign in to comment.