updates
This commit is contained in:
parent
a5c5ab454c
commit
a8ef59a448
@ -836,11 +836,13 @@ IOStatus WritableFileWriter::WriteDirectWithChecksum(
|
||||
// limiter
|
||||
size_t data_size = left;
|
||||
if (rate_limiter_ != nullptr && rate_limiter_priority_used != Env::IO_TOTAL) {
|
||||
size_t size;
|
||||
size = rate_limiter_->RequestToken(data_size, buf_.Alignment(),
|
||||
writable_file_->GetIOPriority(), stats_,
|
||||
RateLimiter::OpType::kWrite);
|
||||
data_size -= size;
|
||||
while (data_size > 0) {
|
||||
size_t size;
|
||||
size = rate_limiter_->RequestToken(data_size, buf_.Alignment(),
|
||||
writable_file_->GetIOPriority(),
|
||||
stats_, RateLimiter::OpType::kWrite);
|
||||
data_size -= size;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
@ -108,6 +108,8 @@ class WritableFileWriterIOPriorityTest : public testing::Test {
|
||||
IODebugContext* /*dbg*/) override {
|
||||
EXPECT_EQ(options.rate_limiter_priority, io_priority_);
|
||||
}
|
||||
|
||||
bool IsSyncThreadSafe() const override { return true; }
|
||||
};
|
||||
|
||||
std::unique_ptr<WritableFileWriter> writer_;
|
||||
@ -117,7 +119,7 @@ TEST_F(WritableFileWriterIOPriorityTest, Append) {
|
||||
writer_->Append(Slice("abc"));
|
||||
}
|
||||
|
||||
// TEST_F(WritableFileWriterIOPriorityTest, Pad) { writer_->Pad(10); }
|
||||
TEST_F(WritableFileWriterIOPriorityTest, Pad) { writer_->Pad(500); }
|
||||
|
||||
TEST_F(WritableFileWriterIOPriorityTest, Flush) { writer_->Flush(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user