summaryrefslogtreecommitdiff
path: root/util/testutil.h
diff options
context:
space:
mode:
authorIslam AbdelRahman <tec@fb.com>2016-10-07 13:59:16 -0700
committerIslam AbdelRahman <tec@fb.com>2016-10-07 14:05:12 -0700
commitd062328977b908f3097f44e408cf4a6a60df9ce5 (patch)
tree67449488b3aa913bc63ae39a2322eeefce909f08 /util/testutil.h
parent5cd28833a27cd3f978fe01d2268cb165cebdf483 (diff)
Revert "Support SST files with Global sequence numbers"
This reverts commit ab01da5437385e3142689077c647a3b13ba3402f.
Diffstat (limited to 'util/testutil.h')
-rw-r--r--util/testutil.h37
1 files changed, 0 insertions, 37 deletions
diff --git a/util/testutil.h b/util/testutil.h
index dd3a07451..fb1a26c62 100644
--- a/util/testutil.h
+++ b/util/testutil.h
@@ -240,43 +240,6 @@ class StringSink: public WritableFile {
size_t last_flush_;
};
-// A wrapper around a StringSink to give it a RandomRWFile interface
-class RandomRWStringSink : public RandomRWFile {
- public:
- explicit RandomRWStringSink(StringSink* ss) : ss_(ss) {}
-
- Status Write(uint64_t offset, const Slice& data) {
- if (offset + data.size() > ss_->contents_.size()) {
- ss_->contents_.resize(offset + data.size(), '\0');
- }
-
- char* pos = const_cast<char*>(ss_->contents_.data() + offset);
- memcpy(pos, data.data(), data.size());
- return Status::OK();
- }
-
- Status Read(uint64_t offset, size_t n, Slice* result, char* scratch) const {
- *result = Slice(nullptr, 0);
- if (offset < ss_->contents_.size()) {
- size_t str_res_sz =
- std::min(static_cast<size_t>(ss_->contents_.size() - offset), n);
- *result = Slice(ss_->contents_.data() + offset, str_res_sz);
- }
- return Status::OK();
- }
-
- Status Flush() { return Status::OK(); }
-
- Status Sync() { return Status::OK(); }
-
- Status Close() { return Status::OK(); }
-
- const std::string& contents() const { return ss_->contents(); }
-
- private:
- StringSink* ss_;
-};
-
// Like StringSink, this writes into a string. Unlink StringSink, it
// has some initial content and overwrites it, just like a recycled
// log file.