当前位置:网站首页>[tcapulusdb knowledge base] [list table] delete all data sample codes in the list
[tcapulusdb knowledge base] [list table] delete all data sample codes in the list
2022-06-23 03:41:00 【Tcapulus Jun】
【TcaplusDB The knowledge base 】[List surface ] Delete list all data sample code
See Chapter : preparation .
Sample code
Sample code
import com.tencent.tcaplus.client.Client;
import com.tencent.tcaplus.client.ClientFactory;
import com.tencent.tcaplus.client.Record;
import com.tencent.tcaplus.client.Request;
import com.tencent.tcaplus.client.Response;
import com.tencent.tdr.tcaplus_protocol_cs.TcaplusProtocolCsConstants;
import java.util.ArrayList;
import java.util.List;
public class Example {
public static void main(String[] arguments) {
// 1. Prepare environmental information
// 1.1. Directory service address list
List<String> dirList = new ArrayList<String>();
dirList.add("tcp://x.x.x.x:9999");
dirList.add("tcp://y.y.y.y:9999");
// 1.2. Business ID
int appId = 1;
// 1.3. Business password
String appPassword = "****************";
// 1.4. Table group ID
int tableGroupId = 1;
// 1.5. Table name
String tableName = "test";
// 2. Create client
Client client = ClientFactory.createClient(appId, tableGroupId, appPassword, dirList);
try {
// 3. Construct a request to query data
// 3.1. Get request object . In order to improve SDK performance ,Request Objects are reusable
Request request = client.acquireRequest();
// 3.2. Set request type and target table name . Be careful : Target table must be List surface
request.setCmd(TcaplusProtocolCsConstants.TCAPLUS_CMD_LIST_DELETEALL_REQ);
request.setTableName(tableName);
// 3.3. Set the list of each Key Value of field
Record record = request.addRecord();
record.setKeyInt("gameid", 1);
record.setKeyInt("itemid", 1);
record.setKeyString("name", "test");
// 4. Send a request , And get the results
Response response = client.poll(request);
// 5. Processing results
if (response.getResult() == 0) {
// Delete data succeeded
// TODO You can add the subsequent processing code of successful data deletion here
} else {
// Failed to delete data
// TODO You can add the subsequent processing code of data deletion failure here
}
} finally {
// 6. Destroy client objects
ClientFactory.destroyClient(client);
}
}
}TcaplusDB It's a distributed product of Tencent NoSQL database , The code for storage and scheduling is completely self-developed . With cache + Landing fusion architecture 、PB Levels of storage 、 Millisecond delay 、 Lossless horizontal expansion and complex data structure . At the same time, it has rich ecological environment 、 Easy migration 、 Extremely low operation and maintenance costs and five nine high availability features . Customer coverage game 、 Internet 、 government affairs 、 Finance 、 Manufacturing and the Internet of things .
边栏推荐
- Nature: correlation between oscillatory signals and gene expression supporting human episodic memory coding
- Source code encryption of data encryption technology
- An implementation of warning bombing
- Navar's Treasure Book: the principle of getting rich without luck
- Apicloud native module, H5 module and multi terminal component tutorial
- Record an edusrc vulnerability mining
- Talk about memory model and memory order
- What is the potential of dmail based on Web3.0? First round financing of $10 million?
- Static code block, code block, constructor execution order
- ABCD identifier of SAP mm initial cycle count
猜你喜欢
![[quick view] Analysis on the development status and future development trend of the global and Chinese diamond cultivation industry in 2021 [figure]](/img/f1/972a760459a6d599b5681aa634df09.jpg)
[quick view] Analysis on the development status and future development trend of the global and Chinese diamond cultivation industry in 2021 [figure]

Fetch request details
![Analysis on development history, industrial chain, output and enterprise layout of medical polypropylene in China in 2020 [figure]](/img/28/ebfc25ec288627706e15a07e6bdb77.jpg)
Analysis on development history, industrial chain, output and enterprise layout of medical polypropylene in China in 2020 [figure]
![[OWT] OWT client native P2P E2E test vs2017 build 2: test unit construction and operation](/img/b0/4ea8069a88ce19ca7dbfa67ac9fcba.png)
[OWT] OWT client native P2P E2E test vs2017 build 2: test unit construction and operation

Detailed discussion on modular architecture design of MCU firmware

One of the touchdesigner uses - Download and install

【机器学习】 吴恩达机器学习作业 ex2逻辑回归 Matlab实现

直接插入排序

LRU cache

嵌入式软件测试工具TPT18更新全解析
随机推荐
[OWT] OWT client native P2P E2E test vs2017 build 3: no test unit comparison, manually generate vs projects
Analysis on the development of duty-free industry in Hainan Province in 2021: the implementation of the new policy makes the duty-free market in Hainan more "prosperous" [figure]
Nature: correlation between oscillatory signals and gene expression supporting human episodic memory coding
This point (II)
Postman calls relevant interfaces of CLS API 3.0
Generate PDF417 code in batch through TXT file
1-1VMware介绍
【二叉树】993. Cousins in Binary Tree
What about the high cost of storage system? The original computer room can save so much money!
How to save the model obtained from sklearn training? Just read this one
YouTube security scenarios
Banknext microservice: a case study
冒泡排序法
Official announcement! The Hong Kong Zhuhai Macao Bridge is finally here!
[advanced Android] entrusted by kotlin
Flink practice tutorial: advanced 7- basic operation and maintenance
Using jhipster to build microservice architecture
MySQL common instructions
Tcapulusdb Jun · industry news collection (IV)
Auto rename when uploading pictures on WordPress media