Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hdfs-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 
16 #ifndef IMPALA_UTIL_HDFS_UTIL_H
17 #define IMPALA_UTIL_HDFS_UTIL_H
18 
19 #include <string>
20 #include <hdfs.h>
21 #include "common/status.h"
22 
23 namespace impala {
24 
28 std::string GetHdfsErrorMsg(const std::string& prefix, const std::string& file = "");
29 
31 Status GetFileSize(const hdfsFS& connection, const char* filename, int64_t* filesize);
32 
35 Status GetLastModificationTime(const hdfsFS& connection, const char* filename,
36  time_t* last_mod_time);
37 
38 bool IsHiddenFile(const std::string& filename);
39 
41 Status CopyHdfsFile(const hdfsFS& src_conn, const std::string& src_path,
42  const hdfsFS& dst_conn, const std::string& dst_path);
43 
45 bool IsDfsPath(const char* path);
46 
48 bool IsS3APath(const char* path);
49 }
50 #endif // IMPALA_UTIL_HDFS_UTIL_H
bool IsS3APath(const char *path)
Returns true iff the path refers to a location on an S3A filesystem.
Definition: hdfs-util.cc:72
string path("/usr/lib/sasl2:/usr/lib64/sasl2:/usr/local/lib/sasl2:/usr/lib/x86_64-linux-gnu/sasl2")
Status GetLastModificationTime(const hdfsFS &connection, const char *filename, time_t *last_mod_time)
Definition: hdfs-util.cc:41
Status CopyHdfsFile(const hdfsFS &src_conn, const string &src_path, const hdfsFS &dst_conn, const string &dst_path)
Definition: hdfs-util.cc:54
bool IsHiddenFile(const string &filename)
Definition: hdfs-util.cc:50
string GetHdfsErrorMsg(const string &prefix, const string &file)
Definition: hdfs-util.cc:26
bool IsDfsPath(const char *path)
Returns true iff the path refers to a location on an HDFS filesystem.
Definition: hdfs-util.cc:66
Status GetFileSize(const hdfsFS &connection, const char *filename, int64_t *filesize)
Return the size, in bytes, of a file from the hdfs connection.
Definition: hdfs-util.cc:33