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)  

rsDataPut.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See dataPut.h for a description of this API call.*/
5 
6 #include "rcMisc.h"
7 #include "dataPut.h"
8 #include "rodsLog.h"
9 #include "miscServerFunct.hpp"
10 #include "rsGlobalExtern.hpp"
11 #include "rcGlobalExtern.h"
12 #include "rsDataPut.hpp"
13 
14 /* rsDataPut - this routine setup portalOprOut with the resource server
15  * for parallel put operation.
16  */
17 
18 int
19 rsDataPut( rsComm_t *rsComm, dataOprInp_t *dataOprInp,
21  int status;
22  int remoteFlag;
23  int l3descInx;
25 
26  l3descInx = dataOprInp->destL3descInx;
27 
28  if ( getValByKey( &dataOprInp->condInput, EXEC_LOCALLY_KW ) != NULL ) {
29  remoteFlag = LOCAL_HOST;
30  }
31  else {
33  if ( rodsServerHost == NULL ) {
34  rodsLog( LOG_NOTICE, "rsDataPut: NULL rodsServerHost" );
36  }
37  remoteFlag = rodsServerHost->localFlag;
38  }
39 
40  if ( remoteFlag == LOCAL_HOST ) {
41  status = _rsDataPut( rsComm, dataOprInp, portalOprOut );
42  }
43  else {
44  addKeyVal( &dataOprInp->condInput, EXEC_LOCALLY_KW, "" );
45  status = remoteDataPut( rsComm, dataOprInp, portalOprOut,
47  clearKeyVal( &dataOprInp->condInput );
48  }
49 
50 
51  return status;
52 }
53 
54 int
55 _rsDataPut( rsComm_t *rsComm, dataOprInp_t *dataOprInp,
57  int status;
58 
59  status = setupSrvPortalForParaOpr( rsComm, dataOprInp, PUT_OPR,
60  portalOprOut );
61 
62  return status;
63 }
64 
65 
66 int
67 remoteDataPut( rsComm_t *rsComm, dataOprInp_t *dataOprInp,
69  int status;
70 
71  if ( rodsServerHost == NULL ) {
73  "remoteDataPut: Invalid rodsServerHost" );
75  }
76 
77  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
78  return status;
79  }
80 
81  dataOprInp->destL3descInx = convL3descInx( dataOprInp->destL3descInx );
82 
83  status = rcDataPut( rodsServerHost->conn, dataOprInp, portalOprOut );
84 
85  return status;
86 }
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
getValByKey
char * getValByKey(const keyValPair_t *condInput, const char *keyWord)
Definition: rcMisc.cpp:675
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
SYS_INTERNAL_NULL_INPUT_ERR
@ SYS_INTERNAL_NULL_INPUT_ERR
Definition: rodsErrorTable.h:92
rodsServerHost::localFlag
int localFlag
Definition: rodsConnect.h:68
DataOprInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:134
portalOprOut
Definition: dataObjInpOut.h:114
rcDataPut
int rcDataPut(rcComm_t *conn, dataOprInp_t *dataPutInp, portalOprOut_t **portalOprOut)
Definition: rcDataPut.cpp:36
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
rcMisc.h
PUT_OPR
#define PUT_OPR
Definition: dataObjInpOut.h:167
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
rcGlobalExtern.h
rsDataPut
int rsDataPut(rsComm_t *rsComm, dataOprInp_t *dataOprInp, portalOprOut_t **portalOprOut)
Definition: rsDataPut.cpp:19
rsGlobalExtern.hpp
EXEC_LOCALLY_KW
#define EXEC_LOCALLY_KW
Definition: rodsKeyWdDef.h:12
rsDataPut.hpp
fileDesc_t::rodsServerHost
rodsServerHost_t * rodsServerHost
Definition: fileOpr.hpp:26
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
convL3descInx
int convL3descInx(int l3descInx)
Definition: objDesc.cpp:571
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
rodsLog.h
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
miscServerFunct.hpp
FileDesc
fileDesc_t FileDesc[1026]
Definition: irods_server_globals.cpp:28
remoteDataPut
int remoteDataPut(rsComm_t *rsComm, dataOprInp_t *dataOprInp, portalOprOut_t **portalOprOut, rodsServerHost_t *rodsServerHost)
Definition: rsDataPut.cpp:67
rodsServerHost
Definition: rodsConnect.h:62
DataOprInp
Definition: dataObjInpOut.h:122
DataOprInp::destL3descInx
int destL3descInx
Definition: dataObjInpOut.h:126
dataPut.h
setupSrvPortalForParaOpr
int setupSrvPortalForParaOpr(rsComm_t *rsComm, dataOprInp_t *dataOprInp, int oprType, portalOprOut_t **portalOprOut)
Definition: miscServerFunct.cpp:138
_rsDataPut
int _rsDataPut(rsComm_t *rsComm, dataOprInp_t *dataOprInp, portalOprOut_t **portalOprOut)
Definition: rsDataPut.cpp:55
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047