15 #ifndef IMPALA_UTIL_HDFS_BULK_OPS_H
16 #define IMPALA_UTIL_HDFS_BULK_OPS_H
19 #include <boost/thread.hpp>
36 class HdfsOperationSet;
54 const std::string&
src()
const {
return src_; }
55 const std::string&
dst()
const {
return dst_; }
82 uint32_t max_queue_length);
99 void Add(
HdfsOpType op,
const std::string& src,
const std::string& dst);
102 void Add(
HdfsOpType op,
const std::string& src,
short permissions);
109 typedef std::pair<const HdfsOp*, std::string>
Error;
158 #endif // IMPALA_UTIL_HDFS_BULK_OPS_H
const std::string & dst() const
ThreadPool< HdfsOp > HdfsOpThreadPool
std::string src_
First operand.
bool abort_on_error_
True if a single error should cause any subsequent operations to become no-ops.
std::string dst_
Second string operand, ignored except for RENAME.
std::vector< HdfsOp > ops_
The set of operations to be submitted to HDFS.
const std::string & src() const
HdfsOp()
Required for ThreadPool.
void Add(HdfsOpType op, const std::string &src)
boost::mutex errors_lock_
Protects errors_ and abort_on_error_ during Execute.
void AddError(const std::string &err, const HdfsOp *op)
Called by HdfsOp to record an error.
Errors errors_
All errors produced during Execute.
HdfsOpType op_
The kind of operation to execute.
AtomicInt< int64_t > num_ops_
hdfsFS * hdfs_connection_
HDFS connection shared between all operations. Not owned by this class.
HdfsOperationSet(hdfsFS *hdfs_connection)
bool Execute(HdfsOpThreadPool *pool, bool abort_on_error)
short permissions_
Permission operand, ignored except for CHMOD.
std::vector< Error > Errors
hdfsFS * hdfs_connection() const
HdfsOpThreadPool * CreateHdfsOpThreadPool(const std::string &name, uint32_t num_threads, uint32_t max_queue_length)
Creates a new HdfsOp-processing thread pool.
std::pair< const HdfsOp *, std::string > Error
HdfsOperationSet * op_set_
Containing operation set, used to record errors and to signal completion.