fix: rename global variables
This commit is contained in:
parent
f2d6ed8635
commit
d4d329ecce
|
@ -16,9 +16,9 @@
|
||||||
#define _DEFAULT_SOURCE
|
#define _DEFAULT_SOURCE
|
||||||
#include "dmMgmt.h"
|
#include "dmMgmt.h"
|
||||||
|
|
||||||
static SDnode global = {0};
|
static SDnode globalDnode = {0};
|
||||||
|
|
||||||
SDnode *dmInstance() { return &global; }
|
SDnode *dmInstance() { return &globalDnode; }
|
||||||
|
|
||||||
static int32_t dmCheckRepeatInit(SDnode *pDnode) {
|
static int32_t dmCheckRepeatInit(SDnode *pDnode) {
|
||||||
if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) {
|
if (atomic_val_compare_exchange_8(&pDnode->once, DND_ENV_INIT, DND_ENV_READY) != DND_ENV_INIT) {
|
||||||
|
@ -270,6 +270,6 @@ void dmReportStartup(const char *pName, const char *pDesc) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t dmGetClusterId() {
|
int64_t dmGetClusterId() {
|
||||||
return global.data.clusterId;
|
return globalDnode.data.clusterId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,8 +37,6 @@ typedef struct SRaftStore {
|
||||||
SRaftStore *raftStoreOpen(const char *path);
|
SRaftStore *raftStoreOpen(const char *path);
|
||||||
int32_t raftStoreClose(SRaftStore *pRaftStore);
|
int32_t raftStoreClose(SRaftStore *pRaftStore);
|
||||||
int32_t raftStorePersist(SRaftStore *pRaftStore);
|
int32_t raftStorePersist(SRaftStore *pRaftStore);
|
||||||
int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len);
|
|
||||||
int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len);
|
|
||||||
|
|
||||||
bool raftStoreHasVoted(SRaftStore *pRaftStore);
|
bool raftStoreHasVoted(SRaftStore *pRaftStore);
|
||||||
void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId);
|
void raftStoreVote(SRaftStore *pRaftStore, SRaftId *pRaftId);
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
// private function
|
// private function
|
||||||
static int32_t raftStoreInit(SRaftStore *pRaftStore);
|
static int32_t raftStoreInit(SRaftStore *pRaftStore);
|
||||||
static bool raftStoreFileExist(char *path);
|
static bool raftStoreFileExist(char *path);
|
||||||
|
static int32_t raftStoreSerialize(SRaftStore *pRaftStore, char *buf, size_t len);
|
||||||
|
static int32_t raftStoreDeserialize(SRaftStore *pRaftStore, char *buf, size_t len);
|
||||||
|
|
||||||
// public function
|
// public function
|
||||||
SRaftStore *raftStoreOpen(const char *path) {
|
SRaftStore *raftStoreOpen(const char *path) {
|
||||||
|
|
Loading…
Reference in New Issue