00001
00004 #ifndef __DRMS_NETWORK_H
00005 #define __DRMS_NETWORK_H
00006 #include "db.h"
00007 #include "drms_types.h"
00008
00009
00010 #define kNOLOGSUDIR "NOLOGSUDIR"
00011
00013 DRMS_Session_t *drms_connect(const char *host);
00015 DRMS_Session_t *drms_connect_direct(const char *host, const char *user,
00016 const char *passwd, const char *dbname,
00017 const char *sessionns);
00018 #ifdef DRMS_CLIENT
00019
00020 void drms_disconnect(DRMS_Env_t *env, int abort);
00022 void drms_disconnect_now(DRMS_Env_t *env, int abort);
00023 #endif
00024
00025 DB_Binary_Result_t *drms_query_bin(DRMS_Session_t *session, char *query);
00027 DB_Binary_Result_t *drms_query_binv(DRMS_Session_t *session, char *query,
00028 ...);
00030 DB_Binary_Result_t *drms_query_bin_array(DRMS_Session_t *session,
00031 char *query,
00032 int n_args, DB_Type_t *intype,
00033 void **argin);
00034
00035 DB_Binary_Result_t **drms_query_bin_ntuple(DRMS_Session_t *session, const char *stmnt, unsigned int nelems, unsigned int nargs, DB_Type_t *dbtypes, void **values);
00036
00038 DB_Text_Result_t *drms_query_txt(DRMS_Session_t *session, char *query);
00040 int drms_dms(DRMS_Session_t *session, int *row_count, char *query);
00042 int drms_dms_array(DRMS_Session_t *session, int *row_count,
00043 char *query, int n_rows, int n_args,
00044 DB_Type_t *intype, void **argin);
00046 int drms_dmsv(DRMS_Session_t *session, int *row_count, char *query,
00047 int n_rows, ...);
00049 int drms_bulk_insert_array(DRMS_Session_t *session,
00050 char *table, int n_rows, int n_args,
00051 DB_Type_t *intype, void **argin );
00053 int drms_bulk_insertv(DRMS_Session_t *session, char *table,
00054 int n_rows, int n_cols, ...);
00055
00056 int drms_getsudir(DRMS_Env_t *env, DRMS_StorageUnit_t *su, int retrieve);
00057
00058
00070 int drms_getsudirs(DRMS_Env_t *env, DRMS_StorageUnit_t **su, int num, int retrieve, int dontwait);
00071
00073 int drms_create_series_fromprototype(DRMS_Record_t **prototype,
00074 const char *outSeriesName,
00075 int perms);
00076
00077 int drms_series_hastableprivs(DRMS_Env_t *env, const char *schema, const char *table, const char *priv);
00078 int drms_series_cancreaterecord(DRMS_Env_t *env, const char *series);
00079 int drms_series_candeleterecord(DRMS_Env_t *env, const char *series);
00080 int drms_series_canupdaterecord(DRMS_Env_t *env, const char *series);
00081 int drms_query_tabexists(DRMS_Session_t *session, const char *ns, const char *tab, int *status);
00082 int drms_series_isdbowner(DRMS_Env_t *env, const char *series, int *status);
00083 int drms_client_isproduser(DRMS_Env_t *env, int *status);
00084 int drms_setretention(DRMS_Env_t *env, int16_t newRetention, int nsus, long long *sunums);
00085 int drms_makewritable(DRMS_Env_t *env);
00086
00087 #ifdef DRMS_CLIENT
00088 void drms_lock_client(DRMS_Env_t *env);
00089 void drms_unlock_client(DRMS_Env_t *env);
00090 int drms_trylock_client(DRMS_Env_t *env);
00091 sem_t *drms_client_getsdsem(void);
00092 void drms_client_initsdsem(void);
00093 void drms_client_destroysdsem(void);
00094 DRMS_Shutdown_State_t drms_client_getsd(void);
00095 void drms_client_setsd(DRMS_Shutdown_State_t st);
00096 int drms_client_registercleaner(DRMS_Env_t *env, CleanerData_t *data);
00097 void *drms_signal_thread(void *arg);
00098 #endif
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162 #define DRMS_RESERVED (0)
00163 #define DRMS_DISCONNECT (1)
00164 #define DRMS_COMMIT (2)
00165 #define DRMS_TXTQUERY (3)
00166 #define DRMS_BINQUERY (4)
00167 #define DRMS_DMS (5)
00168 #define DRMS_DMS_ARRAY (6)
00169 #define DRMS_SEQUENCE_DROP (7)
00170 #define DRMS_SEQUENCE_CREATE (8)
00171 #define DRMS_SEQUENCE_GETNEXT (9)
00172 #define DRMS_SEQUENCE_GETCURRENT (10)
00173 #define DRMS_BINQUERY_ARRAY (11)
00174 #define DRMS_NEWSLOTS (12)
00175 #define DRMS_GETUNIT (13)
00176 #define DRMS_ROLLBACK (14)
00177 #define DRMS_NEWSERIES (15)
00178 #define DRMS_DROPSERIES (16)
00179 #define DRMS_SLOT_SETSTATE (17)
00180 #define DRMS_BULK_INSERT_ARRAY (18)
00181 #define DRMS_SEQUENCE_GETLAST (19)
00182 #define DRMS_ALLOC_RECNUM (20)
00183 #define DRMS_GETTMPGUID (21)
00184 #define DRMS_GETUNITS (22)
00185 #define DRMS_GETSUDIR (23)
00186 #define DRMS_GETSUDIRS (24)
00187 #define DRMS_SITEINFO (25)
00188 #define DRMS_LOCALSITEINFO (26)
00189 #define DRMS_GETSUINFO (27)
00190 #define DRMS_GETDBUSER (28)
00191 #define DRMS_BINQUERY_NTUPLE (29)
00192 #define DRMS_SETRETENTION (30)
00193 #define DRMS_MAKESESSIONWRITABLE (31)
00194 #endif