change compress
This commit is contained in:
parent
697ca8914e
commit
a247a43863
|
@ -127,7 +127,7 @@ bool tsEnableTelem = true;
|
||||||
int32_t tsTelemInterval = 43200;
|
int32_t tsTelemInterval = 43200;
|
||||||
char tsTelemServer[TSDB_FQDN_LEN] = "telemetry.tdengine.com";
|
char tsTelemServer[TSDB_FQDN_LEN] = "telemetry.tdengine.com";
|
||||||
uint16_t tsTelemPort = 80;
|
uint16_t tsTelemPort = 80;
|
||||||
char * tsTelemUri = "/report";
|
char *tsTelemUri = "/report";
|
||||||
|
|
||||||
#ifdef TD_ENTERPRISE
|
#ifdef TD_ENTERPRISE
|
||||||
bool tsEnableCrashReport = false;
|
bool tsEnableCrashReport = false;
|
||||||
|
@ -1452,7 +1452,7 @@ void taosCleanupCfg() {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
const char *optionName;
|
const char *optionName;
|
||||||
void * optionVar;
|
void *optionVar;
|
||||||
} OptionNameAndVar;
|
} OptionNameAndVar;
|
||||||
|
|
||||||
static int32_t taosCfgSetOption(OptionNameAndVar *pOptions, int32_t optionSize, SConfigItem *pItem, bool isDebugflag) {
|
static int32_t taosCfgSetOption(OptionNameAndVar *pOptions, int32_t optionSize, SConfigItem *pItem, bool isDebugflag) {
|
||||||
|
@ -1465,7 +1465,7 @@ static int32_t taosCfgSetOption(OptionNameAndVar *pOptions, int32_t optionSize,
|
||||||
switch (pItem->dtype) {
|
switch (pItem->dtype) {
|
||||||
case CFG_DTYPE_BOOL: {
|
case CFG_DTYPE_BOOL: {
|
||||||
int32_t flag = pItem->i32;
|
int32_t flag = pItem->i32;
|
||||||
bool * pVar = pOptions[d].optionVar;
|
bool *pVar = pOptions[d].optionVar;
|
||||||
uInfo("%s set from %d to %d", optName, *pVar, flag);
|
uInfo("%s set from %d to %d", optName, *pVar, flag);
|
||||||
*pVar = flag;
|
*pVar = flag;
|
||||||
terrno = TSDB_CODE_SUCCESS;
|
terrno = TSDB_CODE_SUCCESS;
|
||||||
|
@ -1863,7 +1863,7 @@ static void taosSetAllDebugFlag(SConfig *pCfg, int32_t flag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SArray * noNeedToSetVars = NULL;
|
SArray *noNeedToSetVars = NULL;
|
||||||
SConfigItem *pItem = cfgGetItem(pCfg, "debugFlag");
|
SConfigItem *pItem = cfgGetItem(pCfg, "debugFlag");
|
||||||
if (pItem != NULL) {
|
if (pItem != NULL) {
|
||||||
pItem->i32 = flag;
|
pItem->i32 = flag;
|
||||||
|
|
|
@ -42,7 +42,6 @@ int32_t buildQueryAfterParse(SQuery** pQuery, SNode* pRootNode, int16_t placehol
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t parse(SParseContext* pParseCxt, SQuery** pQuery) {
|
int32_t parse(SParseContext* pParseCxt, SQuery** pQuery) {
|
||||||
SAstCreateContext cxt;
|
SAstCreateContext cxt;
|
||||||
initAstCreateContext(pParseCxt, &cxt);
|
initAstCreateContext(pParseCxt, &cxt);
|
||||||
|
@ -631,8 +630,8 @@ static int32_t collectMetaKeyFromShowCompacts(SCollectMetaKeyCxt* pCxt, SShowStm
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t collectMetaKeyFromShowCompactDetails(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) {
|
static int32_t collectMetaKeyFromShowCompactDetails(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) {
|
||||||
int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB, TSDB_INS_TABLE_COMPACT_DETAILS,
|
int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_INFORMATION_SCHEMA_DB,
|
||||||
pCxt->pMetaCache);
|
TSDB_INS_TABLE_COMPACT_DETAILS, pCxt->pMetaCache);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -687,7 +686,7 @@ static int32_t collectMetaKeyFromShowCreateView(SCollectMetaKeyCxt* pCxt, SShowC
|
||||||
int32_t code = catalogRemoveViewMeta(pCxt->pParseCxt->pCatalog, dbFName, 0, pStmt->viewName, 0);
|
int32_t code = catalogRemoveViewMeta(pCxt->pParseCxt->pCatalog, dbFName, 0, pStmt->viewName, 0);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->viewName,
|
code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->viewName,
|
||||||
AUTH_TYPE_READ, pCxt->pMetaCache);
|
AUTH_TYPE_READ, pCxt->pMetaCache);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache);
|
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache);
|
||||||
|
@ -696,7 +695,6 @@ static int32_t collectMetaKeyFromShowCreateView(SCollectMetaKeyCxt* pCxt, SShowC
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int32_t collectMetaKeyFromShowApps(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) {
|
static int32_t collectMetaKeyFromShowApps(SCollectMetaKeyCxt* pCxt, SShowStmt* pStmt) {
|
||||||
return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_PERFORMANCE_SCHEMA_DB, TSDB_PERFS_TABLE_APPS,
|
return reserveTableMetaInCache(pCxt->pParseCxt->acctId, TSDB_PERFORMANCE_SCHEMA_DB, TSDB_PERFS_TABLE_APPS,
|
||||||
pCxt->pMetaCache);
|
pCxt->pMetaCache);
|
||||||
|
@ -755,24 +753,22 @@ static int32_t collectMetaKeyFromRevoke(SCollectMetaKeyCxt* pCxt, SRevokeStmt* p
|
||||||
return reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->objName, pStmt->tabName, pCxt->pMetaCache);
|
return reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->objName, pStmt->tabName, pCxt->pMetaCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int32_t collectMetaKeyFromCreateViewStmt(SCollectMetaKeyCxt* pCxt, SCreateViewStmt* pStmt) {
|
static int32_t collectMetaKeyFromCreateViewStmt(SCollectMetaKeyCxt* pCxt, SCreateViewStmt* pStmt) {
|
||||||
int32_t code =
|
int32_t code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache);
|
||||||
reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->viewName, pCxt->pMetaCache);
|
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, NULL, AUTH_TYPE_WRITE,
|
code = reserveUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, NULL, AUTH_TYPE_WRITE,
|
||||||
pCxt->pMetaCache);
|
pCxt->pMetaCache);
|
||||||
}
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->viewName, AUTH_TYPE_ALTER,
|
code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->viewName,
|
||||||
pCxt->pMetaCache);
|
AUTH_TYPE_ALTER, pCxt->pMetaCache);
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t collectMetaKeyFromDropViewStmt(SCollectMetaKeyCxt* pCxt, SDropViewStmt* pStmt) {
|
static int32_t collectMetaKeyFromDropViewStmt(SCollectMetaKeyCxt* pCxt, SDropViewStmt* pStmt) {
|
||||||
int32_t code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName, pStmt->viewName, AUTH_TYPE_ALTER,
|
int32_t code = reserveViewUserAuthInCache(pCxt->pParseCxt->acctId, pCxt->pParseCxt->pUser, pStmt->dbName,
|
||||||
pCxt->pMetaCache);
|
pStmt->viewName, AUTH_TYPE_ALTER, pCxt->pMetaCache);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -783,7 +779,7 @@ static int32_t collectMetaKeyFromCreateTSMAStmt(SCollectMetaKeyCxt* pCxt, SCreat
|
||||||
code = reserveTSMAInfoInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache);
|
code = reserveTSMAInfoInCache(pCxt->pParseCxt->acctId, pStmt->dbName, pStmt->tableName, pCxt->pMetaCache);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
char dstTbName[TSDB_TABLE_NAME_LEN] = {0};
|
char dstTbName[TSDB_TABLE_NAME_LEN] = {0};
|
||||||
snprintf(dstTbName, TSDB_TABLE_NAME_LEN, "%s"TSMA_RES_STB_POSTFIX, pStmt->tableName);
|
snprintf(dstTbName, TSDB_TABLE_NAME_LEN, "%s" TSMA_RES_STB_POSTFIX, pStmt->tableName);
|
||||||
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, dstTbName, pCxt->pMetaCache);
|
code = reserveTableMetaInCache(pCxt->pParseCxt->acctId, pStmt->dbName, dstTbName, pCxt->pMetaCache);
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pStmt->dbName, dstTbName, pCxt->pMetaCache);
|
code = reserveTableVgroupInCache(pCxt->pParseCxt->acctId, pStmt->dbName, dstTbName, pCxt->pMetaCache);
|
||||||
|
@ -921,7 +917,7 @@ static int32_t collectMetaKeyFromQuery(SCollectMetaKeyCxt* pCxt, SNode* pStmt) {
|
||||||
case QUERY_NODE_SHOW_COMPACTS_STMT:
|
case QUERY_NODE_SHOW_COMPACTS_STMT:
|
||||||
return collectMetaKeyFromShowCompacts(pCxt, (SShowStmt*)pStmt);
|
return collectMetaKeyFromShowCompacts(pCxt, (SShowStmt*)pStmt);
|
||||||
case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT:
|
case QUERY_NODE_SHOW_COMPACT_DETAILS_STMT:
|
||||||
return collectMetaKeyFromShowCompactDetails(pCxt, (SShowStmt*)pStmt);
|
return collectMetaKeyFromShowCompactDetails(pCxt, (SShowStmt*)pStmt);
|
||||||
case QUERY_NODE_SHOW_GRANTS_FULL_STMT:
|
case QUERY_NODE_SHOW_GRANTS_FULL_STMT:
|
||||||
return collectMetaKeyFromShowGrantsFull(pCxt, (SShowStmt*)pStmt);
|
return collectMetaKeyFromShowGrantsFull(pCxt, (SShowStmt*)pStmt);
|
||||||
case QUERY_NODE_SHOW_GRANTS_LOGS_STMT:
|
case QUERY_NODE_SHOW_GRANTS_LOGS_STMT:
|
||||||
|
|
|
@ -347,8 +347,8 @@ int32_t tsCompressINTImp(const char *const input, const int32_t nelements, char
|
||||||
char bit_per_integer[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 30, 60};
|
char bit_per_integer[] = {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 15, 20, 30, 60};
|
||||||
int32_t selector_to_elems[] = {240, 120, 60, 30, 20, 15, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1};
|
int32_t selector_to_elems[] = {240, 120, 60, 30, 20, 15, 12, 10, 8, 7, 6, 5, 4, 3, 2, 1};
|
||||||
char bit_to_selector[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13,
|
char bit_to_selector[] = {0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13,
|
||||||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
|
||||||
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15};
|
15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15};
|
||||||
|
|
||||||
// get the byte limit.
|
// get the byte limit.
|
||||||
int32_t word_length = getWordLength(type);
|
int32_t word_length = getWordLength(type);
|
||||||
|
@ -1070,7 +1070,7 @@ void encodeFloatValue(uint32_t diff, uint8_t flag, char *const output, int32_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t tsCompressFloatImp(const char *const input, const int32_t nelements, char *const output) {
|
int32_t tsCompressFloatImp(const char *const input, const int32_t nelements, char *const output) {
|
||||||
float * istream = (float *)input;
|
float *istream = (float *)input;
|
||||||
int32_t byte_limit = nelements * FLOAT_BYTES + 1;
|
int32_t byte_limit = nelements * FLOAT_BYTES + 1;
|
||||||
int32_t opos = 1;
|
int32_t opos = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue