more
This commit is contained in:
parent
0ed08405c8
commit
555c1507f2
|
@ -2,6 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
||||||
PROJECT(TDengine)
|
PROJECT(TDengine)
|
||||||
|
|
||||||
# ADD_SUBDIRECTORY(common)
|
# ADD_SUBDIRECTORY(common)
|
||||||
|
ADD_SUBDIRECTORY(wal)
|
||||||
ADD_SUBDIRECTORY(tsdb)
|
ADD_SUBDIRECTORY(tsdb)
|
||||||
# ENABLE_TESTING()
|
# ENABLE_TESTING()
|
||||||
# ADD_SUBDIRECTORY(tests)
|
# ADD_SUBDIRECTORY(tests)
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
|
||||||
PROJECT(TDengine)
|
|
||||||
|
|
||||||
IF ((TD_LINUX_64) OR (TD_LINUX_32 AND TD_ARM))
|
|
||||||
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
|
|
||||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
|
|
||||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc)
|
|
||||||
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/dnode/inc)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(inc)
|
|
||||||
AUX_SOURCE_DIRECTORY(src SRC)
|
|
||||||
ADD_LIBRARY(common ${SRC})
|
|
||||||
ENDIF ()
|
|
|
@ -1,42 +0,0 @@
|
||||||
/*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define _DEFAULT_SOURCE
|
|
||||||
#include "vnode.h"
|
|
||||||
#include "vnodeStatus.h"
|
|
||||||
|
|
||||||
int vnodeInitPeer(int numOfThreads) { return 0; }
|
|
||||||
|
|
||||||
void vnodeCleanUpPeer(int vnode) {}
|
|
||||||
|
|
||||||
int vnodeForwardToPeer(SMeterObj *pObj, char *cont, int contLen, char action, int sversion) { return 0; }
|
|
||||||
|
|
||||||
int vnodeRecoverFromPeer(SVnodeObj *pVnode, int fileId) { return -TSDB_CODE_FILE_CORRUPTED; }
|
|
||||||
|
|
||||||
void vnodeCloseAllSyncFds(int vnode) {}
|
|
||||||
|
|
||||||
void vnodeBroadcastStatusToUnsyncedPeer(SVnodeObj *pVnode) {}
|
|
||||||
|
|
||||||
int vnodeOpenPeerVnode(int vnode) {
|
|
||||||
SVnodeObj *pVnode = vnodeList + vnode;
|
|
||||||
pVnode->vnodeStatus = (pVnode->cfg.replications > 1) ? TSDB_VN_STATUS_UNSYNCED : TSDB_VN_STATUS_MASTER;
|
|
||||||
dPrint("vid:%d, status:%s numOfPeers:%d", vnode, taosGetVnodeStatusStr(pVnode->vnodeStatus), pVnode->cfg.replications - 1);
|
|
||||||
vnodeUpdateStreamRole(pVnode);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void vnodeClosePeerVnode(int vnode) {}
|
|
||||||
|
|
||||||
void vnodeConfigVPeers(int vnode, int numOfPeers, SVPeerDesc peerDesc[]) {}
|
|
|
@ -1,40 +0,0 @@
|
||||||
/* A dynamic string library
|
|
||||||
*/
|
|
||||||
#if !defined(_TD_TSTRING_H_)
|
|
||||||
#define _TD_TSTRING_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define TD_TSTRING_INIT_SIZE 16
|
|
||||||
|
|
||||||
typedef char* tstring_t;
|
|
||||||
|
|
||||||
// The string header
|
|
||||||
typedef struct {
|
|
||||||
int32_t space; // Allocated data space
|
|
||||||
char data[];
|
|
||||||
} STStrHdr;
|
|
||||||
|
|
||||||
// Get the data length of the string
|
|
||||||
#define TSTRLEN(pstr) strlen((char *)pstr)
|
|
||||||
// Get the real allocated string length
|
|
||||||
#define TSTRSPACE(pstr) (*(int32_t *)((char *)pstr - sizeof(STStrHdr)))
|
|
||||||
// Get the available space
|
|
||||||
#define TSTAVAIL(pstr) (TSTRSPACE(pstr) - TSTRLEN(pstr))
|
|
||||||
|
|
||||||
// Create an empty tstring with default size
|
|
||||||
tstring_t tdNewTString();
|
|
||||||
// Create an empty tstring with size
|
|
||||||
tstring_t tdNewTStringWithSize(uint32_t size);
|
|
||||||
// Create a tstring with a init value
|
|
||||||
tstring_t tdNewTStringWithValue(char *value);
|
|
||||||
// Create a tstring with a init value & size
|
|
||||||
tstring_t tdNewTStringWithValueSize(char *value, uint32_t size);
|
|
||||||
|
|
||||||
tstring_t tstrcat(tstring_t dest, tstring_t src);
|
|
||||||
int32_t tstrcmp(tstring_t str1, tstring_t str2);
|
|
||||||
int32_t tstrncmp(tstring_t str1, tstring_t str2, int32_t n);
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _TD_TSTRING_H_
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
AUX_SOURCE_DIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/src SRC)
|
||||||
|
|
||||||
|
ADD_LIBRARY(wal ${SRC})
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(wal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
|
|
@ -12,45 +12,16 @@
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* 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/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
#ifndef TDENGINE_VNODE_PEER_H
|
#include "vnodeWal.h"
|
||||||
#define TDENGINE_VNODEPEER_H
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
typedef struct {
|
||||||
extern "C" {
|
/* TODO */
|
||||||
#endif
|
} SWal;
|
||||||
|
|
||||||
#include <stdint.h>
|
walh *vnodeOpenWal(int vnode, uint8_t op) { return NULL; }
|
||||||
#include <stdbool.h>
|
int vnodeCloseWal(walh *pWal) { return 0; }
|
||||||
#include "taosdef.h"
|
int vnodeRenewWal(walh *pWal) { return 0; }
|
||||||
|
int vnodeWriteWal(walh *pWal, void *cont, int contLen) { return 0; }
|
||||||
/*
|
int vnodeSyncWal(walh *pWal) { return 0; }
|
||||||
* Initialize the resources
|
|
||||||
*/
|
|
||||||
int32_t vnodeInitPeers(int numOfThreads);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Free the resources
|
|
||||||
*/
|
|
||||||
void vnodeCleanUpPeers();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Start a vnode synchronization process
|
|
||||||
*/
|
|
||||||
int32_t vnodeOpenPeer(int32_t vnode);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Update the peerinfo of vnode
|
|
||||||
*/
|
|
||||||
int32_t vnodeConfigPeer(SVpeerDescArray msg);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Close a vnode synchronization process
|
|
||||||
*/
|
|
||||||
void vnodeCleanUpPeer(int32_t vnode);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif // TDENGINE_VNODEPEER_H
|
|
Loading…
Reference in New Issue