当前位置:网站首页>[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (II)
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (II)
2022-06-13 11:49:00 【InfoQ】
【TcaplusDB The knowledge base 】TcaplusDB-tcapulogmgr Tool is introduced ( Two )
4. updatefields
- --directory ulog File directory
- --engine-directory Cold standby file directory
- --tbusid Indicates that you want to perform a fileback operation and dynamically change the table structure svr_id, Used to filter the corresponding... From the directory binlog file
- --conf updatefields The configuration file for the command , It specifies DirServerAddr、PassWord、 Tables to retrieve and import data and tables to convert records so file
<?xml version="1.0" encoding="GBK" standalone="yes" ?>
<tcapulogmgr>
<!-- Dynamically change the configuration of the table structure -->
<UpdateFieldsCfg UpdateFieldsCfgNum="1">
<!--SourceAppID、SourceZoneID、SourceTableName Used to specify the business of the data table to be archived ID、 District Service ID And table name -->
<!--DestAppID、DestZoneID、DestTableName Used to specify the business to save the converted records ID、 District Service ID And table name -->
<!--LibFile Used to specify user generated to convert the record structure so file -->
<UpdateFieldsCfgItem SourceAppID="2" SourceZoneID="3" SourceTableName="TestData" DestAppID="2" DestZoneID="3" DestTableName="TestData_new" LibFile="do_nothing.so"/>
<!--PassWord Is used to specify the DestTableName Password of the business -->
<ServiceApiCfg PassWord="**********" ConnectTimeOut="10000" RegistTableTimeOut="10000" DirServerNum="1" >
<!--DirServerAddr Is used to specify the DestTableName Directory server address of the business -->
<DirServerAddr>tcp://*.*.*.*:9999</DirServerAddr>
</ServiceApiCfg>
</UpdateFieldsCfg>
</tcapulogmgr>
- --speed Speed control parameters
- --seqcontinuous Express binlog The serial number of must be continuous , If it is not continuous, an error will be reported
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <assert.h>
#include <sstream>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <tr1/functional>
#define TCAPLUS_MAX_TABLE_NAME_LEN_FOR_PLUGIN 128
enum EnumTransRecordStatus {
ENUM_TRANS_RECORD_SUC = 0,
ENUM_TRANS_RECORD_NOT_EXIST = 1,
ENUM_TRANS_RECORD_FAIL= -1,
};
typedef int int32_t;
typedef struct {
int32_t iAppID;
int32_t iZoneID;
char szTableName[TCAPLUS_MAX_TABLE_NAME_LEN_FOR_PLUGIN];
std::tr1::function<int(const char*)> pFuncForBillLog;
} TcapsvrImportCallBackPara;
typedef std::map<std::string, std::string> TcapFieldNameValueMap;
typedef std::vector<TcapFieldNameValueMap> VALUELIST;
typedef std::vector<EnumTransRecordStatus> STATUSLIST;
using namespace std;
extern "C" int TransferRecord(const VALUELIST& old_list,
VALUELIST& new_list, STATUSLIST& status_list,
TcapsvrImportCallBackPara* pCallBackPara)
{
if (NULL == pCallBackPara)
{
return -1;
}
VALUELIST::const_iterator it_list;
new_list.clear();
for (it_list = old_list.begin(); it_list != old_list.end(); ++it_list)
{
int ret = ENUM_TRANS_RECORD_SUC;
TcapFieldNameValueMap new_map;
const TcapFieldNameValueMap& old_map = *it_list;
TcapFieldNameValueMap::const_iterator it;
for (it = old_map.begin(); it != old_map.end(); ++it)
{
std::pair<TcapFieldNameValueMap::iterator, bool> result;
result = new_map.insert(std::make_pair(it->first, it->second));
if(!result.second)
{
status_list.push_back(ENUM_TRANS_RECORD_FAIL);
return -1;
}
}
// add new filed: platformid, use default value 0
// int32_t platformid = 0;
// std::string new_value((char*)&platformid, sizeof(platformid));
// std::string new_key = "platformid";
// std::pair<TcapFieldNameValueMap::iterator, bool> result = new_map.insert(std::make_pair(new_key, new_value));
// if(!result.second)
// {
// status_list.push_back(ENUM_TRANS_RECORD_FAIL);
// return -1;
// }
new_list.push_back(new_map);
status_list.push_back((EnumTransRecordStatus)ret);
}
return 0;
}

边栏推荐
猜你喜欢
![[tcapulusdb knowledge base] Introduction to tcapulusdb general documents](/img/d4/b1a2b217f80b532ed1640a948fcca6.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb general documents

【TcaplusDB知识库】TcaplusDB机型管理介绍

【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(二)

Notes on the development of raspberry pie (16): Raspberry pie 4b+ install MariaDB database (MySQL open source branch) and test basic operations
![[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction](/img/a4/c3255ce17516348f703f7f21511555.png)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction

基于STM32F103——SIM900A发送短信+串口打印

LVGL库入门教程01-移植到STM32(触摸屏)
![[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (I)](/img/f5/7ad04670229b99ea727f942d82328b.png)
[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (I)

Lightweight real-time semantic segmentation: eNet & erfnet
![[tcapulusdb knowledge base] tcapulusdb cluster management introduction](/img/c1/62276c344ded6c260070f0d60bce81.png)
[tcapulusdb knowledge base] tcapulusdb cluster management introduction
随机推荐
socket编程(中)
VSCode 如何将已编辑好的文件中的 tab 键转换成空格键
致力超表面光子芯片产品研发与制造,山河光电完成数千万元Pre-A轮融资
C#/VB.NET 在Word转PDF时生成目录书签
UE4,UE5虚幻引擎,Command Console控制台命令,参数集
Discord机器人开发
【TcaplusDB知识库】TcaplusDB分析型文本导出介绍
TS advanced keyof
Lvgl Library Tutorial 01- porting to STM32 (touch screen)
Will it be a great opportunity for entrepreneurs for Tiktok to attach so much importance to live broadcast sales of takeout packages?
break algorithm---multi-interface
多系统对接的适配与包装模式应用
C#/VB. Net to generate directory bookmarks when word is converted to PDF
Docker dockerfile installation mysql5.7
Kubernetes问题整理
How to use dataX to update the data in the downstream Oracle database with the update semantics?
How vscode converts a tab key in an edited file into a spacebar
我是如何解决码云图床失效问题?
书籍+视频+学习笔记+技能提升资源库,面试必问
『忘了再学』Shell基础 — 30、sed命令的使用