From 1d2e4ef747d4e1828b125814b8e5898e04bfe575 Mon Sep 17 00:00:00 2001 From: Reid Horuff Date: Thu, 28 Apr 2016 18:23:29 -0700 Subject: [PATCH] ldb support new WAL records --- tools/ldb_cmd.cc | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/tools/ldb_cmd.cc b/tools/ldb_cmd.cc index 08a99c9f0..9134c0ba1 100644 --- a/tools/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -1505,19 +1505,53 @@ class InMemoryHandler : public WriteBatch::Handler { } } - virtual void Put(const Slice& key, const Slice& value) override { - row_ << "PUT : "; + virtual Status PutCF(uint32_t cf, const Slice& key, + const Slice& value) override { + row_ << "PUT(" << cf << ") : "; commonPutMerge(key, value); + return Status::OK(); } - virtual void Merge(const Slice& key, const Slice& value) override { - row_ << "MERGE : "; + virtual Status MergeCF(uint32_t cf, const Slice& key, + const Slice& value) override { + row_ << "MERGE(" << cf << ") : "; commonPutMerge(key, value); + return Status::OK(); } - virtual void Delete(const Slice& key) override { - row_ <<",DELETE : "; + virtual Status DeleteCF(uint32_t cf, const Slice& key) override { + row_ << "DELETE(" << cf << ") : "; row_ << LDBCommand::StringToHex(key.ToString()) << " "; + return Status::OK(); + } + + virtual Status SingleDeleteCF(uint32_t cf, const Slice& key) override { + row_ << "SINGLE_DELETE(" << cf << ") : "; + row_ << LDBCommand::StringToHex(key.ToString()) << " "; + return Status::OK(); + } + + virtual Status MarkBeginPrepare() { + row_ << "BEGIN_PREARE "; + return Status::OK(); + } + + virtual Status MarkEndPrepare(const Slice& xid) { + row_ << "END_PREPARE("; + row_ << LDBCommand::StringToHex(xid.ToString()) << ") "; + return Status::OK(); + } + + virtual Status MarkRollback(const Slice& xid) { + row_ << "ROLLBACK("; + row_ << LDBCommand::StringToHex(xid.ToString()) << ") "; + return Status::OK(); + } + + virtual Status MarkCommit(const Slice& xid) { + row_ << "COMMIT("; + row_ << LDBCommand::StringToHex(xid.ToString()) << ") "; + return Status::OK(); } virtual ~InMemoryHandler() {}