| 68 | } |
| 69 | |
| 70 | bool Init() { |
| 71 | if (file_ == NULL) { |
| 72 | if (fs_ == NULL) { |
| 73 | fs_ = GetHDFSFileSystem(filename_); |
| 74 | } |
| 75 | if (fs_ != NULL && (flags_ == O_WRONLY || 0 == hdfsExists(fs_, filename_.c_str()))) { |
| 76 | file_ = hdfsOpenFile(fs_, filename_.c_str(), flags_, 0, 0, 0); |
| 77 | } |
| 78 | } |
| 79 | return file_ != NULL; |
| 80 | } |
| 81 | |
| 82 | bool Exists() const { |
| 83 | if (fs_ == NULL) { |