Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
OpenAtomFoundation
pika
提交
1befcbe7
pika
项目概览
镜像
/
OpenAtomFoundation
/
pika
10 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
pika
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1befcbe7
编写于
9月 29, 2019
作者:
W
whoiami
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: incr/decr commands will lose TTL on slaves (#766)
上级
0d8bf029
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
145 deletion
+0
-145
include/pika_kv.h
include/pika_kv.h
+0
-25
src/pika_kv.cc
src/pika_kv.cc
+0
-120
未找到文件。
include/pika_kv.h
浏览文件 @
1befcbe7
...
...
@@ -55,11 +55,6 @@ class IncrCmd : public Cmd {
private:
std
::
string
key_
,
new_value_
;
virtual
void
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
);
virtual
std
::
string
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
override
;
};
class
IncrbyCmd
:
public
Cmd
{
...
...
@@ -70,11 +65,6 @@ class IncrbyCmd : public Cmd {
std
::
string
key_
,
new_value_
;
int64_t
by_
;
virtual
void
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
);
virtual
std
::
string
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
override
;
};
class
IncrbyfloatCmd
:
public
Cmd
{
...
...
@@ -85,11 +75,6 @@ class IncrbyfloatCmd : public Cmd {
std
::
string
key_
,
new_value_
;
double
by_
;
virtual
void
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
);
virtual
std
::
string
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
override
;
};
class
DecrCmd
:
public
Cmd
{
...
...
@@ -99,11 +84,6 @@ class DecrCmd : public Cmd {
private:
std
::
string
key_
,
new_value_
;
virtual
void
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
);
virtual
std
::
string
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
override
;
};
class
DecrbyCmd
:
public
Cmd
{
...
...
@@ -114,11 +94,6 @@ class DecrbyCmd : public Cmd {
std
::
string
key_
,
new_value_
;
int64_t
by_
;
virtual
void
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
);
virtual
std
::
string
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
override
;
};
class
GetsetCmd
:
public
Cmd
{
...
...
src/pika_kv.cc
浏览文件 @
1befcbe7
...
...
@@ -147,30 +147,6 @@ void IncrCmd::Do() {
return
;
}
std
::
string
IncrCmd
::
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
{
std
::
string
res
;
res
.
reserve
(
RAW_ARGS_LEN
);
RedisAppendLen
(
res
,
3
+
4
,
"*"
);
// to set cmd
std
::
string
set_cmd
(
"set"
);
RedisAppendLen
(
res
,
set_cmd
.
size
(),
"$"
);
RedisAppendContent
(
res
,
set_cmd
);
// key
RedisAppendLen
(
res
,
key_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
key_
);
// value
RedisAppendLen
(
res
,
new_value_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
new_value_
);
AppendAffiliatedInfo
(
res
,
server_id
,
binlog_info
,
need_send_to_hub
);
return
res
;
}
void
IncrbyCmd
::
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
)
{
if
(
!
ptr_info
->
CheckArg
(
argv
.
size
()))
{
res_
.
SetRes
(
CmdRes
::
kWrongNum
,
kCmdNameIncrby
);
...
...
@@ -199,30 +175,6 @@ void IncrbyCmd::Do() {
return
;
}
std
::
string
IncrbyCmd
::
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
{
std
::
string
res
;
res
.
reserve
(
RAW_ARGS_LEN
);
RedisAppendLen
(
res
,
3
+
4
,
"*"
);
// to set cmd
std
::
string
set_cmd
(
"set"
);
RedisAppendLen
(
res
,
set_cmd
.
size
(),
"$"
);
RedisAppendContent
(
res
,
set_cmd
);
// key
RedisAppendLen
(
res
,
key_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
key_
);
// value
RedisAppendLen
(
res
,
new_value_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
new_value_
);
AppendAffiliatedInfo
(
res
,
server_id
,
binlog_info
,
need_send_to_hub
);
return
res
;
}
void
IncrbyfloatCmd
::
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
)
{
if
(
!
ptr_info
->
CheckArg
(
argv
.
size
()))
{
res_
.
SetRes
(
CmdRes
::
kWrongNum
,
kCmdNameIncrbyfloat
);
...
...
@@ -252,30 +204,6 @@ void IncrbyfloatCmd::Do() {
return
;
}
std
::
string
IncrbyfloatCmd
::
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
{
std
::
string
res
;
res
.
reserve
(
RAW_ARGS_LEN
);
RedisAppendLen
(
res
,
3
+
4
,
"*"
);
// to set cmd
std
::
string
set_cmd
(
"set"
);
RedisAppendLen
(
res
,
set_cmd
.
size
(),
"$"
);
RedisAppendContent
(
res
,
set_cmd
);
// key
RedisAppendLen
(
res
,
key_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
key_
);
// value
RedisAppendLen
(
res
,
new_value_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
new_value_
);
AppendAffiliatedInfo
(
res
,
server_id
,
binlog_info
,
need_send_to_hub
);
return
res
;
}
void
DecrCmd
::
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
)
{
if
(
!
ptr_info
->
CheckArg
(
argv
.
size
()))
{
res_
.
SetRes
(
CmdRes
::
kWrongNum
,
kCmdNameDecr
);
...
...
@@ -299,30 +227,6 @@ void DecrCmd::Do() {
return
;
}
std
::
string
DecrCmd
::
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
{
std
::
string
res
;
res
.
reserve
(
RAW_ARGS_LEN
);
RedisAppendLen
(
res
,
3
+
4
,
"*"
);
// to set cmd
std
::
string
set_cmd
(
"set"
);
RedisAppendLen
(
res
,
set_cmd
.
size
(),
"$"
);
RedisAppendContent
(
res
,
set_cmd
);
// key
RedisAppendLen
(
res
,
key_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
key_
);
// value
RedisAppendLen
(
res
,
new_value_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
new_value_
);
AppendAffiliatedInfo
(
res
,
server_id
,
binlog_info
,
need_send_to_hub
);
return
res
;
}
void
DecrbyCmd
::
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
)
{
if
(
!
ptr_info
->
CheckArg
(
argv
.
size
()))
{
res_
.
SetRes
(
CmdRes
::
kWrongNum
,
kCmdNameDecrby
);
...
...
@@ -350,30 +254,6 @@ void DecrbyCmd::Do() {
return
;
}
std
::
string
DecrbyCmd
::
ToBinlog
(
const
PikaCmdArgsType
&
argv
,
const
std
::
string
&
server_id
,
const
std
::
string
&
binlog_info
,
bool
need_send_to_hub
)
{
std
::
string
res
;
res
.
reserve
(
RAW_ARGS_LEN
);
RedisAppendLen
(
res
,
3
+
4
,
"*"
);
// to set cmd
std
::
string
set_cmd
(
"set"
);
RedisAppendLen
(
res
,
set_cmd
.
size
(),
"$"
);
RedisAppendContent
(
res
,
set_cmd
);
// key
RedisAppendLen
(
res
,
key_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
key_
);
// value
RedisAppendLen
(
res
,
new_value_
.
size
(),
"$"
);
RedisAppendContent
(
res
,
new_value_
);
AppendAffiliatedInfo
(
res
,
server_id
,
binlog_info
,
need_send_to_hub
);
return
res
;
}
void
GetsetCmd
::
DoInitial
(
PikaCmdArgsType
&
argv
,
const
CmdInfo
*
const
ptr_info
)
{
if
(
!
ptr_info
->
CheckArg
(
argv
.
size
()))
{
res_
.
SetRes
(
CmdRes
::
kWrongNum
,
kCmdNameGetset
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录