vnd/clusterId: new interface to get cluster id for vnode
This commit is contained in:
parent
d2ae4a6e26
commit
60ef86da6d
|
@ -133,6 +133,7 @@ int32_t vnodeAsyncCommit(SVnode* pVnode);
|
|||
bool vnodeShouldRollback(SVnode* pVnode);
|
||||
|
||||
// vnodeSync.c
|
||||
int64_t vnodeClusterId(SVnode* pVnode);
|
||||
int32_t vnodeNodeId(SVnode* pVnode);
|
||||
int32_t vnodeSyncOpen(SVnode* pVnode, char* path, int32_t vnodeVersion);
|
||||
int32_t vnodeSyncStart(SVnode* pVnode);
|
||||
|
|
|
@ -811,6 +811,11 @@ bool vnodeIsLeader(SVnode *pVnode) {
|
|||
return true;
|
||||
}
|
||||
|
||||
int64_t vnodeClusterId(SVnode *pVnode) {
|
||||
SSyncCfg *syncCfg = &pVnode->config.syncCfg;
|
||||
return syncCfg->nodeInfo[syncCfg->myIndex].clusterId;
|
||||
}
|
||||
|
||||
int32_t vnodeNodeId(SVnode *pVnode) {
|
||||
SSyncCfg *syncCfg = &pVnode->config.syncCfg;
|
||||
return syncCfg->nodeInfo[syncCfg->myIndex].nodeId;
|
||||
|
|
Loading…
Reference in New Issue