irods
4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
![]() ![]() |
#include "rcMisc.h"
#include "rcPortalOpr.h"
#include "dataObjClose.h"
#include "dataObjOpen.h"
#include "dataObjWrite.h"
#include "dataObjRead.h"
#include "dataObjLseek.h"
#include "fileLseek.h"
#include "dataObjOpr.hpp"
#include "rodsLog.h"
#include "rcGlobalExtern.h"
#include "sockComm.h"
#include "irods_stacktrace.hpp"
#include "irods_buffer_encryption.hpp"
#include "irods_client_server_negotiation.hpp"
#include <openssl/md5.h>
#include <boost/thread/thread.hpp>
#include <boost/thread/scoped_thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <iomanip>
#include <fstream>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/convenience.hpp>
Go to the source code of this file.
Functions | |
int | sendTranHeader (int sock, int oprType, int flags, rodsLong_t offset, rodsLong_t length) |
int | rcvTranHeader (int sock, transferHeader_t *myHeader) |
int | fillBBufWithFile (rcComm_t *conn, bytesBuf_t *myBBuf, char *locFilePath, rodsLong_t dataSize) |
int | putFileToPortal (rcComm_t *conn, portalOprOut_t *portalOprOut, char *locFilePath, char *objPath, rodsLong_t dataSize) |
int | fillRcPortalTransferInp (rcComm_t *conn, rcPortalTransferInp_t *myInput, int destFd, int srcFd, int threadNum) |
void | rcPartialDataPut (rcPortalTransferInp_t *myInput) |
int | putFile (rcComm_t *conn, int l1descInx, char *locFilePath, char *objPath, rodsLong_t dataSize) |
int | getIncludeFile (rcComm_t *conn, bytesBuf_t *dataObjOutBBuf, char *locFilePath) |
int | getFile (rcComm_t *conn, int l1descInx, char *locFilePath, char *objPath, rodsLong_t dataSize) |
int | getFileFromPortal (rcComm_t *conn, portalOprOut_t *portalOprOut, char *locFilePath, char *objPath, rodsLong_t dataSize) |
void | rcPartialDataGet (rcPortalTransferInp_t *myInput) |
int | putFileToPortalRbudp (portalOprOut_t *portalOprOut, char *locFilePath, int locFd, int veryVerbose, int sendRate, int packetSize) |
int | getFileToPortalRbudp (portalOprOut_t *portalOprOut, char *locFilePath, int locFd, int veryVerbose, int packetSize) |
int | initRbudpClient (rbudpBase_t *rbudpBase, portList_t *myPortList) |
int | initFileRestart (rcComm_t *conn, char *fileName, char *objPath, rodsLong_t fileSize, int numThr) |
int | writeLfRestartFile (char *infoFile, fileRestartInfo_t *info) |
int | readLfRestartFile (char *infoFile, fileRestartInfo_t **info) |
int | clearLfRestartFile (fileRestart_t *fileRestart) |
int | lfRestartPutWithInfo (rcComm_t *conn, fileRestartInfo_t *info) |
int | putSeg (rcComm_t *conn, rodsLong_t segSize, int localFd, openedDataObjInp_t *dataObjWriteInp, bytesBuf_t *dataObjWriteInpBBuf, int bufLen, int *writtenSinceUpdated, fileRestartInfo_t *info, rodsLong_t *dataSegLen) |
int | lfRestartGetWithInfo (rcComm_t *conn, fileRestartInfo_t *info) |
int | getSeg (rcComm_t *conn, rodsLong_t segSize, int localFd, openedDataObjInp_t *dataObjReadInp, bytesBuf_t *dataObjReadInpBBuf, int bufLen, int *writtenSinceUpdated, fileRestartInfo_t *info, rodsLong_t *dataSegLen) |
int | catDataObj (rcComm_t *conn, char *objPath) |
Definition at line 1886 of file rcPortalOpr.cpp.
References BytesBuf::buf, buf, getRodsEnv(), rodsEnv::irodsTransBufferSizeForParaTrans, OpenedDataObjInp::l1descInx, OpenedDataObjInp::len, BytesBuf::len, LOG_ERROR, MAX_NAME_LEN, DataObjInp::objPath, DataObjInp::openFlags, rcDataObjClose(), rcDataObjOpen(), rcDataObjRead(), rodsLog(), rodsLogError(), rstrcpy(), and irods.pypyodbc::status.
int clearLfRestartFile | ( | fileRestart_t * | fileRestart | ) |
Definition at line 1535 of file rcPortalOpr.cpp.
References fileRestart_t::info, and fileRestart_t::infoFile.
Referenced by rcDataObjGet(), and rcDataObjPut().
int fillBBufWithFile | ( | rcComm_t * | conn, |
bytesBuf_t * | myBBuf, | ||
char * | locFilePath, | ||
rodsLong_t | dataSize | ||
) |
Definition at line 93 of file rcPortalOpr.cpp.
References BytesBuf::buf, transferStat_t::bytesWritten, getRodsEnv(), rodsEnv::irodsMaxSizeForSingleBuffer, BytesBuf::len, LOG_ERROR, myRead(), NULL, rodsLog(), rodsLogError(), irods.pypyodbc::status, rcComm_t::transStat, UNIX_FILE_OPEN_ERR, and USER_FILE_TOO_LARGE.
Referenced by rcDataObjPut().
int fillRcPortalTransferInp | ( | rcComm_t * | conn, |
rcPortalTransferInp_t * | myInput, | ||
int | destFd, | ||
int | srcFd, | ||
int | threadNum | ||
) |
Definition at line 274 of file rcPortalOpr.cpp.
References RcPortalTransferInp::conn, RcPortalTransferInp::destFd, NAME_LEN, NULL, rcComm_t::shared_secret, RcPortalTransferInp::shared_secret, RcPortalTransferInp::srcFd, SYS_INTERNAL_NULL_INPUT_ERR, and RcPortalTransferInp::threadNum.
Referenced by getFileFromPortal(), and putFileToPortal().
int getFile | ( | rcComm_t * | conn, |
int | l1descInx, | ||
char * | locFilePath, | ||
char * | objPath, | ||
rodsLong_t | dataSize | ||
) |
Definition at line 688 of file rcPortalOpr.cpp.
References BytesBuf::buf, transferStat_t::bytesWritten, OperProgress::curFileSize, OperProgress::curFileSizeDone, fileRestartInfo_t::dataSeg, rcComm_t::fileRestart, OperProgress::flag, getRodsEnv(), gGuiProgressCB, fileRestart_t::info, fileRestart_t::infoFile, initFileRestart(), rodsEnv::irodsTransBufferSizeForParaTrans, OpenedDataObjInp::l1descInx, OpenedDataObjInp::len, dataSeg::len, BytesBuf::len, LOG_ERROR, MAX_PROGRESS_CNT, myWrite(), NULL, fileRestartInfo_t::numSeg, rcComm_t::operProgress, rcDataObjRead(), RESTART_FILE_UPDATE_SIZE, rodsLog(), rodsLogError(), irods.pypyodbc::status, STDOUT_FILE_NAME, SYS_COPY_LEN_ERR, rcComm_t::transStat, UNIX_FILE_OPEN_ERR, and writeLfRestartFile().
Referenced by rcDataObjGet().
int getFileFromPortal | ( | rcComm_t * | conn, |
portalOprOut_t * | portalOprOut, | ||
char * | locFilePath, | ||
char * | objPath, | ||
rodsLong_t | dataSize | ||
) |
Definition at line 833 of file rcPortalOpr.cpp.
References RcPortalTransferInp::bytesWritten, CLOSE_SOCK, connectToRhostPortal(), portList_t::cookie, fillRcPortalTransferInp(), gGuiProgressCB, portList_t::hostAddr, initFileRestart(), LOG_ERROR, MAX_NUM_CONFIG_TRAN_THR, NULL, portalOprOut::numThreads, rcComm_t::operProgress, portalOprOut::portList, portList_t::portNum, rcPartialDataGet(), rodsLog(), rodsLogError(), RcPortalTransferInp::status, irods.pypyodbc::status, SYS_COPY_LEN_ERR, SYS_INVALID_PORTAL_OPR, SYS_THREAD_RESOURCE_ERR, UNIX_FILE_OPEN_ERR, and portList_t::windowSize.
Referenced by rcDataObjGet().
int getFileToPortalRbudp | ( | portalOprOut_t * | portalOprOut, |
char * | locFilePath, | ||
int | locFd, | ||
int | veryVerbose, | ||
int | packetSize | ||
) |
Definition at line 1281 of file rcPortalOpr.cpp.
References getRodsEnv(), portList_t::hostAddr, initRbudpClient(), LOG_ERROR, NULL, portalOprOut::numThreads, portalOprOut::portList, RBUDP_PACK_SIZE_KW, rodsLog(), irods.pypyodbc::status, and SYS_INVALID_PORTAL_OPR.
Referenced by rbudpRemLocCopy(), and rcDataObjGet().
int getIncludeFile | ( | rcComm_t * | conn, |
bytesBuf_t * | dataObjOutBBuf, | ||
char * | locFilePath | ||
) |
Definition at line 639 of file rcPortalOpr.cpp.
References BytesBuf::buf, transferStat_t::bytesWritten, BytesBuf::len, LOG_ERROR, myWrite(), NULL, rodsLog(), rodsLogError(), irods.pypyodbc::status, STDOUT_FILE_NAME, SYS_COPY_LEN_ERR, rcComm_t::transStat, and UNIX_FILE_OPEN_ERR.
Referenced by rcDataObjGet().
int getSeg | ( | rcComm_t * | conn, |
rodsLong_t | segSize, | ||
int | localFd, | ||
openedDataObjInp_t * | dataObjReadInp, | ||
bytesBuf_t * | dataObjReadInpBBuf, | ||
int | bufLen, | ||
int * | writtenSinceUpdated, | ||
fileRestartInfo_t * | info, | ||
rodsLong_t * | dataSegLen | ||
) |
Definition at line 1826 of file rcPortalOpr.cpp.
References BytesBuf::buf, fileRestartInfo_t::fileName, rcComm_t::fileRestart, fileRestart_t::infoFile, int(), OpenedDataObjInp::len, BytesBuf::len, LOG_ERROR, myWrite(), NULL, rcDataObjRead(), RESTART_FILE_UPDATE_SIZE, rodsLog(), irods.pypyodbc::status, SYS_COPY_LEN_ERR, and writeLfRestartFile().
Referenced by lfRestartGetWithInfo().
int initFileRestart | ( | rcComm_t * | conn, |
char * | fileName, | ||
char * | objPath, | ||
rodsLong_t | fileSize, | ||
int | numThr | ||
) |
Definition at line 1409 of file rcPortalOpr.cpp.
References fileRestartInfo_t::dataSeg, FILE_RESTART_ON, fileRestartInfo_t::fileName, rcComm_t::fileRestart, fileRestartInfo_t::fileSize, fileRestart_t::flags, fileRestart_t::info, LOG_NOTICE, MAX_NAME_LEN, MAX_NUM_CONFIG_TRAN_THR, MIN_RESTART_SIZE, fileRestartInfo_t::numSeg, fileRestartInfo_t::objPath, rodsLog(), and rstrcpy().
Referenced by getFile(), getFileFromPortal(), putFile(), and putFileToPortal().
int initRbudpClient | ( | rbudpBase_t * | rbudpBase, |
portList_t * | myPortList | ||
) |
Definition at line 1352 of file rcPortalOpr.cpp.
References connectToRhostPortal(), portList_t::cookie, getTcpPortFromPortList(), getUdpPortFromPortList(), portList_t::hostAddr, LOG_ERROR, rodsLog(), setLocalAddr(), irods.pypyodbc::status, SYS_INVALID_PORTAL_OPR, SYS_UDP_CONNECT_ERR, and portList_t::windowSize.
Referenced by getFileToPortalRbudp(), and putFileToPortalRbudp().
int lfRestartGetWithInfo | ( | rcComm_t * | conn, |
fileRestartInfo_t * | info | ||
) |
Definition at line 1710 of file rcPortalOpr.cpp.
References BytesBuf::buf, fileRestartInfo_t::dataSeg, fileRestartInfo_t::fileName, fileRestartInfo_t::fileSize, getRodsEnv(), getSeg(), rodsEnv::irodsTransBufferSizeForParaTrans, OpenedDataObjInp::l1descInx, dataSeg::len, BytesBuf::len, LOG_ERROR, MAX_NAME_LEN, NULL, fileRestartInfo_t::numSeg, DataObjInp::objPath, fileRestartInfo_t::objPath, OpenedDataObjInp::offset, dataSeg::offset, DataObjInp::openFlags, rcDataObjClose(), rcDataObjLseek(), rcDataObjOpen(), rodsLog(), rodsLogError(), rstrcpy(), irods.pypyodbc::status, UNIX_FILE_LSEEK_ERR, UNIX_FILE_OPEN_ERR, and OpenedDataObjInp::whence.
Referenced by getUtil().
int lfRestartPutWithInfo | ( | rcComm_t * | conn, |
fileRestartInfo_t * | info | ||
) |
Definition at line 1543 of file rcPortalOpr.cpp.
References addKeyVal(), BytesBuf::buf, DataObjInp::condInput, fileRestartInfo_t::dataSeg, fileRestartInfo_t::fileName, fileRestartInfo_t::fileSize, FORCE_FLAG_KW, getRodsEnv(), rodsEnv::irodsTransBufferSizeForParaTrans, OpenedDataObjInp::l1descInx, dataSeg::len, BytesBuf::len, LOG_ERROR, MAX_NAME_LEN, NULL, fileRestartInfo_t::numSeg, DataObjInp::objPath, fileRestartInfo_t::objPath, OpenedDataObjInp::offset, dataSeg::offset, DataObjInp::openFlags, putSeg(), rcDataObjClose(), rcDataObjLseek(), rcDataObjOpen(), rodsLog(), rodsLogError(), rstrcpy(), irods.pypyodbc::status, UNIX_FILE_LSEEK_ERR, UNIX_FILE_OPEN_ERR, and OpenedDataObjInp::whence.
Referenced by putUtil().
int putFile | ( | rcComm_t * | conn, |
int | l1descInx, | ||
char * | locFilePath, | ||
char * | objPath, | ||
rodsLong_t | dataSize | ||
) |
Definition at line 528 of file rcPortalOpr.cpp.
References BytesBuf::buf, transferStat_t::bytesWritten, OperProgress::curFileSize, OperProgress::curFileSizeDone, fileRestartInfo_t::dataSeg, rcComm_t::fileRestart, OperProgress::flag, getRodsEnv(), gGuiProgressCB, fileRestart_t::info, fileRestart_t::infoFile, initFileRestart(), rodsEnv::irodsTransBufferSizeForParaTrans, OpenedDataObjInp::l1descInx, OpenedDataObjInp::len, dataSeg::len, BytesBuf::len, LOG_ERROR, MAX_PROGRESS_CNT, myRead(), NULL, fileRestartInfo_t::numSeg, rcComm_t::operProgress, rcDataObjWrite(), RESTART_FILE_UPDATE_SIZE, rodsLog(), rodsLogError(), irods.pypyodbc::status, SYS_COPY_LEN_ERR, rcComm_t::transStat, UNIX_FILE_OPEN_ERR, and writeLfRestartFile().
Referenced by rcDataObjPut().
int putFileToPortal | ( | rcComm_t * | conn, |
portalOprOut_t * | portalOprOut, | ||
char * | locFilePath, | ||
char * | objPath, | ||
rodsLong_t | dataSize | ||
) |
Definition at line 136 of file rcPortalOpr.cpp.
References RcPortalTransferInp::bytesWritten, connectToRhostPortal(), portList_t::cookie, fillRcPortalTransferInp(), gGuiProgressCB, portList_t::hostAddr, initFileRestart(), LOG_ERROR, MAX_NUM_CONFIG_TRAN_THR, NULL, portalOprOut::numThreads, rcComm_t::operProgress, portalOprOut::portList, portList_t::portNum, rcPartialDataPut(), rodsLog(), rodsLogError(), RcPortalTransferInp::status, irods.pypyodbc::status, SYS_COPY_LEN_ERR, SYS_INVALID_PORTAL_OPR, SYS_THREAD_RESOURCE_ERR, UNIX_FILE_OPEN_ERR, and portList_t::windowSize.
Referenced by rcDataObjPut().
int putFileToPortalRbudp | ( | portalOprOut_t * | portalOprOut, |
char * | locFilePath, | ||
int | locFd, | ||
int | veryVerbose, | ||
int | sendRate, | ||
int | packetSize | ||
) |
Definition at line 1210 of file rcPortalOpr.cpp.
References portList_t::hostAddr, initRbudpClient(), LOG_ERROR, NULL, portalOprOut::numThreads, portalOprOut::portList, portList_t::portNum, RBUDP_PACK_SIZE_KW, RBUDP_SEND_RATE_KW, rodsLog(), irods.pypyodbc::status, and SYS_INVALID_PORTAL_OPR.
Referenced by rbudpRemLocCopy(), and rcDataObjPut().
int putSeg | ( | rcComm_t * | conn, |
rodsLong_t | segSize, | ||
int | localFd, | ||
openedDataObjInp_t * | dataObjWriteInp, | ||
bytesBuf_t * | dataObjWriteInpBBuf, | ||
int | bufLen, | ||
int * | writtenSinceUpdated, | ||
fileRestartInfo_t * | info, | ||
rodsLong_t * | dataSegLen | ||
) |
Definition at line 1661 of file rcPortalOpr.cpp.
References BytesBuf::buf, fileRestartInfo_t::fileName, rcComm_t::fileRestart, fileRestart_t::infoFile, int(), OpenedDataObjInp::len, BytesBuf::len, LOG_ERROR, myRead(), NULL, rcDataObjWrite(), RESTART_FILE_UPDATE_SIZE, rodsLog(), irods.pypyodbc::status, SYS_COPY_LEN_ERR, and writeLfRestartFile().
Referenced by lfRestartPutWithInfo().
void rcPartialDataGet | ( | rcPortalTransferInp_t * | myInput | ) |
Definition at line 976 of file rcPortalOpr.cpp.
References buf, transferStat_t::bytesWritten, RcPortalTransferInp::bytesWritten, CLOSE_SOCK, RcPortalTransferInp::conn, irods::experimental::filesystem::client::copy(), irods::CS_NEG_USE_SSL(), OperProgress::curFileSizeDone, fileRestartInfo_t::dataSeg, irods::buffer_crypt::decrypt(), RcPortalTransferInp::destFd, DONE_OPR, fileRestartInfo_t::fileName, rcComm_t::fileRestart, OperProgress::flag, getRodsEnv(), gGuiProgressCB, fileRestart_t::info, fileRestart_t::infoFile, rodsEnv::irodsTransBufferSizeForParaTrans, irods::buffer_crypt::key_size(), dataSeg::len, TransferHeader::length, irods::log(), LOG_ERROR, myRead(), myWrite(), rcComm_t::negotiation_results, NULL, fileRestartInfo_t::numSeg, TransferHeader::offset, dataSeg::offset, irods::error::ok(), rcComm_t::operProgress, TransferHeader::oprType, PASS, rcvTranHeader(), RESTART_FILE_UPDATE_SIZE, rodsEnv::rodsEncryptionAlgorithm, rodsEnv::rodsEncryptionKeySize, rodsEnv::rodsEncryptionNumHashRounds, rodsEnv::rodsEncryptionSaltSize, rodsLog(), rodsLogError(), RcPortalTransferInp::shared_secret, RcPortalTransferInp::srcFd, RcPortalTransferInp::status, irods.pypyodbc::status, SYS_COPY_LEN_ERR, RcPortalTransferInp::threadNum, rcComm_t::transStat, UNIX_FILE_LSEEK_ERR, writeLfRestartFile(), and fileRestart_t::writtenSinceUpdated.
Referenced by getFileFromPortal().
void rcPartialDataPut | ( | rcPortalTransferInp_t * | myInput | ) |
Definition at line 291 of file rcPortalOpr.cpp.
References buf, transferStat_t::bytesWritten, RcPortalTransferInp::bytesWritten, RcPortalTransferInp::conn, irods::experimental::filesystem::client::copy(), irods::CS_NEG_USE_SSL(), OperProgress::curFileSizeDone, fileRestartInfo_t::dataSeg, RcPortalTransferInp::destFd, DONE_OPR, irods::buffer_crypt::encrypt(), fileRestartInfo_t::fileName, rcComm_t::fileRestart, OperProgress::flag, getRodsEnv(), gGuiProgressCB, fileRestart_t::info, fileRestart_t::infoFile, irods::buffer_crypt::initialization_vector(), rodsEnv::irodsTransBufferSizeForParaTrans, irods::buffer_crypt::key_size(), dataSeg::len, TransferHeader::length, LOG_ERROR, myRead(), mySockClose(), myWrite(), rcComm_t::negotiation_results, NULL, fileRestartInfo_t::numSeg, TransferHeader::offset, dataSeg::offset, irods::error::ok(), rcComm_t::operProgress, TransferHeader::oprType, PASS, rcvTranHeader(), RESTART_FILE_UPDATE_SIZE, irods::error::result(), rodsEnv::rodsEncryptionAlgorithm, rodsEnv::rodsEncryptionKeySize, rodsEnv::rodsEncryptionNumHashRounds, rodsEnv::rodsEncryptionSaltSize, rodsLog(), rodsLogError(), RcPortalTransferInp::shared_secret, RcPortalTransferInp::srcFd, RcPortalTransferInp::status, irods.pypyodbc::status, SYS_COPY_LEN_ERR, RcPortalTransferInp::threadNum, rcComm_t::transStat, UNIX_FILE_LSEEK_ERR, writeLfRestartFile(), and fileRestart_t::writtenSinceUpdated.
Referenced by putFileToPortal().
int rcvTranHeader | ( | int | sock, |
transferHeader_t * | myHeader | ||
) |
Definition at line 65 of file rcPortalOpr.cpp.
References TransferHeader::flags, TransferHeader::length, LOG_ERROR, myNtohll(), myRead(), NULL, TransferHeader::offset, TransferHeader::oprType, rodsLog(), and SYS_COPY_LEN_ERR.
Referenced by locToRemPartialCopy(), rcPartialDataGet(), rcPartialDataPut(), and remToLocPartialCopy().
int readLfRestartFile | ( | char * | infoFile, |
fileRestartInfo_t ** | info | ||
) |
Definition at line 1475 of file rcPortalOpr.cpp.
References buf, irods::experimental::administration::client::v1::exists(), LOG_ERROR, NULL, pid_age::p, rodsLog(), irods.pypyodbc::status, SYS_MALLOC_ERR, UNIX_FILE_OPEN_ERR, UNIX_FILE_READ_ERR, UNIX_FILE_STAT_ERR, unpackStruct(), and XML_PROT.
Referenced by getUtil(), and putUtil().
int sendTranHeader | ( | int | sock, |
int | oprType, | ||
int | flags, | ||
rodsLong_t | offset, | ||
rodsLong_t | length | ||
) |
Definition at line 36 of file rcPortalOpr.cpp.
References TransferHeader::flags, TransferHeader::length, LOG_ERROR, myHtonll(), myWrite(), NULL, TransferHeader::offset, TransferHeader::oprType, rodsLog(), and SYS_COPY_LEN_ERR.
Referenced by partialDataGet(), and partialDataPut().
int writeLfRestartFile | ( | char * | infoFile, |
fileRestartInfo_t * | info | ||
) |
Definition at line 1435 of file rcPortalOpr.cpp.
References BytesBuf::buf, freeBBuf(), BytesBuf::len, LOG_ERROR, NULL, packStruct(), rodsLog(), RodsPackTable, irods.pypyodbc::status, UNIX_FILE_OPEN_ERR, UNIX_FILE_WRITE_ERR, and XML_PROT.
Referenced by getFile(), getSeg(), putFile(), putSeg(), rcPartialDataGet(), and rcPartialDataPut().