Fix FaultInjectionTestEnv to work with DirectIO

Summary:
Implemented PositionedAppend() and use_direct_io() for TestWritableFile.
With these changes, FaultInjectionTestEnv can be used with DirectIO enabled.
Closes https://github.com/facebook/rocksdb/pull/3586

Differential Revision: D7244305

Pulled By: yiwu-arbug

fbshipit-source-id: f6b7aece53daa0f9977bc684164a0693693e514c
This commit is contained in:
Chinmay Kamat 2018-03-14 00:48:11 -07:00 committed by Facebook Github Bot
parent 09e5d7af8c
commit e003d22526

View File

@ -68,6 +68,13 @@ class TestWritableFile : public WritableFile {
virtual Status Flush() override;
virtual Status Sync() override;
virtual bool IsSyncThreadSafe() const override { return true; }
virtual Status PositionedAppend(const Slice& data,
uint64_t offset) override {
return target_->PositionedAppend(data, offset);
}
virtual bool use_direct_io() const override {
return target_->use_direct_io();
};
private:
FileState state_;