taosdef.h 2.8 KB
Newer Older
H
Haojun Liao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

16 17
#ifndef _TD_COMMON_TAOS_DEF_H_
#define _TD_COMMON_TAOS_DEF_H_
H
Haojun Liao 已提交
18

S
Shengliang Guan 已提交
19 20 21
#include "taos.h"
#include "tdef.h"

H
Haojun Liao 已提交
22 23 24 25
#ifdef __cplusplus
extern "C" {
#endif

L
Liu Jicong 已提交
26
typedef int64_t tb_uid_t;
H
more  
Hongze Cheng 已提交
27

S
Shengliang Guan 已提交
28 29
#define TSWINDOW_INITIALIZER       ((STimeWindow){INT64_MIN, INT64_MAX})
#define TSWINDOW_DESC_INITIALIZER  ((STimeWindow){INT64_MAX, INT64_MIN})
H
Haojun Liao 已提交
30
#define IS_TSWINDOW_SPECIFIED(win) (((win).skey != INT64_MIN) || ((win).ekey != INT64_MAX))
X
Xiaoyu Wang 已提交
31
#define TSWINDOW_IS_EQUAL(t1, t2)  (((t1).skey == (t2).skey) && ((t1).ekey == (t2).ekey))
H
Haojun Liao 已提交
32

33 34 35 36 37
//define show cluster alive and show db.alive
#define SHOW_STATUS_NOT_AVAILABLE  0
#define SHOW_STATUS_AVAILABLE      1
#define SHOW_STATUS_HALF_AVAILABLE 2

H
Haojun Liao 已提交
38
typedef enum {
X
Xiaoyu Wang 已提交
39 40 41
  TSDB_SUPER_TABLE = 1,   // super table
  TSDB_CHILD_TABLE = 2,   // table created from super table
  TSDB_NORMAL_TABLE = 3,  // ordinary table
L
Liu Jicong 已提交
42 43 44 45
  TSDB_TEMP_TABLE = 4,    // temp table created by nest query
  TSDB_SYSTEM_TABLE = 5,
  TSDB_TSMA_TABLE = 6,  // time-range-wise sma
  TSDB_TABLE_MAX = 7
H
Haojun Liao 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59
} ETableType;

typedef enum {
  TSDB_CHECK_ITEM_NETWORK,
  TSDB_CHECK_ITEM_MEM,
  TSDB_CHECK_ITEM_CPU,
  TSDB_CHECK_ITEM_DISK,
  TSDB_CHECK_ITEM_OS,
  TSDB_CHECK_ITEM_ACCESS,
  TSDB_CHECK_ITEM_VERSION,
  TSDB_CHECK_ITEM_DATAFILE,
  TSDB_CHECK_ITEM_MAX
} ECheckItemType;

L
Liu Jicong 已提交
60 61 62 63 64 65
typedef enum {
  TD_ROW_DISCARD_UPDATE = 0,
  TD_ROW_OVERWRITE_UPDATE = 1,
  TD_ROW_PARTIAL_UPDATE = 2,
} TDUpdateConfig;

C
Cary Xu 已提交
66 67
#define TD_SUPPORT_UPDATE(u) ((u) > 0)

68 69 70 71
typedef enum {
  TSDB_STATIS_OK = 0,    // statis part exist and load successfully
  TSDB_STATIS_NONE = 1,  // statis part not exist
} ETsdbStatisStatus;
H
Haojun Liao 已提交
72

C
Cary Xu 已提交
73 74 75 76 77 78
typedef enum {
  TSDB_SMA_TYPE_BLOCK = 0,       // Block-wise SMA
  TSDB_SMA_TYPE_TIME_RANGE = 1,  // Time-range-wise SMA
  TSDB_SMA_TYPE_ROLLUP = 2,      // Rollup SMA
} ETsdbSmaType;

C
Cary Xu 已提交
79
typedef enum {
C
Cary Xu 已提交
80 81 82 83 84
  TSDB_RETENTION_L0 = 0,
  TSDB_RETENTION_L1 = 1,
  TSDB_RETENTION_L2 = 2,
  TSDB_RETENTION_MAX = 3
} ERetentionLevel;
C
Cary Xu 已提交
85

86 87 88 89 90
typedef enum {
  TSDB_BITMODE_DEFAULT = 0,  // 2 bits
  TSDB_BITMODE_ONE_BIT = 1,  // 1 bit
} EBitmapMode;

S
Shengliang Guan 已提交
91
extern char *qtypeStr[];
H
Hui Li 已提交
92

X
Xiaoyu Wang 已提交
93
#define TSDB_PORT_HTTP 11
94

C
Cary Xu 已提交
95
#undef TD_DEBUG_PRINT_ROW
C
Cary Xu 已提交
96
#undef TD_DEBUG_PRINT_TSDB_LOAD_DCOLS
97
#undef TD_DEBUG_PRINT_TAG
C
Cary Xu 已提交
98

H
Haojun Liao 已提交
99 100 101 102
#ifdef __cplusplus
}
#endif

103
#endif /*_TD_COMMON_TAOS_DEF_H_*/