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.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rcPortalOpr.cpp File Reference
#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>
Include dependency graph for rcPortalOpr.cpp:

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)
 

Function Documentation

◆ catDataObj()

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.

Here is the call graph for this function:

◆ clearLfRestartFile()

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().

◆ fillBBufWithFile()

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().

Here is the call graph for this function:

◆ fillRcPortalTransferInp()

◆ getFile()

◆ getFileFromPortal()

int getFileFromPortal ( rcComm_t conn,
portalOprOut_t portalOprOut,
char *  locFilePath,
char *  objPath,
rodsLong_t  dataSize 
)

◆ getFileToPortalRbudp()

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().

Here is the call graph for this function:

◆ getIncludeFile()

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().

Here is the call graph for this function:

◆ getSeg()

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().

Here is the call graph for this function:

◆ initFileRestart()

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().

Here is the call graph for this function:

◆ initRbudpClient()

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().

Here is the call graph for this function:

◆ lfRestartGetWithInfo()

◆ lfRestartPutWithInfo()

◆ putFile()

◆ putFileToPortal()

int putFileToPortal ( rcComm_t conn,
portalOprOut_t portalOprOut,
char *  locFilePath,
char *  objPath,
rodsLong_t  dataSize 
)

◆ putFileToPortalRbudp()

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().

Here is the call graph for this function:

◆ putSeg()

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().

Here is the call graph for this function:

◆ rcPartialDataGet()

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().

Here is the call graph for this function:

◆ rcPartialDataPut()

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().

Here is the call graph for this function:

◆ rcvTranHeader()

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().

Here is the call graph for this function:

◆ readLfRestartFile()

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().

Here is the call graph for this function:

◆ sendTranHeader()

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().

Here is the call graph for this function:

◆ writeLfRestartFile()

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().

Here is the call graph for this function: