00001
00015 #ifndef _DRMS_SERIES_H
00016 #define _DRMS_SERIES_H
00017
00018 #include "drms_types.h"
00019
00020
00021
00022
00023 #define kSERIESVERSION "2.1"
00024
00025 int get_namespace(const char *seriesname, char **namespace, char **shortname);
00026
00041 int drms_series_exists(DRMS_Env_t *drmsEnv, const char *sname, int *status);
00042
00043
00044
00045
00063 char **drms_series_createrealpkeyarray(DRMS_Env_t *env,
00064 const char *seriesName,
00065 int *nPKeys,
00066 int *status);
00067
00068 char **drms_series_createpkeyarray(DRMS_Env_t *env,
00069 const char *seriesName,
00070 int *nPKeys,
00071 int *status);
00080 void drms_series_destroypkeyarray(char ***pkeys, int nElements);
00081
00082
00083
00084
00085
00105 int drms_series_checkseriescompat(DRMS_Env_t *drmsEnv,
00106 const char *series1,
00107 const char *series2,
00108 HContainer_t *matchSegs,
00109 int *status);
00110
00111
00112
00113
00129 int drms_series_checkrecordcompat(DRMS_Env_t *drmsEnv,
00130 const char *series,
00131 DRMS_Record_t *recTempl,
00132 HContainer_t *matchSegs,
00133 int *status);
00134
00135
00136
00137
00149 int drms_series_checkkeycompat(DRMS_Env_t *drmsEnv,
00150 const char *series,
00151 DRMS_Keyword_t *keys,
00152 int nKeys,
00153 int *status);
00166 int drms_series_checksegcompat(DRMS_Env_t *drmsEnv,
00167 const char *series,
00168 DRMS_Segment_t *segs,
00169 int nSegs,
00170 int *status);
00171
00172 int drms_series_isreplicated(DRMS_Env_t *env, const char *series);
00173
00174 int drms_addkeys_toseries(DRMS_Env_t *env, const char *series, const char *spec, char **sql);
00175
00176 int drms_dropkeys_fromseries(DRMS_Env_t *env, const char *series, char **keys, int nkeys);
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197 static inline const char *drms_series_getvers()
00198 {
00199 return kSERIESVERSION;
00200 }
00201
00202 int drms_series_isvers(DRMS_SeriesInfo_t *si, DRMS_SeriesVersion_t *v);
00203
00204 int GetTableOID(DRMS_Env_t *env, const char *ns, const char *table, char **oid);
00205 int GetColumnNames(DRMS_Env_t *env, const char *oid, char **colnames);
00206
00207 int drms_series_updatesummaries(DRMS_Env_t *env,
00208 const char *series,
00209 int nrows,
00210 int ncols,
00211 char **pkeynames,
00212 long long* recnums,
00213 int added);
00214
00215 #if (defined TOC && TOC)
00216 int drms_series_tocexists(DRMS_Env_t *env, int *status);
00217 int drms_series_createtoc(DRMS_Env_t *env);
00218 int drms_series_intoc(DRMS_Env_t *env, const char *series, int *status);
00219 int drms_series_insertintotoc(DRMS_Env_t *env, const char *series);
00220 #endif
00221
00222 char * drms_series_nrecords_querystringA(const char *series, int *status);
00223 char *drms_series_nrecords_querystringB(const char *series, const char *npkwhere, int *status);
00224 char *drms_series_nrecords_querystringC(const char *series, const char *pkwhere, int *status);
00225 char *drms_series_nrecords_querystringD(const char *series, const char *pkwhere, const char *npkwhere, int *status);
00226 char *drms_series_nrecords_querystringFL(DRMS_Env_t *env, const char *series, const char *npkwhere, HContainer_t *pkwhereNFL, HContainer_t *firstlast, int *status);
00227
00228 int drms_series_shadowexists(DRMS_Env_t *env, const char *series, int *status);
00229 int drms_series_createshadow(DRMS_Env_t *env, const char *series, const char *tname);
00230 int drms_series_dropshadow(DRMS_Env_t *env, const char *series, const char *tname);
00231 void drms_series_setcreateshadows(DRMS_Env_t *env, int *val);
00232 void drms_series_unsetcreateshadows(DRMS_Env_t *env);
00233 char *drms_series_all_querystringA(DRMS_Env_t *env, const char *series, const char *fields, int limit, int cursor, int *status);
00234 char *drms_series_all_querystringB(DRMS_Env_t *env, const char *series, const char *npkwhere, const char *fields, int limit, int cursor, int *status);
00235 char *drms_series_all_querystringC(DRMS_Env_t *env, const char *series, const char *pkwhere, const char *fields, int limit, int cursor, int *status);
00236 char *drms_series_all_querystringD(DRMS_Env_t *env,
00237 const char *series,
00238 const char *pkwhere,
00239 const char *npkwhere,
00240 const char *fields,
00241 int limit,
00242 int cursor,
00243 int *status);
00244 char *drms_series_all_querystringFL(DRMS_Env_t *env, const char *seriesname, const char *npkwhere, HContainer_t *pkwhereNFL, const char *fields, int limit, HContainer_t *firstlast, int *status);
00245
00246 char *drms_series_n_querystringA(DRMS_Env_t *env, const char *series, const char *fields, int nrecs, int limit, int *status);
00247 char *drms_series_n_querystringB(DRMS_Env_t *env, const char *series, const char *npkwhere, const char *fields, int nrecs, int limit, int *status);
00248 char *drms_series_n_querystringC(DRMS_Env_t *env, const char *series, const char *pkwhere, const char *fields, int nrecs, int limit, int *status);
00249 char *drms_series_n_querystringD(DRMS_Env_t *env, const char *series, const char *pkwhere, const char *npkwhere, const char *fields, int nrecs, int limit, int *status);
00250 char *drms_series_n_querystringFL(DRMS_Env_t *env, const char *series, const char *npkwhere, HContainer_t *pkwhereNFL, const char *fields, int nrecs, int limit, HContainer_t *firstlast, int *status);
00251
00252 int drms_series_summaryexists(DRMS_Env_t *env, const char *series, int *status);
00253 int drms_series_canupdatesummaries(DRMS_Env_t *env, const char *series, int *status);
00254 int drms_series_gethighestkeyrank(DRMS_Env_t *env, const char *series, int *status);
00255 int drms_series_hastemptab(const char *query);
00256
00257 char *drms_series_createPkeyList(DRMS_Env_t *env, const char *series, const char *prefix, const char *suffix, char *pkeyarr[], int *npkey, int *status);
00258 char *drms_series_createPkeyColList(DRMS_Env_t *env, const char *series, const char *prefix, const char *suffix, char *pkeyarr[], int *npkey, int *status);
00259
00260 int16_t drms_series_getstagingretention(DRMS_SeriesInfo_t *si);
00261 int16_t drms_series_getnewsuretention(DRMS_SeriesInfo_t *si);
00262 #endif