29 ss << prefix << file <<
"\n" << error_msg;
34 hdfsFileInfo* info = hdfsGetPathInfo(connection, filename);
36 *filesize = info->mSize;
37 hdfsFreeFileInfo(info, 1);
42 time_t* last_mod_time) {
43 hdfsFileInfo* info = hdfsGetPathInfo(connection, filename);
45 *last_mod_time = info->mLastMod;
46 hdfsFreeFileInfo(info, 1);
51 return !filename.empty() && (filename[0] ==
'.' || filename[0] ==
'_');
55 const hdfsFS& dst_conn,
const string& dst_path) {
56 int error = hdfsCopy(src_conn, src_path.c_str(), dst_conn, dst_path.c_str());
60 ss <<
"Failed to copy " << src_path <<
" to " << dst_path <<
": " << error_msg;
69 return strncmp(path,
"hdfs://", 7) == 0 || strstr(path,
":/") == NULL;
73 return strncmp(path,
"s3a://", 6) == 0;
bool IsS3APath(const char *path)
Returns true iff the path refers to a location on an S3A filesystem.
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)
Status CopyHdfsFile(const hdfsFS &src_conn, const string &src_path, const hdfsFS &dst_conn, const string &dst_path)
bool IsHiddenFile(const string &filename)
string GetHdfsErrorMsg(const string &prefix, const string &file)
bool IsDfsPath(const char *path)
Returns true iff the path refers to a location on an HDFS filesystem.
Status GetFileSize(const hdfsFS &connection, const char *filename, int64_t *filesize)
Return the size, in bytes, of a file from the hdfs connection.