Aerospike系列:4:简单的增删改查aql

AeroSpike基本应用 说明:分两篇介绍,第一篇为基本概念介绍,第二篇为实际应用;该篇为应用部分。 1、常用操作命令   Aerospike提供一套类SQL操作,和Mysql语法极其相似(命令解析参考注释),在安装aerospike的服务器上,通过aql --help 可以查看系统提供的帮助文档,很详细,里面还有很多DEMO语句。然后通过aql -h ip -p port 连上服务器(直接aql默认连接127.0.0... 阅读详情
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
[root@localhost bin]# aql --help
Usage: aql OPTIONS
 
OPTIONS
     
     -h <host>
         The hostname to the server connect to . Default : 127.0.0.1
 
     -p <port>
         The port number of the server to connect to . Default : 3000
 
     -U < user name >
         User name used to authenticate with cluster. Default : none
 
     -P[< password >]
         Password used to authenticate with cluster. Default : none
 
         User will be prompted on command line if -P specified and no password is given.
 
     -c <command>
         Execute the specified command.
 
     -f <filepath>
         Execute the commands in the specified file.
 
     -v
         Enable verbose output . Default : disabled
 
     -e
         Enable echoing of commands. Default disabled
 
     -M
         Result display disabled. Default display enabled
 
     -q
         Scan queue size . Default 3
 
     -T <milliseconds>
         Set the timeout (ms) for commands. Default : 1000
 
     -S
         Enable SLAP mode for queries. Default : disabled
 
     -t <n>
         Number of batch threads for SLAP mode. Default : 10
 
     -i <n>
         Number of iterations per thread for SLAP mode. Default : 10
 
     -o (json | table )
         Set the output mode. Default : table
 
     -F <file path>
         Set output file path. Default : /dev/ null
 
     -u <path>
         Path to User managed UDF modules.
         Default : /opt/aerospike/usr/udf/lua
 
     -s <path>
         Path to the System managed UDF modules.
         Default : /opt/aerospike/sys/udf/lua
 
     -d
         Run in debug mode.
 
     --help
         Prints this message.
 
COMMANDS
     
     DDL
         CREATE INDEX < index > ON <ns>[.< set >] (<bin>) NUMERIC |STRING
         CREATE LIST/MAPKEYS/MAVALUES INDEX < index > ON <ns>[.< set >] (<bin>) NUMERIC |STRING
         DROP INDEX <ns>[.< set >] < index >
         REPAIR INDEX < index > ON <ns>[.< set >]
         
             <ns> is the namespace for the index .
             < set > is the set name for the index .
             < index > is the name of the index .
         
         Examples:
         
             CREATE INDEX idx_foo ON test.demo (foo) NUMERIC
             DROP INDEX test.demo idx_foo
             REPAIR INDEX idx_foo ON test.demo
         
     DML
         INSERT INTO <ns>[.< set >] (PK, <bins>) VALUES (< key >, < values >)
         DELETE FROM <ns>[.< set >] WHERE PK = < key >
         
             <ns> is the namespace for the record.
             < set > is the set name for the record.
             < key > is the record 's primary key.
             <key> is the record' s primary key .
             <bins> is a comma-separated list of bin names.
             < values > is comma-separated list of bin values . Keep it NULL ( case insensitive & w/o quotes) to delete the bin
         
         Examples:
         
             INSERT INTO test.demo (PK, foo, bar) VALUES ( 'key1' , 123, 'abc' )
             DELETE FROM test.demo WHERE PK = 'key1'
         
     QUERY
         SELECT <bins> FROM <ns>[.< set >]
         SELECT <bins> FROM <ns>[.< set >] WHERE <bin> = <value>
         SELECT <bins> FROM <ns>[.< set >] WHERE <bin> BETWEEN < lower > AND < upper >
         SELECT <bins> FROM <ns>[.< set >] WHERE PK = < key >
         SELECT <bins> FROM <ns>[.< set >] IN <indextype> WHERE <bin> = <value>
         SELECT <bins> FROM <ns>[.< set >] IN <indextype> WHERE <bin> BETWEEN < lower > AND < upper >
         
             <ns> is the namespace for the records to be queried.
             < set > is the set name for the record to be queried.
             < key > is the record 's primary key.
             <bin> is the name of a bin.
             <value> is the value of a bin.
             <indextype> is the type of a index user wants to query. (LIST/MAPKEYS/MAPVALUES)
             <bins> can be either a wildcard (*) or a comma-separated list of bin names.
             <lower> is the lower bound for a numeric range query.
             <upper> is the lower bound for a numeric range query.
         
         Examples:
         
             SELECT * FROM test.demo
             SELECT * FROM test.demo WHERE PK = ' key1 '
             SELECT foo, bar FROM test.demo WHERE PK = ' key1 '
             SELECT foo, bar FROM test.demo WHERE foo = 123
             SELECT foo, bar FROM test.demo WHERE foo BETWEEN 0 AND 999
         
     MANAGE UDFS
         REGISTER MODULE ' <filepath> '
         SHOW MODULES
         REMOVE MODULE <filename>
         DESC MODULE <filename>
         
             <filepath> is file path to the UDF module(in single quotes).
             <filename> is file name of the UDF module.
         
         Examples:
         
             REGISTER MODULE ' ~/test.lua '
             SHOW MODULES
             DESC MODULE test.lua
             REMOVE MODULE test.lua
         
     INVOKING UDFS
         EXECUTE <module>.<function>(<args>) ON <ns>[.<set>]
         EXECUTE <module>.<function>(<args>) ON <ns>[.<set>] WHERE PK = <key>
         AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> = <value>
         AGGREGATE <module>.<function>(<args>) ON <ns>[.<set>] WHERE <bin> BETWEEN <lower> AND <upper>
         
             <module> is UDF module containing the function to invoke.
             <function> is UDF to invoke.
             <args> is a comma-separated list of argument values for the UDF.
             <ns> is the namespace for the records to be queried.
             <set> is the set name for the record to be queried.
             <key> is the record' s primary key .
             <bin> is the name of a bin.
             <value> is the value of a bin.
             < lower > is the lower bound for a numeric range query.
             < upper > is the lower bound for a numeric range query.
         
         Examples:
         
             EXECUTE myudfs.udf1(2) ON test.demo
             EXECUTE myudfs.udf1(2) ON test.demo WHERE PK = 'key1'
             AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo = 123
             AGGREGATE myudfs.udf2(2) ON test.demo WHERE foo BETWEEN 0 AND 999
         
     INFO
         SHOW NAMESPACES | SETS | BINS | INDEXES
         SHOW SCANS | QUERIES
         STAT NAMESPACE <ns> | INDEX <ns> <indexname>
         STAT SYSTEM
         
     JOB MANAGEMENT
         KILL_QUERY <transaction_id>
         KILL_SCAN <scan_id>
         
     USER ADMINISTRATION
         CREATE USER < user > PASSWORD < password > ROLE[S] <role1>,<role2>...
             pre-defined roles: read | read -write| read -write-udf|sys-admin| user -admin
         DROP USER < user >
         SET PASSWORD < password > [ FOR < user >]
         GRANT ROLE[S] <role1>,<role2>... TO < user >
         REVOKE ROLE[S] <role1>,<role2>... FROM < user >
         CREATE ROLE <role> PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>...
             priv: read | read -write| read -write-udf|sys-admin| user -admin
             ns:   namespace.  Applies to all namespaces if not set .
             set :  set name .  Applie to all sets within namespace if not set .
                   sys-admin and user -admin can't be qualified with namespace or set .
         DROP ROLE <role>
         GRANT PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... TO <role>
         REVOKE PRIVILEGE[S] <priv1[.ns1[.set1]]>,<priv2[.ns2[.set2]]>... FROM <role>
         SHOW USER [< user >]
         SHOW USERS
         SHOW ROLE <role>
         SHOW ROLES
         
     SETTINGS
         TIMEOUT                       ( time in ms, default : 1000 ms)
         RECORD_TTL                    ( time in ms, default : 0 ms)
         VERBOSE                       ( true | false , default false )
         ECHO                          ( true | false , default false )
         FAIL_ON_CLUSTER_CHANGE        ( true | false , default true , policy applies to scans)
         OUTPUT                        ( table | json, default table )
         LUA_USERPATH                  <path>, default : /opt/aerospike/usr/udf/lua
         LUA_SYSPATH                   <path>, default : /opt/aerospike/sys/udf/lua
         
         To get the value of a setting, run:
             
             aql> GET <setting>
             
         To set the value of a setting, run:
             
             aql> SET <setting> <value>
             
     OTHER
         RUN <filepath>
         HELP
         QUIT|EXIT|Q
Aerospike Query
Copyright 2013 Aerospike. All rights reserved.

 

添加一条记录:

?
1
2
aql> INSERT INTO test.set_fir (PK,uid,uname) VALUES ( 'key' ,1, 'Aerospike' )
OK, 1 record affected.

  

查询:

?
1
2
3
4
5
6
7
aql> select * from test.set_fir
+ -----+-------------+
| uid | uname       |
+ -----+-------------+
| 1   | "Aerospike" |
+ -----+-------------+
1 row in set (0.048 secs)

  

 

删除set:test.demo11 中的数据:

?
1
2
aql> DELETE FROM test.set_fir WHERE PK = 'key'
OK, 1 record affected.

也可以:

?
1
2
[root@localhost bin]# asinfo -v "set-config:context=namespace;id=test;set=set_fir;set-delete=true;"
ok

  

 

?
1
2
[root@localhost ~]# asinfo -v "set-config:context=namespace;id=test;set=demo11;set-delete=true;"
ok

  

 

查询:

?
1
2
aql> select * from test.demo11
0 rows in set (0.068 secs)

  

Aerospike学习笔记篇 Aerospike 是一个分布式、可扩展的Nosql 数据库。以KV 键值进行存储,当然也支持文档存储模型,在国内的并没有广泛使用,而在国外却大多数用在广告行业,以存储大数据量及强一致性而被广泛使用。... 阅读详情

相关推荐

ScyllaDB vs Aerospike:高性能NoSQL数据库对比

摘要: ScyllaDB与Aerospike作为高性能NoSQL数据库的代表,在性能、架构和成本效益上存在显著差异。测试显示,ScyllaDB在相同硬件条件下,读取吞吐量达700万次/秒(领先Aerospike 40%),写入性能提升40%-100%,且P99延迟仅4毫秒。其宽列存储模型、无界扩展能力和CQL兼容性使其在复杂查询和大规模部署中更具优势,而Aerospike在简单键值场景和低延迟(≤1ms)方面表现突出。成本上,ScyllaDB开源版无功能限制,相同负载下TCO比Aerospike低35%。综

qq_42773076的博客 1020

aerospike工具集——aql

aql工具提供了一个类似于sql的命令行接口,用于数据库,UDF和索引管理。aerospike不支持sql查询或管理语言,只是提供一个类似于sql的接口。 aql的使用方法 aql OPTIONS 可以通过aql --help来查看帮助文档,aql --help之后可以看到如下选项: -h 服务器ip,默认为:127.0.0.1 -p 端口号。默认为:3000

星月菩提的专栏 1万+

源码编译aerospike-server-3.6.4

生产环境一直使用3.5.3这个版本,和开发商量了一下,在测试环境使用3.6.4搭建集群,如果运行稳定就找机会将生产环境的集群升级。 aerospike QQ群:419183757 从github上下载源码包 wget https://github.com/aerospike/aerospike-server/archive/3.6.4.zip 编译前将依赖包安装全 yum ins

ylqmf的专栏 1883

KV存储-Aerospike之AQL的命令(COMMANDS)

Aerospike(以下简称Spike) Spike的AQL工具为DB、UDF和index管理提供了类似SQL命令行的接口。但Spike不支持标准SQL作为查询或管理语言。 如下是个人对Spike的aql命令(COMMANDS)的一些梳理总结。 1.DDL CREATE INDEX <index> ON <ns>[.<set>] (<bin>) NU...

tansheng526的专栏 5416

com.aerospike.client.AerospikeException: Error 13,1,BB993ED3E3E1600 100.0.0.23 3000: Record too big

Aerospike的max-record-size参数用于限制单条记录的最大存储空间(包括key和bin数据)。配置步骤:1)编辑/etc/aerospike/aerospike.conf文件;2)在目标namespace块中添加max-record-size值(需小于write-block-size);3)重启服务使配置生效。默认值在5.0+版本为1MiB,旧版为128KiB。注意:值单位为字节,配置错误会导致写入失败并返回AEROSPIKE_ERR_RECORD_TOO_BIG错误。修改后可通过asad

zhglhy的专栏 600

aql常用语句

常用sql语句和函数 select t.* , px = rank() over(order by [平均成绩] desc) from ( select m.Sno [学生编号] , m.Sname [学生姓名] , isnull(cast(avg(score) as decimal(18,2)),0) [平均成绩] from Student m left join SC n on m.Sno = n.Sno group by m.Sno , m.Sname ) t order by px select t.* , px = DENSE_RANK() over(order by [平均成绩] desc) from ( select m.Sno [学生编号] , m.Sname [学生姓名] , isnull(cast(avg(score) as decimal(18,2)),0) [平均成绩] from Student m left join SC n on m.Sno = n.Sno group by m.Sno , m.Sname ) t order by px

90%的人没用过的超读写能力、低延迟和高吞吐量的一款NoSQL

接下来,我们定义一个方法来模拟写入点击数据。// ... 客户端初始化代码 ... public void simulateAdClick(String user_id , String ad_id , long click_time) {// 定义写策略 WritePolicy writePolicy = new WritePolicy();// 定义键 Key key = new Key("ad_clicks" , "user_" + user_id , ad_id);

威哥爱编程,华为 HDE,鸿蒙极客、优快云博客专家、《鸿蒙 HarmonyOS 5/6 开发之路》系列图书第一作者 866

Mimics 21.0软件学习笔记(一)基本操作

Materialise Mimics 21.0打开工程窗口化Thresholding 二值化Region growing区域增长创建一个3D表示,并显示股骨头从髋臼中区分出来,并单独为股骨头建立3D模型 打开工程 Opening the Project 窗口化 Windowing 二值化 Thresholding 区域增长 Region Growing 建立 3D 表示 Creating a 3D representation 显示 3D 表示 Displaying a 3D representation

qq_35495464的博客 4万+

aerospike mysql_Aerospike系列:4:简单的增删改查aql

[root@localhost bin]# aql --helpUsage: aql OPTIONSOPTIONS-h The hostname to the server connect to. Default: 127.0.0.1-p The port number of the server to connect to. Default: 3000-U User name used to a...

weixin_39928461的博客 469

从理论到代码:手把手教你用Matlab复现MMC的HSS阻抗模型(附避坑指南)

本文详细介绍了如何使用Matlab复现MMC的HSS阻抗模型,涵盖谐波状态空间(HSS)理论、代码实现步骤及常见问题解决方案。通过谐波线性化和序阻抗建模技术,帮助工程师准确分析MMC的阻抗特性,并提供避坑指南以解决矩阵维度错误、收敛性问题和频域转换陷阱等难点。

weixin_42561040的博客 357

【操作系统】 Operation System 第二章:操作系统基础操作

2.1 操作系统的启动 (1)CPU, I/O, 内存通过总线连接。 (2)DISK:存放OS; BIOS:基本I/O处理系统( basic I/O system); Bootloader: 加载OS到内存中。 (3)当电脑通电时,段寄存器CS和指令寄存器IP能够确定一个内存地址,例如CS:IP = 0xf000:fff0. (4)POST(加电自检),寻找显卡和执行BIOS。(显示器,键盘…是否...

iwanderu的博客 1万+

aerospike入门

Aerospike 一、NoSql NoSQL(Not Only Sql),泛指非关系型的数据库。传统项目网站访问量一般不大,单机版数据库就很不错, 随着互联网web2.0网站的兴起,传统的关系数据库在处理web2.0网站,特别是超大规模和高并发的SNS类型的web2.0纯动态网站已经显得力不从心,出现了很多难以克服的问题,而非关系型的数据库则由于其本身的特点得到了非常迅速的发展。NoSQL数据库的产生就是为了解决大规模数据集合多重数据种类带来的挑战,尤其是大数据应用难题。 常见NoSql有: Redi

VVVVVxVVVVV的博客 1209

2 中望CAD二次开发-绘制图形(ZRX C++)

本文讲解中望CAD二次开发,关于块的概念及基本图形的绘制

cilvsuanna的博客 411

Aerospike系列:6:AerospikeTools & Utilities

1:Aerospike Query Language 类似于SQL命令。可以用来管理索引和用户自定义函数,也可以测试大多数数据库的功能。 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 [root@localhost ~]#aql OPTIONS   -h #Default: 127.0.0.1 -p #

tony的专栏 1222

模型预测控制 (MPC, Model Predictive Control) 算法详解及案例分析

模型预测控制是一种基于模型的控制策略,通过在线求解一个有限时域的优化问题,预测系统的未来行为,并根据预测结果调整控制输入,以实现系统的稳定性和性能优化。

闲人编程的博客 2936

如何用IDEA查看jar包中代码

我们在使用Java进行开放时经常会需要下载些第三方的jar包进行相应的开发。有时候相关jar包的使用文档不足,满足不了我们的特定开发使用要求,这就需要我们查看jar包内的相关代码逻辑,本文将基于IDEA工具介绍如何查看相关jar包的代码逻辑

mystonelxj的博客 2280

Aerospike

文章来源:拉勾教育Java高薪训练营第3期 Aerospike介绍 Aerospike(简称AS)是一个分布式,可扩展的键值存储的NoSQL数据库。 T级别大数据高并发的结构化数据存储 读写操作达微妙级,99%的响应可在1毫秒内实现 采用混合架构,索引存储在内存中,而数据可存储在机械硬盘(HDD)或固态硬盘(SSD) 上(也可存储在 内存) AS内部在访问SSD屏蔽了文件系统层级,直接访问地址,保证了数据的读取速度。 AS同时支持二级索引...

自律给我自由 2017

YOLOv11改进 | 损失函数改进篇 | EIoU、SIoU、WIoU、DIoU、FocusIoU等二十余种损失函数

这篇文章介绍了YOLOv11的重大改进,特别是在损失函数方面的创新。它不仅包括了多种IoU损失函数的改进和变体,如SIoU、WIoU、GIoU、DIoU、EIOU、CIoU,还融合了“Focus”思想,创造了一系列新的损失函数。这些组合形式的损失函数超过了二十余种,每种都针对特定的目标检测挑战进行优化。文章会详细探讨这些损失函数如何提高YOLOv11在各种检测任务中的性能,包括提升精度、加快收敛速度和增强模型对复杂场景的适应性。

Snu77的博客 6195

Aerospike入坑导读

Aerospike是一个以分布式为核心,T级别大数据高并发的结构化数据存储解决方案,读写操作达微妙级,索引内存化数据固态化,自动感知集群状态,节点间数据强一致性,平滑扩展以及丰富的开发语言支持,和redis相比aql介入的更有亲和力,对RDBMS的支持更好,熟悉sql的小哥哥小姐姐表示毫无压力,不过稳定性和普及率还有相当的差距,据说许多互联网广告相关业务都用它存储中间数据,难道我这些年混的都是假的互联网广告公司吗,有用的请举个爪儿。

厉力文武 575

【异常】Claude Code CLI 模型调用异常 There‘s an issue with the selected model (claude-sonnet-4-6). It may not

摘要: Claude Code CLI v2.1.45版本存在适配缺陷,导致调用claude-sonnet-4-6模型时触发"模型不存在"的误报错误(跨Windows/Linux平台)。该问题为版本回归类异常,非模型或账户权限问题。解决方案包括:1) 校验模型名称格式为claude-sonnet-4-6;2) 降级至v2.1.34或等待官方修复;3) 检查API配置有效性;4) 通过CLI交互界面手动选择模型;5) 临时切换同系列可用模型。官方已确认该bug并将发布修复版本。

奶爸的编程之路,也就一周冷个三天 6382

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

aerospike命令

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34109408的博客 1061

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

AS(aeroSpike)集群部署安装和常用命令

AeroSpike

weixin_43840872的博客 2516

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

aerospike_Aerospike谓词过滤器的功能

aerospike 为什么要使用谓词? (Why use Predicates?) Aerospike is a high throughput/low latency distributed NoSQL database. Records may be retrieved on the basis of a primary key, secondary index query, or full ...

weixin_26741235的博客 398
上一篇: Aerospike系列:3:aerospike特点分析
下一篇: Aerospike系列:5:安装AMC
achuo
博客等级 码龄18年 491粉丝 11原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值