当前位置:网站首页>[tcapulusdb knowledge base] [list table] example code for deleting the data at the specified location in the list
[tcapulusdb knowledge base] [list table] example code for deleting the data at the specified location in the list
2022-06-23 03:45:00 【Tcapulus Jun】
【TcaplusDB The knowledge base 】[List surface ] Sample code for deleting location data specified in the list
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_DELETE_REQ);
request.setTableName(tableName);
// 3.3. because List In the table , Can be more Key Same data , So when you call some interfaces ,
// You need to specify which data in the data list to delete , In this case 0, Take the first place 1 individual , And so on
Record record = request.addRecord(0);
// 3.4. Set the list of each Key Value of field
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 .
边栏推荐
- Full analysis of embedded software testing tool tpt18 update
- Simply use the pagoda to build WordPress
- [quick view] Analysis on the development status and future development trend of the global and Chinese diamond cultivation industry in 2021 [figure]
- 【二分】leetcode1011. Capacity To Ship Packages Within D Days
- 【LeetCode】两数之和II
- JS remove first character of string
- Banknext microservice: a case study
- JS Part 4
- Tcapulusdb Jun · industry news collection (V)
- HAProxy的编译安装及全局配置段说明
猜你喜欢
![[OWT] OWT client native P2P E2E test vs2017 construction 4: Construction and link of third-party databases p2pmfc exe](/img/cd/7f896a0f05523a07b5dd04a8737879.png)
[OWT] OWT client native P2P E2E test vs2017 construction 4: Construction and link of third-party databases p2pmfc exe

Hierarchical attention graph convolution network for interpretable recommendation based on knowledge graph

What if the self incrementing IDs of online MySQL are exhausted?

1-1VMware介绍

Static code block, code block, constructor execution order
![[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]

mysql常用指令

MySQL common instructions

Jmeter- (V) simulated user concurrent login for interface test

R tree of search tree
随机推荐
I Arouter framework analysis
An implementation of warning bombing
What is the difference between the poll () method and the remove () method?
Banknext microservice: a case study
Hierarchical attention graph convolution network for interpretable recommendation based on knowledge graph
第一批00后下场求职:不要误读他们的“不一样”
Gx3001q UI instructions for upgrading 8-bit color to 16 bit color
Which insurance company is the most cost-effective for purchasing serious illness insurance?
How to realize data transaction
D overloading nested functions
What is the difference between ArrayList and array?
新版kali切换最高账户
【LeetCode】23. Merge K ascending linked lists
【二分】leetcode1011. Capacity To Ship Packages Within D Days
Preliminary sequencing problem
[tcapulusdb knowledge base] [list table] example code of batch deleting data at specified location in the list
[two points] leetcode1011 Capacity To Ship Packages Within D Days
Record an edusrc vulnerability mining
[machine learning] wuenda's machine learning assignment ex2 logistic regression matlab implementation
纳瓦尔宝典:不靠运气致富的原则