TDengine/include/dnode/vnode/tsdb/tsdb.h

52 lines
1.3 KiB
C
Raw Normal View History

2021-09-22 05:21:07 +00:00
/*
* 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/>.
*/
2021-09-22 07:31:07 +00:00
#ifndef _TD_TSDB_H_
#define _TD_TSDB_H_
2021-09-22 05:21:07 +00:00
2021-12-16 07:24:33 +00:00
#include "mallocator.h"
2021-09-22 05:21:07 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2021-11-03 03:13:17 +00:00
// TYPES EXPOSED
2021-12-17 08:47:30 +00:00
typedef struct STsdb STsdb;
typedef struct STsdbCfg {
uint64_t lruCacheSize;
uint32_t keep0;
uint32_t keep1;
uint32_t keep2;
} STsdbCfg;
2021-10-08 02:38:22 +00:00
2021-11-03 03:13:17 +00:00
// STsdb
2021-12-16 07:24:33 +00:00
STsdb *tsdbOpen(const char *path, const STsdbCfg *pTsdbCfg, SMemAllocatorFactory *pMAF);
2021-10-08 02:38:22 +00:00
void tsdbClose(STsdb *);
2021-11-03 03:13:17 +00:00
void tsdbRemove(const char *path);
2021-12-15 06:48:47 +00:00
int tsdbInsertData(STsdb *pTsdb, SSubmitMsg *pMsg);
2021-12-17 08:47:30 +00:00
int tsdbPrepareCommit(STsdb *pTsdb);
int tsdbCommit(STsdb *pTsdb);
2021-10-08 02:38:22 +00:00
2021-11-24 08:29:02 +00:00
// STsdbCfg
int tsdbOptionsInit(STsdbCfg *);
void tsdbOptionsClear(STsdbCfg *);
2021-09-26 02:44:50 +00:00
2021-09-22 05:21:07 +00:00
#ifdef __cplusplus
}
#endif
2021-10-08 05:35:55 +00:00
#endif /*_TD_TSDB_H_*/