From 4d6faa8f13ad49c610ba842b59e4558ec6a0efd8 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Thu, 21 Nov 2024 16:09:55 +0800 Subject: [PATCH] enh: (TD-29367-2) add a new meta handle function called `metaHandleEntry2` --- source/dnode/vnode/src/meta/metaEntry2.c | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 source/dnode/vnode/src/meta/metaEntry2.c diff --git a/source/dnode/vnode/src/meta/metaEntry2.c b/source/dnode/vnode/src/meta/metaEntry2.c new file mode 100644 index 0000000000..dbdc10a94a --- /dev/null +++ b/source/dnode/vnode/src/meta/metaEntry2.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2023 Hongze Cheng . + * All rights reserved. + * + * This code is the intellectual property of Hongze Cheng. + * Any reproduction or distribution, in whole or in part, + * without the express written permission of Hongze Cheng is + * strictly prohibited. + */ + +#include "meta.h" + +#define metaErrLog(ERRNO) metaError("%s failed at %s:%d since %s", __func__, __FILE__, __LINE__, tstrerror(ERRNO)); + +static int32_t metaHandleEntryDrop(SMeta *pMeta, const SMetaEntry *pEntry) { + int32_t code = TSDB_CODE_SUCCESS; + + // TODO + + return code; +} + +static int32_t metaHandleEntryUpsert(SMeta *pMeta, const SMetaEntry *pEntry) { + int32_t code = TSDB_CODE_SUCCESS; + + // TODO + + return code; +} + +int32_t metaHandleEntry2(SMeta *pMeta, const SMetaEntry *pEntry) { + int32_t code = TSDB_CODE_SUCCESS; + + if (pMeta == NULL || pEntry == NULL) { + metaErrLog(TSDB_CODE_INVALID_PARA); + return TSDB_CODE_INVALID_PARA; + } + + if (pEntry->type < 0) { + code = metaHandleEntryDrop(pMeta, pEntry); + } else { + code = metaHandleEntryUpsert(pMeta, pEntry); + } + return code; + ; +} \ No newline at end of file