Status NewLogger(const std::string& fname,
std::shared_ptr<Logger>* result) override;
+ Status IsDirectory(const std::string& path, bool* is_dir) override;
+
void Schedule(void (*function)(void* arg), void* arg, Priority pri = LOW,
void* tag = nullptr,
void (*unschedFunction)(void* arg) = 0) override {
return posixEnv->TimeToString(number);
}
- static uint64_t gettid() {
- assert(sizeof(pthread_t) <= sizeof(uint64_t));
- return (uint64_t)pthread_self();
- }
+ static uint64_t gettid() { return Env::Default()->GetThreadID(); }
uint64_t GetThreadID() const override { return HdfsEnv::gettid(); }
std::string portStr = (rem == 0 ? remaining :
remaining.substr(0, rem));
- tPort port;
- port = atoi(portStr.c_str());
+ tPort port = static_cast<tPort>(atoi(portStr.c_str()));
if (port == 0) {
throw HdfsFatalException("Bad host-port for hdfs " + uri);
}
namespace ROCKSDB_NAMESPACE {
-static const Status notsup;
-
class HdfsEnv : public Env {
public:
const std::string& /*fname*/,
std::unique_ptr<RandomAccessFile>* /*result*/,
const EnvOptions& /*options*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status NewWritableFile(const std::string& /*fname*/,
std::unique_ptr<WritableFile>* /*result*/,
const EnvOptions& /*options*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status NewDirectory(const std::string& /*name*/,
std::unique_ptr<Directory>* /*result*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status FileExists(const std::string& /*fname*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status GetChildren(const std::string& /*path*/,
std::vector<std::string>* /*result*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status DeleteFile(const std::string& /*fname*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status CreateDir(const std::string& /*name*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status CreateDirIfMissing(const std::string& /*name*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status DeleteDir(const std::string& /*name*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status GetFileSize(const std::string& /*fname*/,
uint64_t* /*size*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status GetFileModificationTime(const std::string& /*fname*/,
uint64_t* /*time*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status RenameFile(const std::string& /*src*/,
const std::string& /*target*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status LinkFile(const std::string& /*src*/,
const std::string& /*target*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status LockFile(const std::string& /*fname*/,
FileLock** /*lock*/) override {
- return notsup;
+ return Status::NotSupported();
}
- virtual Status UnlockFile(FileLock* /*lock*/) override { return notsup; }
+ virtual Status UnlockFile(FileLock* /*lock*/) override {
+ return Status::NotSupported();
+ }
virtual Status NewLogger(const std::string& /*fname*/,
std::shared_ptr<Logger>* /*result*/) override {
- return notsup;
+ return Status::NotSupported();
+ }
+
+ Status IsDirectory(const std::string& /*path*/, bool* /*is_dir*/) override {
+ return Status::NotSupported();
}
virtual void Schedule(void (* /*function*/)(void* arg), void* /*arg*/,
}
virtual Status GetTestDirectory(std::string* /*path*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual uint64_t NowMicros() override { return 0; }
virtual void SleepForMicroseconds(int /*micros*/) override {}
virtual Status GetHostName(char* /*name*/, uint64_t /*len*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status GetCurrentTime(int64_t* /*unix_time*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual Status GetAbsolutePath(const std::string& /*db_path*/,
std::string* /*outputpath*/) override {
- return notsup;
+ return Status::NotSupported();
}
virtual void SetBackgroundThreads(int /*number*/,