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)  

rsGeneralRowPurge.cpp
Go to the documentation of this file.
1 
3 /* This is script-generated code (for the most part). */
4 /* See generalRowPurge.h for a description of this API call.*/
5 
6 #include "generalRowPurge.h"
8 #include "miscServerFunct.hpp"
10 #include "rsGeneralRowPurge.hpp"
11 
12 int
13 rsGeneralRowPurge( rsComm_t *rsComm, generalRowPurgeInp_t *generalRowPurgeInp ) {
15  int status;
16 
17  rodsLog( LOG_DEBUG, "generalRowPurge" );
18 
19  status = getAndConnRcatHost( rsComm, MASTER_RCAT, ( const char* )NULL, &rodsServerHost );
20  if ( status < 0 ) {
21  return status;
22  }
23 
25 
26  std::string svc_role;
27  if( irods::CFG_SERVICE_ROLE_PROVIDER == svc_role ) {
28  status = _rsGeneralRowPurge( rsComm, generalRowPurgeInp );
29  } else if( irods::CFG_SERVICE_ROLE_CONSUMER == svc_role ) {
31  } else {
32  rodsLog(
33  LOG_ERROR,
34  "role not supported [%s]",
35  svc_role.c_str() );
37  }
38  }
39  else {
41  generalRowPurgeInp );
42  }
43 
44  if ( status < 0 ) {
46  "rsGeneralRowPurge: rcGeneralRowPurge failed" );
47  }
48  return status;
49 }
50 
51 int
52 _rsGeneralRowPurge( rsComm_t *rsComm, generalRowPurgeInp_t *generalRowPurgeInp ) {
53  int status;
54 
56  "_rsGeneralRowPurge tableName=%s",
57  generalRowPurgeInp->tableName );
58 
59  if ( strcmp( generalRowPurgeInp->tableName, "serverload" ) == 0 ) {
60  status = chlPurgeServerLoad( rsComm,
61  generalRowPurgeInp->secondsAgo );
62  return status;
63  }
64  if ( strcmp( generalRowPurgeInp->tableName, "serverloaddigest" ) == 0 ) {
66  generalRowPurgeInp->secondsAgo );
67  return status;
68  }
69  return CAT_INVALID_ARGUMENT;
70 }
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
irods::CFG_SERVICE_ROLE_CONSUMER
const std::string CFG_SERVICE_ROLE_CONSUMER("consumer")
irods_configuration_keywords.hpp
generalRowPurgeInp_t::secondsAgo
char * secondsAgo
Definition: generalRowPurge.h:8
rodsServerHost::localFlag
int localFlag
Definition: rodsConnect.h:68
SYS_SERVICE_ROLE_NOT_SUPPORTED
@ SYS_SERVICE_ROLE_NOT_SUPPORTED
Definition: rodsErrorTable.h:217
generalRowPurgeInp_t::tableName
char * tableName
Definition: generalRowPurge.h:7
rodsServerHost::conn
rcComm_t * conn
Definition: rodsConnect.h:64
generalRowPurge.h
LOCAL_HOST
#define LOCAL_HOST
Definition: rodsConnect.h:44
rsGeneralRowPurge.hpp
rsGeneralRowPurge
int rsGeneralRowPurge(rsComm_t *rsComm, generalRowPurgeInp_t *generalRowPurgeInp)
Definition: rsGeneralRowPurge.cpp:13
LOG_ERROR
#define LOG_ERROR
Definition: rodsLog.h:43
LOG_DEBUG
#define LOG_DEBUG
Definition: rodsLog.h:23
irods::CFG_SERVICE_ROLE_PROVIDER
const std::string CFG_SERVICE_ROLE_PROVIDER("provider")
generalRowPurgeInp_t
Definition: generalRowPurge.h:6
SYS_NO_RCAT_SERVER_ERR
@ SYS_NO_RCAT_SERVER_ERR
Definition: rodsErrorTable.h:110
chlPurgeServerLoad
int chlPurgeServerLoad(rsComm_t *rsComm, const char *secondsAgo)
Definition: icatHighLevelRoutines.cpp:3267
irods.pypyodbc.status
status
Definition: pypyodbc.py:467
LOG_NOTICE
#define LOG_NOTICE
Definition: rodsLog.h:33
_rsGeneralRowPurge
int _rsGeneralRowPurge(rsComm_t *rsComm, generalRowPurgeInp_t *generalRowPurgeInp)
Definition: rsGeneralRowPurge.cpp:52
miscServerFunct.hpp
getAndConnRcatHost
int getAndConnRcatHost(rsComm_t *rsComm, int rcatType, const char *rcatZoneHint, rodsServerHost_t **rodsServerHost)
Definition: rodsConnect.cpp:26
chlPurgeServerLoadDigest
int chlPurgeServerLoadDigest(rsComm_t *rsComm, const char *secondsAgo)
Definition: icatHighLevelRoutines.cpp:3375
MASTER_RCAT
#define MASTER_RCAT
Definition: rodsDef.h:85
rodsServerHost
Definition: rodsConnect.h:62
rcGeneralRowPurge
int rcGeneralRowPurge(rcComm_t *conn, generalRowPurgeInp_t *generalRowPurgeInp)
Definition: rcGeneralRowPurge.cpp:36
icatHighLevelRoutines.hpp
CAT_INVALID_ARGUMENT
@ CAT_INVALID_ARGUMENT
Definition: rodsErrorTable.h:431