| 311 | } |
| 312 | |
| 313 | Status Flush() { |
| 314 | std::unique_lock<percpu_rwlock> lock(lock_); |
| 315 | // If the file is already closed, nothing to do. |
| 316 | if (!file_) return Status::OK(); |
| 317 | kudu::Status status = file_->Sync(); |
| 318 | if (UNLIKELY(!status.ok())) { |
| 319 | return Status(status.message().ToString()); |
| 320 | } |
| 321 | return Status::OK(); |
| 322 | } |
| 323 | |
| 324 | void SetReadOnly() { |
| 325 | // Setting this without holding a lock tells other threads not to start new |