tqMetaStore.h 1.8 KB
Newer Older
L
Liu Jicong 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
/*
 * 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/>.
 */

#ifndef _TQ_META_STORE_H_
#define _TQ_META_STORE_H_

#include "os.h"
L
Liu Jicong 已提交
20
#include "tqInt.h"
L
Liu Jicong 已提交
21 22 23 24 25

#ifdef __cplusplus
extern "C" {
#endif

L
Liu Jicong 已提交
26 27
STqMetaStore* tqStoreOpen(STQ* pTq, const char* path, FTqSerialize pSerializer, FTqDeserialize pDeserializer,
                          FTqDelete pDeleter, int32_t tqConfigFlag);
L
Liu Jicong 已提交
28
int32_t       tqStoreClose(STqMetaStore*);
L
Liu Jicong 已提交
29 30 31 32 33 34 35 36
// int32_t       tqStoreDelete(TqMetaStore*);
// int32_t       tqStoreCommitAll(TqMetaStore*);
int32_t tqStorePersist(STqMetaStore*);
// clean deleted idx and data from persistent file
int32_t tqStoreCompact(STqMetaStore*);

void* tqHandleGet(STqMetaStore*, int64_t key);
// make it unpersist
L
Liu Jicong 已提交
37 38 39
void*   tqHandleTouchGet(STqMetaStore*, int64_t key);
int32_t tqHandleMovePut(STqMetaStore*, int64_t key, void* value);
int32_t tqHandleCopyPut(STqMetaStore*, int64_t key, void* value, size_t vsize);
L
Liu Jicong 已提交
40 41
// delete committed kv pair
// notice that a delete action still needs to be committed
L
Liu Jicong 已提交
42
int32_t tqHandleDel(STqMetaStore*, int64_t key);
L
Liu Jicong 已提交
43
int32_t tqHandlePurge(STqMetaStore*, int64_t key);
L
Liu Jicong 已提交
44 45
int32_t tqHandleCommit(STqMetaStore*, int64_t key);
int32_t tqHandleAbort(STqMetaStore*, int64_t key);
L
Liu Jicong 已提交
46 47 48 49 50 51

#ifdef __cplusplus
}
#endif

#endif /* ifndef _TQ_META_STORE_H_ */