Fix compilation with USE_HDFS (#5444)

Summary:
The changes in 8272a6de57 were untested with `USE_HDFS=1`. There were a couple compiler errors. This PR fixes them.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5444

Test Plan:
```
$ EXTRA_LDFLAGS="-L/tmp/hadoop-3.1.2/lib/native/" EXTRA_CXXFLAGS="-I/tmp/hadoop-3.1.2/include" USE_HDFS=1 make -j12 check
```

Differential Revision: D15885009

fbshipit-source-id: 2a0a63739e0b9a2819b461ad63ce1292c4833fe2
main
Andrew Kryczka 5 years ago committed by Facebook Github Bot
parent 5dc9fbd117
commit 220870523c
  1. 7
      env/env_hdfs.cc

7
env/env_hdfs.cc vendored

@ -420,7 +420,7 @@ Status HdfsEnv::NewRandomAccessFile(const std::string& fname,
// create a new file for writing // create a new file for writing
Status HdfsEnv::NewWritableFile(const std::string& fname, Status HdfsEnv::NewWritableFile(const std::string& fname,
std::unique_ptr<WritableFile>* result, std::unique_ptr<WritableFile>* result,
const EnvOptions& /*options*/) { const EnvOptions& options) {
result->reset(); result->reset();
Status s; Status s;
HdfsWritableFile* f = new HdfsWritableFile(fileSys_, fname, options); HdfsWritableFile* f = new HdfsWritableFile(fileSys_, fname, options);
@ -590,6 +590,11 @@ Status HdfsEnv::UnlockFile(FileLock* /*lock*/) { return Status::OK(); }
Status HdfsEnv::NewLogger(const std::string& fname, Status HdfsEnv::NewLogger(const std::string& fname,
std::shared_ptr<Logger>* result) { std::shared_ptr<Logger>* result) {
// EnvOptions is used exclusively for its `strict_bytes_per_sync` value. That
// option is only intended for WAL/flush/compaction writes, so turn it off in
// the logger.
EnvOptions options;
options.strict_bytes_per_sync = false;
HdfsWritableFile* f = new HdfsWritableFile(fileSys_, fname, options); HdfsWritableFile* f = new HdfsWritableFile(fileSys_, fname, options);
if (f == nullptr || !f->isValid()) { if (f == nullptr || !f->isValid()) {
delete f; delete f;

Loading…
Cancel
Save