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)  

rsSubStructFileCreate.cpp
Go to the documentation of this file.
1 
3 #include "miscServerFunct.hpp"
4 #include "dataObjOpr.hpp"
5 #include "subStructFileCreate.h"
7 
8 // =-=-=-=-=-=-=-
10 #include "irods_log.hpp"
11 
12 int
15  int remoteFlag;
16  int fd;
17 
18  remoteFlag = resolveHost( &subFile->addr, &rodsServerHost );
19 
20  if ( remoteFlag == LOCAL_HOST ) {
21  fd = _rsSubStructFileCreate( rsComm, subFile );
22  }
23  else if ( remoteFlag == REMOTE_HOST ) {
24  fd = remoteSubStructFileCreate( rsComm, subFile, rodsServerHost );
25  }
26  else {
27  if ( remoteFlag < 0 ) {
28  return remoteFlag;
29  }
30  else {
32  "rsSubStructFileCreate: resolveHost returned unrecognized value %d",
33  remoteFlag );
35  }
36  }
37 
38  return fd;
39 }
40 
41 int
44  int fd;
45  int status;
46 
47  if ( rodsServerHost == NULL ) {
49  "remoteSubStructFileCreate: Invalid rodsServerHost" );
51  }
52 
53  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
54  return status;
55  }
56 
57  fd = rcSubStructFileCreate( rodsServerHost->conn, subFile );
58 
59  if ( fd < 0 ) {
61  "remoteSubStructFileCreate: rcSubStructFileCreate failed for %s, status = %d",
62  subFile->subFilePath, fd );
63  }
64 
65  return fd;
66 }
67 
68 // =-=-=-=-=-=-=-
69 // local function to handle sub file creation
71  rsComm_t* _comm,
72  subFile_t* _sub_file ) {
73 
76  *_sub_file ) );
77  struct_obj->comm( _comm );
78  struct_obj->resc_hier( _sub_file->specColl->rescHier );
79 
80  irods::error err = fileCreate( _comm, struct_obj );
81  if ( !err.ok() ) {
82  std::stringstream msg;
83  msg << "failed on call to fileCreate for [";
84  msg << struct_obj->sub_file_path();
85  irods::log( PASSMSG( msg.str(), err ) );
86  return 0;
87 
88  }
89  else {
90  return err.code();
91 
92  }
93 
94 } // _rsSubStructFileCreate
rodsLog
void rodsLog(int level, const char *formatStr,...)
Definition: rodsLog.cpp:86
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
Subfile
Definition: objInfo.h:316
SYS_UNRECOGNIZED_REMOTE_FLAG
@ SYS_UNRECOGNIZED_REMOTE_FLAG
Definition: rodsErrorTable.h:88
subStructFileCreate.h
Subfile::subFilePath
char subFilePath[(1024+64)]
Definition: objInfo.h:318
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
Subfile::specColl
specColl_t * specColl
Definition: objInfo.h:322
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
rcSubStructFileCreate
int rcSubStructFileCreate(rcComm_t *conn, subFile_t *subFile)
Definition: rcSubStructFileCreate.cpp:23
irods::error::code
long long code() const
Definition: irods_error.cpp:194
irods::structured_object
Definition: irods_structured_object.hpp:15
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
Subfile::addr
rodsHostAddr_t addr
Definition: objInfo.h:317
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
SpecColl::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:84
irods::log
void log(const error &)
Definition: irods_log.cpp:13
irods::structured_object_ptr
boost::shared_ptr< structured_object > structured_object_ptr
Definition: irods_structured_object.hpp:107
fileCreate
irods::error fileCreate(rsComm_t *, irods::first_class_object_ptr)
Definition: fileDriver.cpp:17
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
irods::error
Definition: irods_error.hpp:23
miscServerFunct.hpp
rsSubStructFileCreate.hpp
rodsServerHost
Definition: rodsConnect.h:62
_rsSubStructFileCreate
int _rsSubStructFileCreate(rsComm_t *_comm, subFile_t *_sub_file)
Definition: rsSubStructFileCreate.cpp:70
rsSubStructFileCreate
int rsSubStructFileCreate(rsComm_t *rsComm, subFile_t *subFile)
Definition: rsSubStructFileCreate.cpp:13
irods_structured_object.hpp
dataObjOpr.hpp
remoteSubStructFileCreate
int remoteSubStructFileCreate(rsComm_t *rsComm, subFile_t *subFile, rodsServerHost_t *rodsServerHost)
Definition: rsSubStructFileCreate.cpp:42
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
irods_log.hpp
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375