mirror of
https://github.com/joyieldInc/predixy.git
synced 2025-12-24 22:46:41 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca1630a6b4 | ||
|
|
9b85bd0e38 | ||
|
|
c15f54e274 | ||
|
|
fbb5a8acb3 | ||
|
|
393ff81e69 | ||
|
|
ace6ed2941 | ||
|
|
dacf3fb30c | ||
|
|
ebf7bd2d82 | ||
|
|
ca9cde0487 | ||
|
|
df3aa1aa92 |
@ -151,9 +151,9 @@ predixy扩展了redis中AUTH命令的功能,支持定义多个认证密码,
|
|||||||
Authority {
|
Authority {
|
||||||
Auth [password] {
|
Auth [password] {
|
||||||
Mode read|write|admin
|
Mode read|write|admin
|
||||||
[KeyPredix Predix...]
|
[KeyPrefix Prefix...]
|
||||||
[ReadKeyPredix Predix...]
|
[ReadKeyPrefix Prefix...]
|
||||||
[WriteKeyPredix Predix...]
|
[WriteKeyPrefix Prefix...]
|
||||||
}...
|
}...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ Command Command::CmdPool[AvailableCommands] = {
|
|||||||
{Hmget, "hmget", 3, MaxArgs, Read},
|
{Hmget, "hmget", 3, MaxArgs, Read},
|
||||||
{Hmset, "hmset", 4, MaxArgs, Write},
|
{Hmset, "hmset", 4, MaxArgs, Write},
|
||||||
{Hscan, "hscan", 3, 7, Read},
|
{Hscan, "hscan", 3, 7, Read},
|
||||||
{Hset, "hset", 4, 4, Write},
|
{Hset, "hset", 4, MaxArgs, Write},
|
||||||
{Hsetnx, "hsetnx", 4, 4, Write},
|
{Hsetnx, "hsetnx", 4, 4, Write},
|
||||||
{Hstrlen, "hstrlen", 3, 3, Read},
|
{Hstrlen, "hstrlen", 3, 3, Read},
|
||||||
{Hvals, "hvals", 2, 2, Read},
|
{Hvals, "hvals", 2, 2, Read},
|
||||||
@ -139,6 +139,8 @@ Command Command::CmdPool[AvailableCommands] = {
|
|||||||
{Zincrby, "zincrby", 4, 4, Write},
|
{Zincrby, "zincrby", 4, 4, Write},
|
||||||
{Zinterstore, "zinterstore", 4, MaxArgs, Write},
|
{Zinterstore, "zinterstore", 4, MaxArgs, Write},
|
||||||
{Zlexcount, "zlexcount", 4, 4, Read},
|
{Zlexcount, "zlexcount", 4, 4, Read},
|
||||||
|
{Zpopmax, "zpopmax", 2, 3, Write},
|
||||||
|
{Zpopmin, "zpopmin", 2, 3, Write},
|
||||||
{Zrange, "zrange", 4, 5, Read},
|
{Zrange, "zrange", 4, 5, Read},
|
||||||
{Zrangebylex, "zrangebylex", 4, 7, Read},
|
{Zrangebylex, "zrangebylex", 4, 7, Read},
|
||||||
{Zrangebyscore, "zrangebyscore", 4, 8, Read},
|
{Zrangebyscore, "zrangebyscore", 4, 8, Read},
|
||||||
|
|||||||
@ -156,6 +156,8 @@ public:
|
|||||||
Zincrby,
|
Zincrby,
|
||||||
Zinterstore,
|
Zinterstore,
|
||||||
Zlexcount,
|
Zlexcount,
|
||||||
|
Zpopmax,
|
||||||
|
Zpopmin,
|
||||||
Zrange,
|
Zrange,
|
||||||
Zrangebylex,
|
Zrangebylex,
|
||||||
Zrangebyscore,
|
Zrangebyscore,
|
||||||
|
|||||||
@ -215,7 +215,6 @@ void Handler::postAcceptConnectionEvent()
|
|||||||
auto cp = mConnPool[s->server()->id()];
|
auto cp = mConnPool[s->server()->id()];
|
||||||
s->setStatus(Connection::LogicError);
|
s->setStatus(Connection::LogicError);
|
||||||
addPostEvent(s, Multiplexor::ErrorEvent);
|
addPostEvent(s, Multiplexor::ErrorEvent);
|
||||||
cp->putPrivateConnection(s);
|
|
||||||
c->detachConnectConnection();
|
c->detachConnectConnection();
|
||||||
s->detachAcceptConnection();
|
s->detachAcceptConnection();
|
||||||
}
|
}
|
||||||
@ -276,6 +275,9 @@ void Handler::postConnectConnectionEvent()
|
|||||||
s->status(), s->statusStr());
|
s->status(), s->statusStr());
|
||||||
mEventLoop->delSocket(s);
|
mEventLoop->delSocket(s);
|
||||||
s->close(this);
|
s->close(this);
|
||||||
|
if (!s->isShared()) {
|
||||||
|
mConnPool[s->server()->id()]->putPrivateConnection(s);
|
||||||
|
}
|
||||||
if (c) {
|
if (c) {
|
||||||
addPostEvent(c, Multiplexor::ErrorEvent);
|
addPostEvent(c, Multiplexor::ErrorEvent);
|
||||||
s->detachAcceptConnection();
|
s->detachAcceptConnection();
|
||||||
|
|||||||
@ -103,6 +103,7 @@ Request::~Request()
|
|||||||
|
|
||||||
void Request::clear()
|
void Request::clear()
|
||||||
{
|
{
|
||||||
|
mConn = nullptr;
|
||||||
mRes = nullptr;
|
mRes = nullptr;
|
||||||
mHead.clear();
|
mHead.clear();
|
||||||
mReq.clear();
|
mReq.clear();
|
||||||
@ -293,6 +294,7 @@ void Request::follow(Request* leader)
|
|||||||
if (leader == this) {
|
if (leader == this) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mConn = leader->mConn;
|
||||||
mType = leader->mType;
|
mType = leader->mType;
|
||||||
mHead = leader->mHead;
|
mHead = leader->mHead;
|
||||||
mReq = leader->mReq;
|
mReq = leader->mReq;
|
||||||
|
|||||||
@ -71,7 +71,7 @@ public:
|
|||||||
bool isDone() const;
|
bool isDone() const;
|
||||||
AcceptConnection* connection() const
|
AcceptConnection* connection() const
|
||||||
{
|
{
|
||||||
return mLeader ? mLeader->mConn : mConn;
|
return mConn;
|
||||||
}
|
}
|
||||||
void detach()
|
void detach()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -391,7 +391,7 @@ Cases = [
|
|||||||
[('scard', '{k}2'), 3],
|
[('scard', '{k}2'), 3],
|
||||||
]),
|
]),
|
||||||
('zset', [
|
('zset', [
|
||||||
[('del', 'k', '{k}2', '{k}3', '{k}4'), ],
|
[('del', 'k', '{k}2', '{k}3', '{k}4', '{k}5', '{k}6'), ],
|
||||||
[('zadd', 'k', 10, 'apple'), 1],
|
[('zadd', 'k', 10, 'apple'), 1],
|
||||||
[('zcard', 'k'), 1],
|
[('zcard', 'k'), 1],
|
||||||
[('zincrby', 'k', 2, 'apple'), '12'],
|
[('zincrby', 'k', 2, 'apple'), '12'],
|
||||||
@ -438,6 +438,12 @@ Cases = [
|
|||||||
[('zunionstore', '{k}3', 2, 'k', '{k}2'), 4],
|
[('zunionstore', '{k}3', 2, 'k', '{k}2'), 4],
|
||||||
[('zunionstore', '{k}3', 2, 'k', '{k}2', 'AGGREGATE', 'MAX'), 4],
|
[('zunionstore', '{k}3', 2, 'k', '{k}2', 'AGGREGATE', 'MAX'), 4],
|
||||||
[('zunionstore', '{k}3', 2, 'k', '{k}2', 'WEIGHTS', 0.5, 1.2, 'AGGREGATE', 'MAX'), 4],
|
[('zunionstore', '{k}3', 2, 'k', '{k}2', 'WEIGHTS', 0.5, 1.2, 'AGGREGATE', 'MAX'), 4],
|
||||||
|
[('zadd', '{k}5', 0, 'apple', 9, 'banana', 1, 'pear', 3, 'orange', 4, 'cat'), 5],
|
||||||
|
[('zpopmax', '{k}5'), ['banana', '9']],
|
||||||
|
[('zpopmax', '{k}5', 3), ['cat', '4', 'orange', '3', 'pear', '1']],
|
||||||
|
[('zadd', '{k}6', 0, 'apple', 9, 'banana', 1, 'pear', 3, 'orange', 4, 'cat'), 5],
|
||||||
|
[('zpopmin', '{k}6'), ['apple', '0']],
|
||||||
|
[('zpopmin', '{k}6', 3), ['pear', '1', 'orange', '3', 'cat', '4']],
|
||||||
]),
|
]),
|
||||||
('hyperloglog', [
|
('hyperloglog', [
|
||||||
[('del', 'k', '{k}2', '{k}3'), ],
|
[('del', 'k', '{k}2', '{k}3'), ],
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user