 |
ewmscp
..
|
#include <outputHandlerDaosFs.h>
|
| writerDaosFs (const std::string &aPath, bool mightAppend, size_t sourceSize, size_t readBlockSize, copyRequest::stateType &state, bool noWrite, std::unique_ptr< ioHandle::attrDataType > aAttrData, std::unique_ptr< acl::list > aAclData, daosFs &aHandler) |
|
| writerDaosFs (std::string &aPath, bool noWrite, std::unique_ptr< ioHandle::attrDataType > aAttrData, std::unique_ptr< acl::list > aAclData, daosFs &aHandler) |
|
void | closeAndRemoveBadCopy () override |
|
| ~writerDaosFs () noexcept(false) override |
|
void | seek (size_t position) override |
|
bool | parallelizable () const override |
| tell if this handler is capable of parallel IO. Unsually not the case More...
|
|
size_t | getSize () const override |
|
void | writeBlock (const block &b) override |
|
void | writeBlockP (const block &b) override |
|
void | doAttributePreservations (const genericStat &readInitialStat) override |
|
void | sync () override |
|
| daosFsIoCommon (const std::string &aPath, daosFsCommon &aHandler) |
|
void | setXattr (const std::string &name, const std::string &value) override |
|
std::string | getXattr (const std::string &name) override |
| get one extended attribute value More...
|
|
void | removeXattr (const std::string &name) override |
|
std::unique_ptr< const genericStat > | getStat () override |
|
std::unique_ptr< ioHandle::attrDataType > | getAttrData (const outputHandler::base *aOutputHandler) override |
| get attributes in the optimal way for setting with aOutputHandler More...
|
|
Public Member Functions inherited from ioHandle |
| ioHandle () |
|
virtual | ~ioHandle () noexcept(false) |
|
virtual size_t | getBlockSize () const |
|
virtual void | setBlockSize (size_t newSize) |
|
virtual std::unique_ptr< acl::list > | getAclData () |
| get acls More...
|
|
Definition at line 13 of file outputHandlerDaosFs.h.
◆ writerDaosFs() [1/2]
outputHandler::daosFs::writerDaosFs::writerDaosFs |
( |
const std::string & |
aPath, |
|
|
bool |
mightAppend, |
|
|
size_t |
sourceSize, |
|
|
size_t |
readBlockSize, |
|
|
copyRequest::stateType & |
state, |
|
|
bool |
noWrite, |
|
|
std::unique_ptr< ioHandle::attrDataType > |
aAttrData, |
|
|
std::unique_ptr< acl::list > |
aAclData, |
|
|
daosFs & |
aHandler |
|
) |
| |
Definition at line 229 of file outputHandlerDaosFs.cpp.
241 bool haveWriteStat =
false;
246 auto openMode = O_CREAT | O_TRUNC | O_WRONLY;
250 -1,
"can't open ",
path,
" for writing");
251 if (!haveWriteStat) {
256 "can't advise ",
path,
" as sequential");
258 "can't advise ",
path,
" as use only once");
References copyRequest::append, throwcall::badval(), ioHandle::blockSize, enumAsBitmask< T >::clear(), throwcall::good0(), daosFsIoCommon::obj, daosFsIoCommon::path, outputHandler::slownessThreshold, timerInstTO, and writeInitialStat.
◆ writerDaosFs() [2/2]
outputHandler::daosFs::writerDaosFs::writerDaosFs |
( |
std::string & |
aPath, |
|
|
bool |
noWrite, |
|
|
std::unique_ptr< ioHandle::attrDataType > |
aAttrData, |
|
|
std::unique_ptr< acl::list > |
aAclData, |
|
|
daosFs & |
aHandler |
|
) |
| |
◆ ~writerDaosFs()
outputHandler::daosFs::writerDaosFs::~writerDaosFs |
( |
| ) |
|
|
overridenoexcept |
◆ closeAndRemoveBadCopy()
void outputHandler::daosFs::writerDaosFs::closeAndRemoveBadCopy |
( |
| ) |
|
|
override |
Definition at line 292 of file outputHandlerDaosFs.cpp.
293 if (close(fd) != 0) {
295 path,
"close during unwind ",
296 std::system_category().default_error_condition(errno).message());
299 path,
"unlink failed copy",
"due to exception");
300 auto retval = unlink(
path.c_str());
301 if (retval && errno != ENOENT) {
303 path,
"can't remove bad copy ",
304 std::system_category().default_error_condition(errno).message());
References errMsg::debug, errMsg::emit(), and errMsg::err.
◆ doAttributePreservations()
void outputHandler::daosFs::writerDaosFs::doAttributePreservations |
( |
const genericStat & |
readInitialStat | ) |
|
|
override |
Definition at line 395 of file outputHandlerDaosFs.cpp.
397 struct timespec times[2];
408 auto oldmask = umask(0);
414 if (
gid != -1 ||
uid != -1) {
420 "can't set owner/group (", readInitialStat.
ownerUid,
",", readInitialStat.
ownerGid,
") of ",
References genericStat::getAtime(), genericStat::getMtime(), gid, throwcall::good0(), genericStat::mode, modeBits, genericStat::ownerGid, genericStat::ownerUid, preserve, timerInst, and uid.
◆ getSize()
size_t outputHandler::daosFs::writerDaosFs::getSize |
( |
| ) |
const |
|
override |
◆ parallelizable()
bool outputHandler::daosFs::writerDaosFs::parallelizable |
( |
| ) |
const |
|
overridevirtual |
◆ seek()
void outputHandler::daosFs::writerDaosFs::seek |
( |
size_t |
position | ) |
|
|
override |
◆ sync()
void outputHandler::daosFs::writerDaosFs::sync |
( |
| ) |
|
|
override |
◆ writeBlock()
void outputHandler::daosFs::writerDaosFs::writeBlock |
( |
const block & |
b | ) |
|
|
override |
Definition at line 343 of file outputHandlerDaosFs.cpp.
347 auto currentPosition =
throwcall::badval(lseek(fd, 0, SEEK_CUR), -1,
"lseek to determine position on",
path);
349 auto holeEnd = currentPosition + b.
size();
353 "fruncate ",
path,
" to ", holeEnd);
357 "can't seek to hole end (", holeEnd,
") in ",
path);
361 size_t bytes_writen_so_far = 0;
363 while (bytes_writen_so_far < b.
size()) {
364 auto count = b.
size() - bytes_writen_so_far;
372 -1,
"write failed on ",
path);
374 bytes_writen_so_far += bytes_writen;
References throwcall::badval(), block::bufferAt(), throwcall::good0(), block::isHole(), block::size(), timer::instanceUnscoped::stop(), timerInst, throttle::watch::update(), throttle::watch::wait(), and writeRateLimit.
◆ writeBlockP()
void outputHandler::daosFs::writerDaosFs::writeBlockP |
( |
const block & |
b | ) |
|
|
override |
◆ aclData
std::unique_ptr<acl::list> outputHandler::daosFs::writerDaosFs::aclData |
|
protected |
◆ attrData
◆ writeInitialStat
struct stat outputHandler::daosFs::writerDaosFs::writeInitialStat |
|
protected |
The documentation for this class was generated from the following files:
void closeAndRemoveBadCopy() override
class for defining the location of a error message in the source code.
void getAtime(struct timespec &spec) const
T badval(T call, t badvalue, const Args &... args)
template function to wrap system calls that return a special bad value on failure
struct stat writeInitialStat
std::unique_ptr< acl::list > aclData
static options::single< timer::clock_type::duration > slownessThreshold('\0',"daosFsSlownessThreshold", "duration after which file operations are considered slow", std::chrono::milliseconds(10))
void getMtime(struct timespec &spec) const
options::single< int > gid
size_t blockSize
in bytes, block size to be used when reading or writing
void * bufferAt(size_t offset)
only way to access the data in the block
decltype(preserve) preserve
set of properties to preserve in the copy
options::single< int > uid
daosFsIoCommon(const std::string &aPath, daosFsCommon &aHandler)
void emit(level aLogLevel, const location &loc, const std::string &aObject, const std::string &aAction, const Args &... args)
function to create and enqueue a message, this is the only way that messages should be created!
#define timerInst(subfunc)
throttle::watch writeRateLimit
#define timerInstTO(subfunc, timeout, object)
void good0(T call, const Args &... args)
template function to wrap system calls that return 0 on success
void clear(const T aBits)
void update(double units=1.0)
std::unique_ptr< ioHandle::attrDataType > attrData
options::single< modeBitType > modeBits