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)  

rsUnbunAndRegPhyBunfile.cpp
Go to the documentation of this file.
1 
3 /* rsStructFileExtAndReg.c. See unbunAndRegPhyBunfile.h for a description of
4  * this API call.*/
5 
7 #include "apiHeaderAll.h"
8 #include "miscServerFunct.hpp"
9 #include "objMetaOpr.hpp"
10 #include "resource.hpp"
11 #include "dataObjOpr.hpp"
12 #include "physPath.hpp"
13 #include "rcGlobalExtern.h"
15 #include "irods_stacktrace.hpp"
16 #include "rsPhyBundleColl.hpp"
17 #include "rsDataObjUnlink.hpp"
18 #include "rsRegReplica.hpp"
19 #include "rsStructFileExtract.hpp"
20 
22 
23 #include <boost/filesystem/operations.hpp>
24 #include <boost/filesystem/convenience.hpp>
25 using namespace boost::filesystem;
26 
27 int
29  int status;
30  char *resc_name;
31 
32  if ( ( resc_name = getValByKey( &dataObjInp->condInput, DEST_RESC_NAME_KW ) )
33  == NULL ) {
35  }
36 
37  irods::error resc_err = irods::is_hier_live( resc_name );
38  if ( !resc_err.ok() ) {
39  std::stringstream msg;
40  msg << __FUNCTION__;
41  msg << " - Failed for resource [";
42  msg << resc_name;
43  msg << "]";
44  irods::log( PASSMSG( msg.str(), resc_err ) );
45  return resc_err.code();
46  }
47 
48  status = _rsUnbunAndRegPhyBunfile( rsComm, dataObjInp, resc_name );
49 
50  return status;
51 }
52 
53 int
54 _rsUnbunAndRegPhyBunfile( rsComm_t *rsComm, dataObjInp_t *dataObjInp, const char *_resc_name ) {
55  int status;
56  int remoteFlag;
58  char *bunFilePath;
59  char phyBunDir[MAX_NAME_LEN];
60  int rmBunCopyFlag;
61  char *dataType = NULL; // JMC - backport 4664
62 
63  char* resc_hier = getValByKey( &dataObjInp->condInput, RESC_HIER_STR_KW );
64  if ( !resc_hier ) {
65  rodsLog( LOG_NOTICE, "_rsUnbunAndRegPhyBunfile - RESC_HIER_STR_KW is NULL" );
66  return -1;
67  }
68 
69  // =-=-=-=-=-=-=-
70  // extract the host location from the resource hierarchy
71  std::string location;
72  irods::error ret = irods::get_loc_for_hier_string( resc_hier, location );
73  if ( !ret.ok() ) {
74  irods::log( PASS( ret ) );
75  return -1;
76  }
77 
78  rodsHostAddr_t addr;
79  memset( &addr, 0, sizeof( addr ) );
80  rstrcpy( addr.hostAddr, location.c_str(), NAME_LEN );
81  remoteFlag = resolveHost( &addr, &rodsServerHost );
82  if ( remoteFlag == REMOTE_HOST ) {
83  addKeyVal( &dataObjInp->condInput, DEST_RESC_NAME_KW, _resc_name );
84  status = remoteUnbunAndRegPhyBunfile( rsComm, dataObjInp,
86  return status;
87  }
88  /* process this locally */
89  if ( ( bunFilePath = getValByKey( &dataObjInp->condInput, BUN_FILE_PATH_KW ) ) // JMC - backport 4768
90  == NULL ) {
92  "_rsUnbunAndRegPhyBunfile: No filePath input for %s",
93  dataObjInp->objPath );
94  return SYS_INVALID_FILE_PATH;
95  }
96 
97  createPhyBundleDir( rsComm, bunFilePath, phyBunDir, resc_hier );
98  dataType = getValByKey( &dataObjInp->condInput, DATA_TYPE_KW ); // JMC - backport 4664
99  status = unbunPhyBunFile( rsComm, dataObjInp->objPath, _resc_name, bunFilePath, phyBunDir,
100  dataType, 0, resc_hier ); // JMC - backport 4632, 4657, 4664
101 
102  if ( status < 0 ) {
104  "_rsUnbunAndRegPhyBunfile:unbunPhyBunFile err for %s to dir %s.stat=%d",
105  bunFilePath, phyBunDir, status );
106  return status;
107  }
108 
109  if ( getValByKey( &dataObjInp->condInput, RM_BUN_COPY_KW ) == NULL ) {
110  rmBunCopyFlag = 0;
111  }
112  else {
113  rmBunCopyFlag = 1;
114  }
115 
116  status = regUnbunPhySubfiles( rsComm, _resc_name, phyBunDir, rmBunCopyFlag );
117 
118  if ( status == CAT_NO_ROWS_FOUND ) {
119  /* some subfiles have been deleted. harmless */
120  status = 0;
121  }
122  else if ( status < 0 ) {
124  "_rsUnbunAndRegPhyBunfile: regUnbunPhySubfiles for dir %s. stat = %d",
125  phyBunDir, status );
126  }
127 
128  return status;
129 }
130 
131 int
132 regUnbunPhySubfiles( rsComm_t *rsComm, const char *_resc_name, char *phyBunDir,
133  int rmBunCopyFlag ) {
134  char subfilePath[MAX_NAME_LEN];
135  dataObjInp_t dataObjInp;
136  dataObjInp_t dataObjUnlinkInp;
137  int status = 0;
138  int savedStatus = 0;
139 
140  dataObjInfo_t *dataObjInfoHead = NULL;
141  dataObjInfo_t *bunDataObjInfo = NULL; /* the copy in BUNDLE_RESC */
142  path srcDirPath( phyBunDir );
143  if ( !exists( srcDirPath ) || !is_directory( srcDirPath ) ) {
145  "regUnbunphySubfiles: opendir error for %s, errno = %d",
146  phyBunDir, errno );
147  return UNIX_FILE_OPENDIR_ERR - errno;
148  }
149  bzero( &dataObjInp, sizeof( dataObjInp ) );
150  if ( rmBunCopyFlag > 0 ) {
151  bzero( &dataObjUnlinkInp, sizeof( dataObjUnlinkInp ) );
152  addKeyVal( &dataObjUnlinkInp.condInput, ADMIN_KW, "" );
153  }
154 
155  directory_iterator end_itr; // default construction yields past-the-end
156  for ( directory_iterator itr( srcDirPath ); itr != end_itr; ++itr ) {
157  path p = itr->path();
158  snprintf( subfilePath, MAX_NAME_LEN, "%s",
159  p.c_str() );
160 
161  if ( !exists( p ) ) {
163  "regUnbunphySubfiles: stat error for %s, errno = %d",
164  subfilePath, errno );
165  return UNIX_FILE_STAT_ERR - errno;
166  }
167 
168  if ( !is_regular_file( p ) ) {
169  continue;
170  }
171 
172  path childPath = p.filename();
173  /* do the registration */
175  ( char * ) childPath.c_str() );
176  status = getDataObjInfo( rsComm, &dataObjInp, &dataObjInfoHead,
177  NULL, 1 );
178  if ( status < 0 ) {
180  "regUnbunphySubfiles: getDataObjInfo error for %s, status = %d",
181  subfilePath, status );
182  /* don't terminate beause the data Obj may be deleted */
183  unlink( subfilePath );
184  continue;
185  }
186  requeDataObjInfoByResc( &dataObjInfoHead, BUNDLE_RESC, 1, 1 );
187  bunDataObjInfo = NULL;
188  if ( strcmp( dataObjInfoHead->rescName, BUNDLE_RESC ) != 0 ) {
189  /* no match */
191  "regUnbunphySubfiles: No copy in BUNDLE_RESC for %s",
192  dataObjInfoHead->objPath );
193  /* don't terminate beause the copy may be deleted */
194  unlink( subfilePath );
195  continue;
196  }
197  else {
198  bunDataObjInfo = dataObjInfoHead;
199  }
200  requeDataObjInfoByResc( &dataObjInfoHead, _resc_name, 1, 1 );
201  /* The copy in DEST_RESC_NAME_KW should be on top */
202  if ( strstr(_resc_name, dataObjInfoHead->rescHier) != 0 ) {
203  /* no copy. stage it */
204  status = regPhySubFile( rsComm, subfilePath, bunDataObjInfo, _resc_name );
205  unlink( subfilePath );
206  if ( status < 0 ) {
208  "regUnbunphySubfiles: regPhySubFile err for %s, status = %d",
209  bunDataObjInfo->objPath, status );
210  }
211  }
212  else {
213  /* XXXXXX have a copy. don't do anything for now */
214  unlink( subfilePath );
215  }
216  if ( rmBunCopyFlag > 0 ) {
217  rstrcpy( dataObjUnlinkInp.objPath, bunDataObjInfo->objPath,
218  MAX_NAME_LEN );
219  status = dataObjUnlinkS( rsComm, &dataObjUnlinkInp, bunDataObjInfo );
220  if ( status < 0 ) {
222  "regUnbunphySubfiles: dataObjUnlinkS err for %s, status = %d",
223  bunDataObjInfo->objPath, status );
224  savedStatus = status;
225  }
226  }
227  freeAllDataObjInfo( dataObjInfoHead );
228 
229  }
230  clearKeyVal( &dataObjInp.condInput );
231  if ( status >= 0 && savedStatus < 0 ) {
232  return savedStatus;
233  }
234  else {
235  return status;
236  }
237 }
238 
239 int
240 regPhySubFile( rsComm_t *rsComm, char *subfilePath,
241  dataObjInfo_t *bunDataObjInfo, const char *_resc_name ) {
242  dataObjInfo_t stageDataObjInfo;
243  dataObjInp_t dataObjInp;
244  int status;
245  regReplica_t regReplicaInp;
246 
247  bzero( &dataObjInp, sizeof( dataObjInp ) );
248  bzero( &stageDataObjInfo, sizeof( stageDataObjInfo ) );
249  rstrcpy( dataObjInp.objPath, bunDataObjInfo->objPath, MAX_NAME_LEN );
250  rstrcpy( stageDataObjInfo.objPath, bunDataObjInfo->objPath, MAX_NAME_LEN );
251  rstrcpy( stageDataObjInfo.rescName, _resc_name, NAME_LEN );
252 
253  status = getFilePathName( rsComm, &stageDataObjInfo, &dataObjInp );
254  if ( status < 0 ) {
256  "regPhySubFile: getFilePathName err for %s. status = %d",
257  dataObjInp.objPath, status );
258  return status;
259  }
260 
261  path p( stageDataObjInfo.filePath );
262  if ( exists( p ) ) {
263  status = resolveDupFilePath( rsComm, &stageDataObjInfo, &dataObjInp );
264  if ( status < 0 ) {
266  "regPhySubFile: resolveDupFilePath err for %s. status = %d",
267  stageDataObjInfo.filePath, status );
268  return status;
269  }
270  }
271 
272  /* make the necessary dir */
274  rsComm,
275  0,
276  stageDataObjInfo.filePath,
277  stageDataObjInfo.rescHier,
278  getDefDirMode() );
279  if ( status < 0 ) {
280  rodsLog( LOG_ERROR, "mkDirForFilePath failed in regPhySubFile with status %d", status );
281  return status;
282  }
283 
284  /* add a link */
285  status = link( subfilePath, stageDataObjInfo.filePath );
286  if ( status < 0 ) {
288  "regPhySubFile: link error %s to %s. errno = %d",
289  subfilePath, stageDataObjInfo.filePath, errno );
290  return UNIX_FILE_LINK_ERR - errno;
291  }
292 
293  bzero( &regReplicaInp, sizeof( regReplicaInp ) );
294  regReplicaInp.srcDataObjInfo = bunDataObjInfo;
295  regReplicaInp.destDataObjInfo = &stageDataObjInfo;
296  addKeyVal( &regReplicaInp.condInput, SU_CLIENT_USER_KW, "" );
297  addKeyVal( &regReplicaInp.condInput, ADMIN_KW, "" );
298 
299  status = rsRegReplica( rsComm, &regReplicaInp );
300 
301  clearKeyVal( &regReplicaInp.condInput );
302  if ( status < 0 ) {
304  "regPhySubFile: rsRegReplica error for %s. status = %d",
305  bunDataObjInfo->objPath, status );
306  return status;
307  }
308 
309  return status;
310 }
311 
312 int unbunPhyBunFile( rsComm_t *rsComm, char *objPath,
313  const char *_resc_name, char *bunFilePath, char *phyBunDir,
314  char *dataType, int oprType, const char* resc_hier ) { // JMC - backport 4632, 4657
315  int status;
316  structFileOprInp_t structFileOprInp;
317 
318  // =-=-=-=-=-=-=-
319  // extract the host location from the resource hierarchy
320  std::string location;
321  irods::error ret = irods::get_loc_for_hier_string( resc_hier, location );
322  if ( !ret.ok() ) {
323  irods::log( PASS( ret ) );
324  return -1;
325  }
326 
327  /* untar the bunfile */
328  memset( &structFileOprInp, 0, sizeof( structFileOprInp_t ) );
329  structFileOprInp.specColl = ( specColl_t* )malloc( sizeof( specColl_t ) );
330  memset( structFileOprInp.specColl, 0, sizeof( specColl_t ) );
331  structFileOprInp.specColl->type = TAR_STRUCT_FILE_T;
332  snprintf( structFileOprInp.specColl->collection, MAX_NAME_LEN,
333  "%s.dir", objPath ); // JMC - backport 4657
334  rstrcpy( structFileOprInp.specColl->objPath,
335  objPath, MAX_NAME_LEN ); // JMC - backport 4657
336  structFileOprInp.specColl->collClass = STRUCT_FILE_COLL;
337  rstrcpy( structFileOprInp.specColl->resource, _resc_name, NAME_LEN );
338  rstrcpy( structFileOprInp.specColl->phyPath, bunFilePath, MAX_NAME_LEN );
339  rstrcpy( structFileOprInp.addr.hostAddr, location.c_str(), NAME_LEN );
340  rstrcpy( structFileOprInp.specColl->rescHier, resc_hier, MAX_NAME_LEN );
341 
342  /* set the cacheDir */
343  rstrcpy( structFileOprInp.specColl->cacheDir, phyBunDir, MAX_NAME_LEN );
344  /* pass on the dataType */
345 
346 
347  if ( dataType != NULL && // JMC - backport 4632
348  ( strstr( dataType, GZIP_TAR_DT_STR ) != NULL || // JMC - backport 4658
349  strstr( dataType, BZIP2_TAR_DT_STR ) != NULL ||
350  strstr( dataType, ZIP_DT_STR ) != NULL ) ) {
351  addKeyVal( &structFileOprInp.condInput, DATA_TYPE_KW, dataType );
352  }
353 
354  if ( ( oprType & PRESERVE_DIR_CONT ) == 0 ) { // JMC - backport 4657
355  rmLinkedFilesInUnixDir( phyBunDir );
356  }
357  structFileOprInp.oprType = oprType; // JMC - backport 4657
358  status = rsStructFileExtract( rsComm, &structFileOprInp );
360  /* phyBunDir is not empty */
361  if ( chkOrphanDir( rsComm, phyBunDir, _resc_name ) > 0 ) {
362  /* it is a orphan dir */
363  fileRenameInp_t fileRenameInp;
364  bzero( &fileRenameInp, sizeof( fileRenameInp ) );
365  rstrcpy( fileRenameInp.oldFileName, phyBunDir, MAX_NAME_LEN );
366  char new_fn[ MAX_NAME_LEN ];
368  &fileRenameInp, 1, new_fn );
369 
370  if ( status >= 0 ) {
372  "unbunPhyBunFile: %s has been moved to ORPHAN_DIR.stat=%d",
373  phyBunDir, status );
374  status = rsStructFileExtract( rsComm, &structFileOprInp );
375  }
376  else {
378  "unbunPhyBunFile: renameFilePathToNewDir err for %s.stat=%d",
379  phyBunDir, status );
381  }
382  }
383  }
384  clearKeyVal( &structFileOprInp.condInput ); // JMC - backport 4632
385  if ( status < 0 ) {
387  "unbunPhyBunFile: rsStructFileExtract err for %s. status = %d",
388  objPath, status ); // JMC - backport 4657
389  }
390  free( structFileOprInp.specColl );
391 
392  return status;
393 }
394 
395 int
398  int status;
399 
400  if ( rodsServerHost == NULL ) {
402  "remoteUnbunAndRegPhyBunfile: Invalid rodsServerHost" );
404  }
405 
406  if ( ( status = svrToSvrConnect( rsComm, rodsServerHost ) ) < 0 ) {
407  return status;
408  }
409 
411 
412  return status;
413 }
414 
415 int
416 rmLinkedFilesInUnixDir( char *phyBunDir ) {
417  char subfilePath[MAX_NAME_LEN];
418  int status;
419  int linkCnt;
420 
421  path srcDirPath( phyBunDir );
422  if ( !exists( srcDirPath ) || !is_directory( srcDirPath ) ) {
423  return 0;
424  }
425 
426  directory_iterator end_itr; // default construction yields past-the-end
427  for ( directory_iterator itr( srcDirPath ); itr != end_itr; ++itr ) {
428  path p = itr->path();
429  snprintf( subfilePath, MAX_NAME_LEN, "%s",
430  p.c_str() );
431  if ( !exists( p ) ) {
432  continue;
433  }
434 
435  if ( is_regular_file( p ) ) {
436  if ( ( linkCnt = hard_link_count( p ) ) >= 2 ) {
437  /* only unlink files with multi-links */
438  unlink( subfilePath );
439  }
440  else {
442  "rmLinkedFilesInUnixDir: st_nlink of %s is only %d",
443  subfilePath, linkCnt );
444  }
445  }
446  else { /* a directory */
447  status = rmLinkedFilesInUnixDir( subfilePath );
448  if ( status < 0 ) {
449  irods::log( ERROR( status, "rmLinkedFilesInUnixDir failed" ) );
450  }
451  /* rm subfilePath but not phyBunDir */
452  rmdir( subfilePath );
453  }
454  }
455  return 0;
456 }
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
DataObjInp::objPath
char objPath[(1024+64)]
Definition: dataObjInpOut.h:66
rsStructFileExtract.hpp
NULL
#define NULL
Definition: rodsDef.h:70
rsComm_t
Definition: rcConnect.h:145
getDefDirMode
int getDefDirMode()
Definition: physPath.cpp:1070
addKeyVal
int addKeyVal(keyValPair_t *condInput, const char *keyWord, const char *value)
Definition: rcMisc.cpp:789
getFilePathName
int getFilePathName(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:87
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
unbunAndRegPhyBunfile.h
SpecColl::resource
char resource[64]
Definition: objInfo.h:83
irods_stacktrace.hpp
RM_BUN_COPY_KW
#define RM_BUN_COPY_KW
Definition: rodsKeyWdDef.h:87
PASS
#define PASS(prev_error_)
Definition: irods_error.hpp:118
BZIP2_TAR_DT_STR
#define BZIP2_TAR_DT_STR
Definition: objInfo.h:30
remoteUnbunAndRegPhyBunfile
int remoteUnbunAndRegPhyBunfile(rsComm_t *rsComm, dataObjInp_t *dataObjInp, rodsServerHost_t *rodsServerHost)
Definition: rsUnbunAndRegPhyBunfile.cpp:396
REMOTE_HOST
#define REMOTE_HOST
Definition: rodsConnect.h:45
SpecColl::phyPath
char phyPath[(1024+64)]
Definition: objInfo.h:85
irods::experimental::administration::client::v1::exists
auto exists(rcComm_t &conn, const user &user) -> bool
Definition: user_administration.cpp:359
irods::is_hier_live
error is_hier_live(const std::string &)
Definition: irods_resource_backport.cpp:234
pid_age.p
p
Definition: pid_age.py:13
rsPhyBundleColl.hpp
BUNDLE_RESC
#define BUNDLE_RESC
Definition: phyBundleColl.h:11
PRESERVE_DIR_CONT
#define PRESERVE_DIR_CONT
Definition: syncMountedColl.h:15
SpecColl::cacheDir
char cacheDir[(1024+64)]
Definition: objInfo.h:89
SpecColl::type
structFileType_t type
Definition: objInfo.h:78
DataObjInfo::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:132
renameFilePathToNewDir
int renameFilePathToNewDir(rsComm_t *rsComm, char *newDir, fileRenameInp_t *fileRenameInp, int renameFlag, char *)
Definition: physPath.cpp:652
UNIX_FILE_LINK_ERR
@ UNIX_FILE_LINK_ERR
Definition: rodsErrorTable.h:320
irods_resource_backport.hpp
SpecColl
Definition: objInfo.h:76
rsUnbunAndRegPhyBunfile.hpp
PASSMSG
#define PASSMSG(message_, prev_error_)
Definition: irods_error.hpp:119
fileRenameInp_t
Definition: fileRename.h:7
STRUCT_FILE_COLL
@ STRUCT_FILE_COLL
Definition: objInfo.h:47
rcGlobalExtern.h
DataObjInfo::filePath
char filePath[(1024+64)]
Definition: objInfo.h:137
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
DATA_TYPE_KW
#define DATA_TYPE_KW
Definition: rodsKeyWdDef.h:23
regReplica_t::condInput
keyValPair_t condInput
Definition: regReplica.h:10
rsStructFileExtract
int rsStructFileExtract(rsComm_t *rsComm, structFileOprInp_t *structFileOprInp)
Definition: rsStructFileExtract.cpp:21
regReplica_t::destDataObjInfo
dataObjInfo_t * destDataObjInfo
Definition: regReplica.h:9
DEST_RESC_NAME_KW
#define DEST_RESC_NAME_KW
Definition: rodsKeyWdDef.h:20
irods::error::code
long long code() const
Definition: irods_error.cpp:194
RESC_HIER_STR_KW
#define RESC_HIER_STR_KW
Definition: rodsKeyWdDef.h:225
rsUnbunAndRegPhyBunfile
int rsUnbunAndRegPhyBunfile(rsComm_t *rsComm, dataObjInp_t *dataObjInp)
Definition: rsUnbunAndRegPhyBunfile.cpp:28
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
freeAllDataObjInfo
int freeAllDataObjInfo(dataObjInfo_t *dataObjInfoHead)
Definition: rcMisc.cpp:561
rsRegReplica
int rsRegReplica(rsComm_t *rsComm, regReplica_t *regReplicaInp)
Definition: rsRegReplica.cpp:187
StructFileOprInp::oprType
int oprType
Definition: structFileSync.h:10
UNIX_FILE_OPENDIR_ERR
@ UNIX_FILE_OPENDIR_ERR
Definition: rodsErrorTable.h:312
DataObjInp
Definition: dataObjInpOut.h:65
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
ZIP_DT_STR
#define ZIP_DT_STR
Definition: objInfo.h:31
SYS_INVALID_SERVER_HOST
@ SYS_INVALID_SERVER_HOST
Definition: rodsErrorTable.h:89
SU_CLIENT_USER_KW
#define SU_CLIENT_USER_KW
Definition: rodsKeyWdDef.h:86
ADMIN_KW
#define ADMIN_KW
Definition: rodsKeyWdDef.h:62
svrToSvrConnect
int svrToSvrConnect(rsComm_t *rsComm, rodsServerHost_t *rodsServerHost)
Definition: miscServerFunct.cpp:106
USER_NO_RESC_INPUT_ERR
@ USER_NO_RESC_INPUT_ERR
Definition: rodsErrorTable.h:252
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
SpecColl::rescHier
char rescHier[(1024+64)]
Definition: objInfo.h:84
physPath.hpp
BUN_FILE_PATH_KW
#define BUN_FILE_PATH_KW
Definition: rodsKeyWdDef.h:29
irods::log
void log(const error &)
Definition: irods_log.cpp:13
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
getDataObjInfo
int getDataObjInfo(rsComm_t *rsComm, dataObjInp_t *dataObjInp, dataObjInfo_t **dataObjInfoHead, char *accessPerm, int ignoreCondInput)
Definition: dataObjOpr.cpp:87
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
QUERY_BY_DATA_ID_KW
#define QUERY_BY_DATA_ID_KW
Definition: rodsKeyWdDef.h:85
irods::error
Definition: irods_error.hpp:23
chkOrphanDir
int chkOrphanDir(rsComm_t *rsComm, char *dirPath, const char *rescName)
Definition: dataObjOpr.cpp:1245
miscServerFunct.hpp
regReplica_t::srcDataObjInfo
dataObjInfo_t * srcDataObjInfo
Definition: regReplica.h:8
rcUnbunAndRegPhyBunfile
int rcUnbunAndRegPhyBunfile(rcComm_t *conn, dataObjInp_t *dataObjInp)
Definition: rcUnbunAndRegPhyBunfile.cpp:23
SYS_INVALID_FILE_PATH
@ SYS_INVALID_FILE_PATH
Definition: rodsErrorTable.h:99
SpecColl::collection
char collection[(1024+64)]
Definition: objInfo.h:79
regUnbunPhySubfiles
int regUnbunPhySubfiles(rsComm_t *rsComm, const char *_resc_name, char *phyBunDir, int rmBunCopyFlag)
Definition: rsUnbunAndRegPhyBunfile.cpp:132
TAR_STRUCT_FILE_T
@ TAR_STRUCT_FILE_T
Definition: objInfo.h:55
StructFileOprInp
Definition: structFileSync.h:8
rodsServerHost
Definition: rodsConnect.h:62
DataObjInfo::rescName
char rescName[64]
Definition: objInfo.h:131
apiHeaderAll.h
rodsHostAddr_t::hostAddr
char hostAddr[256]
Definition: rodsDef.h:297
fileRenameInp_t::oldFileName
char oldFileName[(1024+64)]
Definition: fileRename.h:9
CAT_NO_ROWS_FOUND
@ CAT_NO_ROWS_FOUND
Definition: rodsErrorTable.h:423
unbunPhyBunFile
int unbunPhyBunFile(rsComm_t *rsComm, char *objPath, const char *_resc_name, char *bunFilePath, char *phyBunDir, char *dataType, int oprType, const char *resc_hier)
Definition: rsUnbunAndRegPhyBunfile.cpp:312
SYS_DIR_IN_VAULT_NOT_EMPTY
@ SYS_DIR_IN_VAULT_NOT_EMPTY
Definition: rodsErrorTable.h:149
resource.hpp
ORPHAN_DIR
#define ORPHAN_DIR
Definition: physPath.hpp:21
rsRegReplica.hpp
createPhyBundleDir
int createPhyBundleDir(rsComm_t *rsComm, char *bunFilePath, char *outPhyBundleDir, char *hier)
Definition: rsPhyBundleColl.cpp:681
GZIP_TAR_DT_STR
#define GZIP_TAR_DT_STR
Definition: objInfo.h:29
StructFileOprInp::condInput
keyValPair_t condInput
Definition: structFileSync.h:13
_rsUnbunAndRegPhyBunfile
int _rsUnbunAndRegPhyBunfile(rsComm_t *rsComm, dataObjInp_t *dataObjInp, const char *_resc_name)
Definition: rsUnbunAndRegPhyBunfile.cpp:54
DataObjInfo::objPath
char objPath[(1024+64)]
Definition: objInfo.h:130
resolveDupFilePath
int resolveDupFilePath(rsComm_t *rsComm, dataObjInfo_t *dataObjInfo, dataObjInp_t *dataObjInp)
Definition: physPath.cpp:279
UNIX_FILE_STAT_ERR
@ UNIX_FILE_STAT_ERR
Definition: rodsErrorTable.h:306
StructFileOprInp::addr
rodsHostAddr_t addr
Definition: structFileSync.h:9
rstrcpy
char * rstrcpy(char *dest, const char *src, int maxLen)
Definition: stringOpr.cpp:51
dataObjOpr.hpp
DataObjInp::condInput
keyValPair_t condInput
Definition: dataObjInpOut.h:74
irods::get_loc_for_hier_string
error get_loc_for_hier_string(const std::string &_hier, std::string &_loc)
Definition: irods_resource_backport.cpp:633
requeDataObjInfoByResc
int requeDataObjInfoByResc(dataObjInfo_t **dataObjInfoHead, const char *preferedResc, int writeFlag, int topFlag)
Definition: dataObjOpr.cpp:760
regPhySubFile
int regPhySubFile(rsComm_t *rsComm, char *subfilePath, dataObjInfo_t *bunDataObjInfo, const char *_resc_name)
Definition: rsUnbunAndRegPhyBunfile.cpp:240
regReplica_t
Definition: regReplica.h:7
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
clearKeyVal
int clearKeyVal(keyValPair_t *condInput)
Definition: rcMisc.cpp:1047
mkDirForFilePath
int mkDirForFilePath(rsComm_t *rsComm, size_t startDirLen, const std::string &filePath, const std::string &hier, int mode)
Definition: fileOpr.cpp:120
irods::error::ok
bool ok()
Definition: irods_error.cpp:258
SpecColl::objPath
char objPath[(1024+64)]
Definition: objInfo.h:80
DataObjInfo
Definition: objInfo.h:129
rmLinkedFilesInUnixDir
int rmLinkedFilesInUnixDir(char *phyBunDir)
Definition: rsUnbunAndRegPhyBunfile.cpp:416
objMetaOpr.hpp
SpecColl::collClass
specCollClass_t collClass
Definition: objInfo.h:77
resolveHost
int resolveHost(rodsHostAddr_t *addr, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:375
rodsHostAddr_t
Definition: rodsDef.h:296
StructFileOprInp::specColl
specColl_t * specColl
Definition: structFileSync.h:12