TDengine/source/dnode/mnode/impl/inc/mndGrant.h

55 lines
2 KiB
C
Raw Normal View History

2022-04-10 11:08:16 +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/>.
*/
2024-01-18 07:23:38 +00:00
#ifndef _TD_MND_GRANT_H_
#define _TD_MND_GRANT_H_
2022-04-10 11:08:16 +00:00
#ifdef __cplusplus
"C" {
#endif
#include "mndInt.h"
2022-10-13 03:56:16 +00:00
int32_t mndInitGrant(SMnode * pMnode);
2024-01-31 02:43:31 +00:00
void mndCleanupGrant();
2022-10-13 03:56:16 +00:00
void grantParseParameter();
void grantReset(SMnode * pMnode, EGrantType grant, uint64_t value);
void grantAdd(EGrantType grant, uint64_t value);
void grantRestore(EGrantType grant, uint64_t value);
2022-04-10 11:08:16 +00:00
2024-01-18 07:23:38 +00:00
#ifdef TD_ENTERPRISE
2024-01-31 01:47:10 +00:00
SSdbRaw *mndGrantActionEncode(SGrantLogObj * pGrant);
2024-01-18 07:23:38 +00:00
SSdbRow *mndGrantActionDecode(SSdbRaw * pRaw);
2024-01-31 01:47:10 +00:00
int32_t mndGrantActionInsert(SSdb * pSdb, SGrantLogObj * pGrant);
int32_t mndGrantActionDelete(SSdb * pSdb, SGrantLogObj * pGrant);
int32_t mndGrantActionUpdate(SSdb * pSdb, SGrantLogObj * pOldGrant, SGrantLogObj * pNewGrant);
2024-01-18 07:23:38 +00:00
2024-01-31 01:47:10 +00:00
int32_t grantAlterActiveCode(SMnode * pMnode, SGrantLogObj * pObj, const char *oldActive, const char *newActive,
2024-01-30 16:40:47 +00:00
char **mergeActive);
2024-01-18 09:49:11 +00:00
2024-02-04 10:00:02 +00:00
int32_t mndProcessConfigGrantReq(SMnode * pMnode, SRpcMsg * pReq, SMCfgClusterReq * pCfg);
int32_t mndProcessUpdGrantLog(SMnode * pMnode, SRpcMsg * pReq, SArray * pMachines, SGrantState * pState);
2024-01-31 01:47:10 +00:00
int32_t mndGrantGetLastState(SMnode * pMnode, SGrantState * pState);
SGrantLogObj *mndAcquireGrant(SMnode * pMnode, void **ppIter);
void mndReleaseGrant(SMnode * pMnode, SGrantLogObj * pGrant, void *pIter);
2024-01-18 07:23:38 +00:00
#endif
2022-04-10 11:08:16 +00:00
#ifdef __cplusplus
}
#endif
#endif