Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
filesystem-util.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_UTIL_FILESYSTEM_UTIL_H
16 #define IMPALA_UTIL_FILESYSTEM_UTIL_H
17 
18 #include "common/status.h"
19 
20 namespace impala {
21 
27  public:
30  static Status CreateDirectories(const std::vector<std::string>& directories);
31 
33  static Status CreateFile(const std::string& file_path);
34 
36  static Status ResizeFile(const std::string& file_path, int64_t trunc_len);
37 
39  static Status RemovePaths(const std::vector<std::string>& directories);
40 
43  static Status VerifyIsDirectory(const std::string& directory_path);
44 
47  static Status GetSpaceAvailable(const std::string& directory_path,
48  uint64_t* available_bytes);
49 };
50 
51 }
52 
53 #endif
static Status CreateFile(const std::string &file_path)
Create a file at the specified path.
static Status VerifyIsDirectory(const std::string &directory_path)
static Status RemovePaths(const std::vector< std::string > &directories)
Remove the specified paths and their enclosing files/directories.
static Status CreateDirectories(const std::vector< std::string > &directories)
static Status ResizeFile(const std::string &file_path, int64_t trunc_len)
Resize a file to a specified length - uses unistd truncate().
static Status GetSpaceAvailable(const std::string &directory_path, uint64_t *available_bytes)