diff --git a/csharp/lib/AsyncClient.cs b/csharp/lib/AsyncClient.cs index 3e6aab1ba8..e223f81eb9 100644 --- a/csharp/lib/AsyncClient.cs +++ b/csharp/lib/AsyncClient.cs @@ -129,105 +129,8 @@ private enum RequestType { InvalidRequest = 0, CustomCommand = 1, - Get = 2, - Set = 3, - Ping = 4, - Info = 5, - Del = 6, - Select = 7, - ConfigGet = 8, - ConfigSet = 9, - ConfigResetStat = 10, - ConfigRewrite = 11, - ClientGetName = 12, - ClientGetRedir = 13, - ClientId = 14, - ClientInfo = 15, - ClientKill = 16, - ClientList = 17, - ClientNoEvict = 18, - ClientNoTouch = 19, - ClientPause = 20, - ClientReply = 21, - ClientSetInfo = 22, - ClientSetName = 23, - ClientUnblock = 24, - ClientUnpause = 25, - Expire = 26, - HSet = 27, - HGet = 28, - HDel = 29, - HExists = 30, - MGet = 31, - MSet = 32, - Incr = 33, - IncrBy = 34, - Decr = 35, - IncrByFloat = 36, - DecrBy = 37, - HGetAll = 38, - HMSet = 39, - HMGet = 40, - HIncrBy = 41, - HIncrByFloat = 42, - LPush = 43, - LPop = 44, - RPush = 45, - RPop = 46, - LLen = 47, - LRem = 48, - LRange = 49, - LTrim = 50, - SAdd = 51, - SRem = 52, - SMembers = 53, - SCard = 54, - PExpireAt = 55, - PExpire = 56, - ExpireAt = 57, - Exists = 58, - Unlink = 59, - TTL = 60, - ZAdd = 61, - ZRem = 62, - ZRange = 63, - ZCard = 64, - ZCount = 65, - ZIncrBy = 66, - ZScore = 67, - Type = 68, - HLen = 69, - Echo = 70, - ZPopMin = 71, - Strlen = 72, - LIndex = 73, - ZPopMax = 74, - XRead = 75, - XAdd = 76, - XReadGroup = 77, - XAck = 78, - XTrim = 79, - XGroupCreate = 80, - XGroupDestroy = 81, - HSetNX = 82, - SIsMember = 83, - HVals = 84, - PTTL = 85, - ZRemRangeByRank = 86, - Persist = 87, - ZRemRangeByScore = 88, - Time = 89, - ZRank = 90, - Rename = 91, - DBSize = 92, - BRPop = 93, - HKeys = 94, - PfAdd = 96, - PfCount = 97, - PfMerge = 98, - BLPop = 100, - RPushX = 102, - LPushX = 103, + Get = 1504, + Set = 1517, } #endregion diff --git a/glide-core/src/protobuf/command_request.proto b/glide-core/src/protobuf/command_request.proto index acd6ef8e7c..5b2b826acc 100644 --- a/glide-core/src/protobuf/command_request.proto +++ b/glide-core/src/protobuf/command_request.proto @@ -38,225 +38,438 @@ message Routes { enum RequestType { /// Invalid request type - InvalidRequest = 0; + InvalidRequest = 0; /// An unknown command, where all arguments are defined by the user. - CustomCommand = 1; - Get = 2; - Set = 3; - Ping = 4; - Info = 5; - Del = 6; - Select = 7; - ConfigGet = 8; - ConfigSet = 9; - ConfigResetStat = 10; - ConfigRewrite = 11; - ClientGetName = 12; - ClientGetRedir = 13; - ClientId = 14; - ClientInfo = 15; - ClientKill = 16; - ClientList = 17; - ClientNoEvict = 18; - ClientNoTouch = 19; - ClientPause = 20; - ClientReply = 21; - ClientSetInfo = 22; - ClientSetName = 23; - ClientUnblock = 24; - ClientUnpause = 25; - Expire = 26; - HSet = 27; - HGet = 28; - HDel = 29; - HExists = 30; - MGet=31; - MSet=32; - Incr=33; - IncrBy=34; - Decr=35; - IncrByFloat=36; - DecrBy=37; - HGetAll=38; - HMSet=39; - HMGet=40; - HIncrBy = 41; - HIncrByFloat = 42; - LPush = 43; - LPop = 44; - RPush = 45; - RPop = 46; - LLen = 47; - LRem = 48; - LRange = 49; - LTrim = 50; - SAdd = 51; - SRem = 52; - SMembers = 53; - SCard = 54; - PExpireAt = 55; - PExpire = 56; - ExpireAt = 57; - Exists = 58; - Unlink = 59; - TTL = 60; - ZAdd = 61; - ZRem = 62; - ZRange = 63; - ZCard = 64; - ZCount = 65; - ZIncrBy = 66; - ZScore = 67; - Type = 68; - HLen = 69; - Echo = 70; - ZPopMin = 71; - Strlen = 72; - LIndex = 73; - ZPopMax = 74; - XRead = 75; - XAdd = 76; - XReadGroup = 77; - XAck = 78; - XTrim = 79; - XGroupCreate = 80; - XGroupDestroy = 81; - HSetNX = 82; - SIsMember = 83; - HVals = 84; - PTTL = 85; - ZRemRangeByRank = 86; - Persist = 87; - ZRemRangeByScore = 88; - Time = 89; - ZRank = 90; - Rename = 91; - DBSize = 92; - BRPop = 93; - HKeys = 94; - SPop = 95; - PfAdd = 96; - PfCount = 97; - PfMerge = 98; - BLPop = 100; - LInsert = 101; - RPushX = 102; - LPushX = 103; - ZMScore = 104; - ZDiff = 105; - ZDiffStore = 106; - SetRange = 107; - ZRemRangeByLex = 108; - ZLexCount = 109; - Append = 110; - SUnionStore = 111; - SDiffStore = 112; - SInter = 113; - SInterStore = 114; - ZRangeStore = 115; - GetRange = 116; - SMove = 117; - SMIsMember = 118; - ZUnionStore = 119; - LastSave = 120; - GeoAdd = 121; - GeoHash = 122; - ObjectEncoding = 123; - SDiff = 124; - ObjectIdleTime = 125; - ObjectRefCount = 126; - Lolwut = 100500; - GeoDist = 127; - GeoPos = 128; - BZPopMax = 129; - ObjectFreq = 130; - RenameNX = 131; - Touch = 132; - ZRevRank = 133; - ZInterStore = 134; - HRandField = 135; - ZUnion = 136; - BZPopMin = 137; - FlushAll = 138; - ZRandMember = 139; - BitCount = 140; - BZMPop = 141; - SetBit = 142; - ZInterCard = 143; - ZMPop = 144; - GetBit = 145; - ZInter = 146; - BitPos = 147; - BitOp = 148; - HStrlen = 149; - FunctionLoad = 150; - FunctionList = 151; - FunctionDelete = 152; - FunctionFlush = 153; - FCall = 154; - LMPop = 155; - ExpireTime = 156; - PExpireTime = 157; - BLMPop = 158; - XLen = 159; - Sort = 160; - FunctionKill = 161; - FunctionStats = 162; - FCallReadOnly = 163; - FlushDB = 164; - LSet = 165; - XDel = 166; - XRange = 167; - LMove = 168; - BLMove = 169; - GetDel = 170; - SRandMember = 171; - BitField = 172; - BitFieldReadOnly = 173; - Move = 174; - SInterCard = 175; - XRevRange = 176; - Copy = 178; - MSetNX = 179; - LPos = 180; - LCS = 181; - GeoSearch = 182; - Watch = 183; - UnWatch = 184; - GeoSearchStore = 185; - SUnion = 186; - Publish = 187; - SPublish = 188; - XGroupCreateConsumer = 189; - XGroupDelConsumer = 190; - RandomKey = 191; - GetEx = 192; - Dump = 193; - Restore = 194; - SortReadOnly = 195; - FunctionDump = 196; - FunctionRestore = 197; - XPending = 198; - XGroupSetId = 199; - SScan = 200; - ZScan = 201; - HScan = 202; - XAutoClaim = 203; - XInfoGroups = 204; - XInfoConsumers = 205; - XInfoStream = 207; - Scan = 206; - Wait = 208; - XClaim = 209; - PubSubChannels = 210; - PubSubNumPat = 211; - PubSubNumSub = 212; - PubSubSChannels = 213; - PubSubSNumSub = 214; - ScriptExists = 215; - ScriptFlush = 216; - ScriptKill = 217; - ScriptShow = 218; + CustomCommand = 1; + + //// Bitmap commands + + BitCount = 101; + BitField = 102; + BitFieldReadOnly = 103; + BitOp = 104; + BitPos = 105; + GetBit = 106; + SetBit = 107; + + //// Cluster commands + + Asking = 201; + ClusterAddSlots = 202; + ClusterAddSlotsRange = 203; + ClusterBumpEpoch = 204; + ClusterCountFailureReports = 205; + ClusterCountKeysInSlot = 206; + ClusterDelSlots = 207; + ClusterDelSlotsRange = 208; + ClusterFailover = 209; + ClusterFlushSlots = 210; + ClusterForget = 211; + ClusterGetKeysInSlot = 212; + ClusterInfo = 213; + ClusterKeySlot = 214; + ClusterLinks = 215; + ClusterMeet = 216; + ClusterMyId = 217; + ClusterMyShardId = 218; + ClusterNodes = 219; + ClusterReplicas = 220; + ClusterReplicate = 221; + ClusterReset = 222; + ClusterSaveConfig = 223; + ClusterSetConfigEpoch = 224; + ClusterSetslot = 225; + ClusterShards = 226; + ClusterSlaves = 227; + ClusterSlots = 228; + ReadOnly = 229; + ReadWrite = 230; + + //// Connection Management commands + + Auth = 301; + ClientCaching = 302; + ClientGetName = 303; + ClientGetRedir = 304; + ClientId = 305; + ClientInfo = 306; + ClientKillSimple = 307; + ClientKill = 308; + ClientList = 309; + ClientNoEvict = 310; + ClientNoTouch = 311; + ClientPause = 312; + ClientReply = 313; + ClientSetInfo = 314; + ClientSetName = 315; + ClientTracking = 316; + ClientTrackingInfo = 317; + ClientUnblock = 318; + ClientUnpause = 319; + Echo = 320; + Hello = 321; + Ping = 322; + Quit = 323; // deprecated in 7.2.0 + Reset = 324; + Select = 325; + + //// Generic commands + + Copy = 401; + Del = 402; + Dump = 403; + Exists = 404; + Expire = 405; + ExpireAt = 406; + ExpireTime = 407; + Keys = 408; + Migrate = 409; + Move = 410; + ObjectEncoding = 411; + ObjectFreq = 412; + ObjectIdleTime = 413; + ObjectRefCount = 414; + Persist = 415; + PExpire = 416; + PExpireAt = 417; + PExpireTime = 418; + PTTL = 419; + RandomKey = 420; + Rename = 421; + RenameNX = 422; + Restore = 423; + Scan = 424; + Sort = 425; + SortReadOnly = 426; + Touch = 427; + TTL = 428; + Type = 429; + Unlink = 430; + Wait = 431; + WaitAof = 432; + + //// Geospatial indices commands + + GeoAdd = 501; + GeoDist = 502; + GeoHash = 503; + GeoPos = 504; + GeoRadius = 505; + GeoRadiusReadOnly = 506; // deprecated in 6.2.0 + GeoRadiusByMember = 507; + GeoRadiusByMemberReadOnly = 508; // deprecated in 6.2.0 + GeoSearch = 509; + GeoSearchStore = 510; + + //// Hash commands + + HDel = 601; + HExists = 602; + HGet = 603; + HGetAll = 604; + HIncrBy = 605; + HIncrByFloat = 606; + HKeys = 607; + HLen = 608; + HMGet = 609; + HMSet = 610; + HRandField = 611; + HScan = 612; + HSet = 613; + HSetNX = 614; + HStrlen = 615; + HVals = 616; + + //// HyperLogLog commands + + PfAdd = 701; + PfCount = 702; + PfMerge = 703; + + //// List commands + + BLMove = 801; + BLMPop = 802; + BLPop = 803; + BRPop = 804; + BRPopLPush = 805; // deprecated in 6.2.0 + LIndex = 806; + LInsert = 807; + LLen = 808; + LMove = 809; + LMPop = 810; + LPop = 811; + LPos = 812; + LPush = 813; + LPushX = 814; + LRange = 815; + LRem = 816; + LSet = 817; + LTrim = 818; + RPop = 819; + RPopLPush = 820; // deprecated in 6.2.0 + RPush = 821; + RPushX = 822; + + //// Pub/Sub commands + + PSubscribe = 901; + Publish = 902; + PubSubChannels = 903; + PubSubNumPat = 904; + PubSubNumSub = 905; + PubSubShardChannels = 906; + PubSubShardNumSub = 907; + PUnsubscribe = 908; + SPublish = 909; + SSubscribe = 910; + Subscribe = 911; + SUnsubscribe = 912; + Unsubscribe = 913; + + //// Scripting and Functions commands + + Eval = 1001; + EvalReadOnly = 1002; + EvalSha = 1003; + EvalShaReadOnly = 1004; + FCall = 1005; + FCallReadOnly = 1006; + FunctionDelete = 1007; + FunctionDump = 1008; + FunctionFlush = 1009; + FunctionKill = 1010; + FunctionList = 1011; + FunctionLoad = 1012; + FunctionRestore = 1013; + FunctionStats = 1014; + ScriptDebug = 1015; + ScriptExists = 1016; + ScriptFlush = 1017; + ScriptKill = 1018; + ScriptLoad = 1019; + ScriptShow = 1020; + + //// Server management commands + + AclCat = 1101; + AclDelUser = 1102; + AclDryRun = 1103; + AclGenPass = 1104; + AclGetUser = 1105; + AclList = 1106; + AclLoad = 1107; + AclLog = 1108; + AclSave = 1109; + AclSetSser = 1110; + AclUsers = 1111; + AclWhoami = 1112; + BgRewriteAof = 1113; + BgSave = 1114; + Command_ = 1115; // Command - renamed to avoid collisions + CommandCount = 1116; + CommandDocs = 1117; + CommandGetKeys = 1118; + CommandGetKeysAndFlags = 1119; + CommandInfo = 1120; + CommandList = 1121; + ConfigGet = 1122; + ConfigResetStat = 1123; + ConfigRewrite = 1124; + ConfigSet = 1125; + DBSize = 1126; + FailOver = 1127; + FlushAll = 1128; + FlushDB = 1129; + Info = 1130; + LastSave = 1131; + LatencyDoctor = 1132; + LatencyGraph = 1133; + LatencyHistogram = 1134; + LatencyHistory = 1135; + LatencyLatest = 1136; + LatencyReset = 1137; + Lolwut = 1138; + MemoryDoctor = 1139; + MemoryMallocStats = 1140; + MemoryPurge = 1141; + MemoryStats = 1142; + MemoryUsage = 1143; + ModuleList = 1144; + ModuleLoad = 1145; + ModuleLoadEx = 1146; + ModuleUnload = 1147; + Monitor = 1148; + PSync = 1149; + ReplConf = 1150; + ReplicaOf = 1151; + RestoreAsking = 1152; + Role = 1153; + Save = 1154; + ShutDown = 1155; + SlaveOf = 1156; + SlowLogGet = 1157; + SlowLogLen = 1158; + SlowLogReset = 1159; + SwapDb = 1160; + Sync = 1161; + Time = 1162; + + //// Set commands + + SAdd = 1201; + SCard = 1202; + SDiff = 1203; + SDiffStore = 1204; + SInter = 1205; + SInterCard = 1206; + SInterStore = 1207; + SIsMember = 1208; + SMembers = 1209; + SMIsMember = 1210; + SMove = 1211; + SPop = 1212; + SRandMember = 1213; + SRem = 1214; + SScan = 1215; + SUnion = 1216; + SUnionStore = 1217; + + //// Sorted set commands + + BZMPop = 1301; + BZPopMax = 1302; + BZPopMin = 1303; + ZAdd = 1304; + ZCard = 1305; + ZCount = 1306; + ZDiff = 1307; + ZDiffStore = 1308; + ZIncrBy = 1309; + ZInter = 1310; + ZInterCard = 1311; + ZInterStore = 1312; + ZLexCount = 1313; + ZMPop = 1314; + ZMScore = 1315; + ZPopMax = 1316; + ZPopMin = 1317; + ZRandMember = 1318; + ZRange = 1319; + ZRangeByLex = 1320; + ZRangeByScore = 1321; + ZRangeStore = 1322; + ZRank = 1323; + ZRem = 1324; + ZRemRangeByLex = 1325; + ZRemRangeByRank = 1326; + ZRemRangeByScore = 1327; + ZRevRange = 1328; + ZRevRangeByLex = 1329; + ZRevRangeByScore = 1330; + ZRevRank = 1331; + ZScan = 1332; + ZScore = 1333; + ZUnion = 1334; + ZUnionStore = 1335; + + //// Stream commands + + XAck = 1401; + XAdd = 1402; + XAutoClaim = 1403; + XClaim = 1404; + XDel = 1405; + XGroupCreate = 1406; + XGroupCreateConsumer = 1407; + XGroupDelConsumer = 1408; + XGroupDestroy = 1409; + XGroupSetId = 1410; + XInfoConsumers = 1411; + XInfoGroups = 1412; + XInfoStream = 1413; + XLen = 1414; + XPending = 1415; + XRange = 1416; + XRead = 1417; + XReadGroup = 1418; + XRevRange = 1419; + XSetId = 1420; + XTrim = 1421; + + //// String commands + + Append = 1501; + Decr = 1502; + DecrBy = 1503; + Get = 1504; + GetDel = 1505; + GetEx = 1506; + GetRange = 1507; + GetSet = 1508; // deprecated in 6.2.0 + Incr = 1509; + IncrBy = 1510; + IncrByFloat = 1511; + LCS = 1512; + MGet = 1513; + MSet = 1514; + MSetNX = 1515; + PSetEx = 1516; // deprecated in 2.6.12 + Set = 1517; + SetEx = 1518; // deprecated in 2.6.12 + SetNX = 1519; // deprecated in 2.6.12 + SetRange = 1520; + Strlen = 1521; + Substr = 1522; + + //// Transaction commands + + Discard = 1601; + Exec = 1602; + Multi = 1603; + UnWatch = 1604; + Watch = 1605; + + //// JSON commands + + JsonArrAppend = 2001; + JsonArrIndex = 2002; + JsonArrInsert = 2003; + JsonArrLen = 2004; + JsonArrPop = 2005; + JsonArrTrim = 2006; + JsonClear = 2007; + JsonDebug = 2008; + JsonDel = 2009; + JsonForget = 2010; + JsonGet = 2011; + JsonMGet = 2012; + JsonNumIncrBy = 2013; + JsonNumMultBy = 2014; + JsonObjKeys = 2015; + JsonObjLen = 2016; + JsonResp = 2017; + JsonSet = 2018; + JsonStrAppend = 2019; + JsonStrLen = 2020; + JsonToggle = 2021; + JsonType = 2022; + + //// Vector Search commands + + FtList = 2101; + FtAggregate = 2102; + FtAliasAdd = 2103; + FtAliasDel = 2104; + FtAliasList = 2105; + FtAliasUpdate = 2106; + FtCreate = 2107; + FtDropIndex = 2108; + FtExplain = 2109; + FtExplainCli = 2110; + FtInfo = 2111; + FtProfile = 2112; + FtSearch = 2113; } message Command { diff --git a/glide-core/src/request_type.rs b/glide-core/src/request_type.rs index 4350403b58..9ee4ac92a9 100644 --- a/glide-core/src/request_type.rs +++ b/glide-core/src/request_type.rs @@ -9,224 +9,421 @@ use crate::command_request::RequestType as ProtobufRequestType; #[repr(C)] #[derive(Debug)] pub enum RequestType { + /// Invalid request type InvalidRequest = 0, + /// An unknown command, where all arguments are defined by the user. CustomCommand = 1, - Get = 2, - Set = 3, - Ping = 4, - Info = 5, - Del = 6, - Select = 7, - ConfigGet = 8, - ConfigSet = 9, - ConfigResetStat = 10, - ConfigRewrite = 11, - ClientGetName = 12, - ClientGetRedir = 13, - ClientId = 14, - ClientInfo = 15, - ClientKill = 16, - ClientList = 17, - ClientNoEvict = 18, - ClientNoTouch = 19, - ClientPause = 20, - ClientReply = 21, - ClientSetInfo = 22, - ClientSetName = 23, - ClientUnblock = 24, - ClientUnpause = 25, - Expire = 26, - HSet = 27, - HGet = 28, - HDel = 29, - HExists = 30, - MGet = 31, - MSet = 32, - Incr = 33, - IncrBy = 34, - Decr = 35, - IncrByFloat = 36, - DecrBy = 37, - HGetAll = 38, - HMSet = 39, - HMGet = 40, - HIncrBy = 41, - HIncrByFloat = 42, - LPush = 43, - LPop = 44, - RPush = 45, - RPop = 46, - LLen = 47, - LRem = 48, - LRange = 49, - LTrim = 50, - SAdd = 51, - SRem = 52, - SMembers = 53, - SCard = 54, - PExpireAt = 55, - PExpire = 56, - ExpireAt = 57, - Exists = 58, - Unlink = 59, - TTL = 60, - ZAdd = 61, - ZRem = 62, - ZRange = 63, - ZCard = 64, - ZCount = 65, - ZIncrBy = 66, - ZScore = 67, - Type = 68, - HLen = 69, - Echo = 70, - ZPopMin = 71, - Strlen = 72, - LIndex = 73, - ZPopMax = 74, - XRead = 75, - XAdd = 76, - XReadGroup = 77, - XAck = 78, - XTrim = 79, - XGroupCreate = 80, - XGroupDestroy = 81, - HSetNX = 82, - SIsMember = 83, - HVals = 84, - PTTL = 85, - ZRemRangeByRank = 86, - Persist = 87, - ZRemRangeByScore = 88, - Time = 89, - ZRank = 90, - Rename = 91, - DBSize = 92, - BRPop = 93, - HKeys = 94, - SPop = 95, - PfAdd = 96, - PfCount = 97, - PfMerge = 98, - BLPop = 100, - LInsert = 101, - RPushX = 102, - LPushX = 103, - ZMScore = 104, - ZDiff = 105, - ZDiffStore = 106, - SetRange = 107, - ZRemRangeByLex = 108, - ZLexCount = 109, - Append = 110, - SUnionStore = 111, - SDiffStore = 112, - SInter = 113, - SInterStore = 114, - ZRangeStore = 115, - GetRange = 116, - SMove = 117, - SMIsMember = 118, - ZUnionStore = 119, - LastSave = 120, - GeoAdd = 121, - GeoHash = 122, - ObjectEncoding = 123, - SDiff = 124, - ObjectIdleTime = 125, - ObjectRefCount = 126, - Lolwut = 100500, - GeoDist = 127, - GeoPos = 128, - BZPopMax = 129, - ObjectFreq = 130, - RenameNX = 131, - Touch = 132, - ZRevRank = 133, - ZInterStore = 134, - HRandField = 135, - ZUnion = 136, - BZPopMin = 137, - FlushAll = 138, - ZRandMember = 139, - BitCount = 140, - BZMPop = 141, - SetBit = 142, - ZInterCard = 143, - ZMPop = 144, - GetBit = 145, - ZInter = 146, - BitPos = 147, - BitOp = 148, - HStrlen = 149, - FunctionLoad = 150, - FunctionList = 151, - FunctionDelete = 152, - FunctionFlush = 153, - FCall = 154, - LMPop = 155, - ExpireTime = 156, - PExpireTime = 157, - BLMPop = 158, - XLen = 159, - Sort = 160, - FunctionKill = 161, - FunctionStats = 162, - FCallReadOnly = 163, - FlushDB = 164, - LSet = 165, - XDel = 166, - XRange = 167, - LMove = 168, - BLMove = 169, - GetDel = 170, - SRandMember = 171, - BitField = 172, - BitFieldReadOnly = 173, - Move = 174, - SInterCard = 175, - XRevRange = 176, - Copy = 178, - MSetNX = 179, - LPos = 180, - LCS = 181, - GeoSearch = 182, - Watch = 183, - UnWatch = 184, - GeoSearchStore = 185, - SUnion = 186, - Publish = 187, - SPublish = 188, - XGroupCreateConsumer = 189, - XGroupDelConsumer = 190, - RandomKey = 191, - GetEx = 192, - Dump = 193, - Restore = 194, - SortReadOnly = 195, - FunctionDump = 196, - FunctionRestore = 197, - XPending = 198, - XGroupSetId = 199, - SScan = 200, - ZScan = 201, - HScan = 202, - XAutoClaim = 203, - XInfoGroups = 204, - XInfoConsumers = 205, - XInfoStream = 207, - Scan = 206, - Wait = 208, - XClaim = 209, - PubSubChannels = 210, - PubSubNumPat = 211, - PubSubNumSub = 212, - PubSubSChannels = 213, - PubSubSNumSub = 214, - ScriptExists = 215, - ScriptFlush = 216, - ScriptKill = 217, - ScriptShow = 218, + + //// Bitmap commands + BitCount = 101, + BitField = 102, + BitFieldReadOnly = 103, + BitOp = 104, + BitPos = 105, + GetBit = 106, + SetBit = 107, + + //// Cluster commands + Asking = 201, + ClusterAddSlots = 202, + ClusterAddSlotsRange = 203, + ClusterBumpEpoch = 204, + ClusterCountFailureReports = 205, + ClusterCountKeysInSlot = 206, + ClusterDelSlots = 207, + ClusterDelSlotsRange = 208, + ClusterFailover = 209, + ClusterFlushSlots = 210, + ClusterForget = 211, + ClusterGetKeysInSlot = 212, + ClusterInfo = 213, + ClusterKeySlot = 214, + ClusterLinks = 215, + ClusterMeet = 216, + ClusterMyId = 217, + ClusterMyShardId = 218, + ClusterNodes = 219, + ClusterReplicas = 220, + ClusterReplicate = 221, + ClusterReset = 222, + ClusterSaveConfig = 223, + ClusterSetConfigEpoch = 224, + ClusterSetslot = 225, + ClusterShards = 226, + ClusterSlaves = 227, + ClusterSlots = 228, + ReadOnly = 229, + ReadWrite = 230, + + //// Connection Management commands + Auth = 301, + ClientCaching = 302, + ClientGetName = 303, + ClientGetRedir = 304, + ClientId = 305, + ClientInfo = 306, + ClientKillSimple = 307, + ClientKill = 308, + ClientList = 309, + ClientNoEvict = 310, + ClientNoTouch = 311, + ClientPause = 312, + ClientReply = 313, + ClientSetInfo = 314, + ClientSetName = 315, + ClientTracking = 316, + ClientTrackingInfo = 317, + ClientUnblock = 318, + ClientUnpause = 319, + Echo = 320, + Hello = 321, + Ping = 322, + Quit = 323, // deprecated in 7.2.0 + Reset = 324, + Select = 325, + + //// Generic commands + Copy = 401, + Del = 402, + Dump = 403, + Exists = 404, + Expire = 405, + ExpireAt = 406, + ExpireTime = 407, + Keys = 408, + Migrate = 409, + Move = 410, + ObjectEncoding = 411, + ObjectFreq = 412, + ObjectIdleTime = 413, + ObjectRefCount = 414, + Persist = 415, + PExpire = 416, + PExpireAt = 417, + PExpireTime = 418, + PTTL = 419, + RandomKey = 420, + Rename = 421, + RenameNX = 422, + Restore = 423, + Scan = 424, + Sort = 425, + SortReadOnly = 426, + Touch = 427, + TTL = 428, + Type = 429, + Unlink = 430, + Wait = 431, + WaitAof = 432, + + //// Geospatial indices commands + GeoAdd = 501, + GeoDist = 502, + GeoHash = 503, + GeoPos = 504, + GeoRadius = 505, + GeoRadiusReadOnly = 506, // deprecated in 6.2.0 + GeoRadiusByMember = 507, + GeoRadiusByMemberReadOnly = 508, // deprecated in 6.2.0 + GeoSearch = 509, + GeoSearchStore = 510, + + //// Hash commands + HDel = 601, + HExists = 602, + HGet = 603, + HGetAll = 604, + HIncrBy = 605, + HIncrByFloat = 606, + HKeys = 607, + HLen = 608, + HMGet = 609, + HMSet = 610, + HRandField = 611, + HScan = 612, + HSet = 613, + HSetNX = 614, + HStrlen = 615, + HVals = 616, + + //// HyperLogLog commands + PfAdd = 701, + PfCount = 702, + PfMerge = 703, + + //// List commands + BLMove = 801, + BLMPop = 802, + BLPop = 803, + BRPop = 804, + BRPopLPush = 805, // deprecated in 6.2.0 + LIndex = 806, + LInsert = 807, + LLen = 808, + LMove = 809, + LMPop = 810, + LPop = 811, + LPos = 812, + LPush = 813, + LPushX = 814, + LRange = 815, + LRem = 816, + LSet = 817, + LTrim = 818, + RPop = 819, + RPopLPush = 820, // deprecated in 6.2.0 + RPush = 821, + RPushX = 822, + + //// Pub/Sub commands + PSubscribe = 901, + Publish = 902, + PubSubChannels = 903, + PubSubNumPat = 904, + PubSubNumSub = 905, + PubSubShardChannels = 906, + PubSubShardNumSub = 907, + PUnsubscribe = 908, + SPublish = 909, + SSubscribe = 910, + Subscribe = 911, + SUnsubscribe = 912, + Unsubscribe = 913, + + //// Scripting and Functions commands + Eval = 1001, + EvalReadOnly = 1002, + EvalSha = 1003, + EvalShaReadOnly = 1004, + FCall = 1005, + FCallReadOnly = 1006, + FunctionDelete = 1007, + FunctionDump = 1008, + FunctionFlush = 1009, + FunctionKill = 1010, + FunctionList = 1011, + FunctionLoad = 1012, + FunctionRestore = 1013, + FunctionStats = 1014, + ScriptDebug = 1015, + ScriptExists = 1016, + ScriptFlush = 1017, + ScriptKill = 1018, + ScriptLoad = 1019, + ScriptShow = 1020, + + //// Server management commands + AclCat = 1101, + AclDelUser = 1102, + AclDryRun = 1103, + AclGenPass = 1104, + AclGetUser = 1105, + AclList = 1106, + AclLoad = 1107, + AclLog = 1108, + AclSave = 1109, + AclSetSser = 1110, + AclUsers = 1111, + AclWhoami = 1112, + BgRewriteAof = 1113, + BgSave = 1114, + Command_ = 1115, // Command - renamed to avoid collisions + CommandCount = 1116, + CommandDocs = 1117, + CommandGetKeys = 1118, + CommandGetKeysAndFlags = 1119, + CommandInfo = 1120, + CommandList = 1121, + ConfigGet = 1122, + ConfigResetStat = 1123, + ConfigRewrite = 1124, + ConfigSet = 1125, + DBSize = 1126, + FailOver = 1127, + FlushAll = 1128, + FlushDB = 1129, + Info = 1130, + LastSave = 1131, + LatencyDoctor = 1132, + LatencyGraph = 1133, + LatencyHistogram = 1134, + LatencyHistory = 1135, + LatencyLatest = 1136, + LatencyReset = 1137, + Lolwut = 1138, + MemoryDoctor = 1139, + MemoryMallocStats = 1140, + MemoryPurge = 1141, + MemoryStats = 1142, + MemoryUsage = 1143, + ModuleList = 1144, + ModuleLoad = 1145, + ModuleLoadEx = 1146, + ModuleUnload = 1147, + Monitor = 1148, + PSync = 1149, + ReplConf = 1150, + ReplicaOf = 1151, + RestoreAsking = 1152, + Role = 1153, + Save = 1154, + ShutDown = 1155, + SlaveOf = 1156, + SlowLogGet = 1157, + SlowLogLen = 1158, + SlowLogReset = 1159, + SwapDb = 1160, + Sync = 1161, + Time = 1162, + + //// Set commands + SAdd = 1201, + SCard = 1202, + SDiff = 1203, + SDiffStore = 1204, + SInter = 1205, + SInterCard = 1206, + SInterStore = 1207, + SIsMember = 1208, + SMembers = 1209, + SMIsMember = 1210, + SMove = 1211, + SPop = 1212, + SRandMember = 1213, + SRem = 1214, + SScan = 1215, + SUnion = 1216, + SUnionStore = 1217, + + //// Sorted set commands + BZMPop = 1301, + BZPopMax = 1302, + BZPopMin = 1303, + ZAdd = 1304, + ZCard = 1305, + ZCount = 1306, + ZDiff = 1307, + ZDiffStore = 1308, + ZIncrBy = 1309, + ZInter = 1310, + ZInterCard = 1311, + ZInterStore = 1312, + ZLexCount = 1313, + ZMPop = 1314, + ZMScore = 1315, + ZPopMax = 1316, + ZPopMin = 1317, + ZRandMember = 1318, + ZRange = 1319, + ZRangeByLex = 1320, + ZRangeByScore = 1321, + ZRangeStore = 1322, + ZRank = 1323, + ZRem = 1324, + ZRemRangeByLex = 1325, + ZRemRangeByRank = 1326, + ZRemRangeByScore = 1327, + ZRevRange = 1328, + ZRevRangeByLex = 1329, + ZRevRangeByScore = 1330, + ZRevRank = 1331, + ZScan = 1332, + ZScore = 1333, + ZUnion = 1334, + ZUnionStore = 1335, + + //// Stream commands + XAck = 1401, + XAdd = 1402, + XAutoClaim = 1403, + XClaim = 1404, + XDel = 1405, + XGroupCreate = 1406, + XGroupCreateConsumer = 1407, + XGroupDelConsumer = 1408, + XGroupDestroy = 1409, + XGroupSetId = 1410, + XInfoConsumers = 1411, + XInfoGroups = 1412, + XInfoStream = 1413, + XLen = 1414, + XPending = 1415, + XRange = 1416, + XRead = 1417, + XReadGroup = 1418, + XRevRange = 1419, + XSetId = 1420, + XTrim = 1421, + + //// String commands + Append = 1501, + Decr = 1502, + DecrBy = 1503, + Get = 1504, + GetDel = 1505, + GetEx = 1506, + GetRange = 1507, + GetSet = 1508, // deprecated in 6.2.0 + Incr = 1509, + IncrBy = 1510, + IncrByFloat = 1511, + LCS = 1512, + MGet = 1513, + MSet = 1514, + MSetNX = 1515, + PSetEx = 1516, // deprecated in 2.6.12 + Set = 1517, + SetEx = 1518, // deprecated in 2.6.12 + SetNX = 1519, // deprecated in 2.6.12 + SetRange = 1520, + Strlen = 1521, + Substr = 1522, + + //// Transaction commands + Discard = 1601, + Exec = 1602, + Multi = 1603, + UnWatch = 1604, + Watch = 1605, + + //// JSON commands + JsonArrAppend = 2001, + JsonArrIndex = 2002, + JsonArrInsert = 2003, + JsonArrLen = 2004, + JsonArrPop = 2005, + JsonArrTrim = 2006, + JsonClear = 2007, + JsonDebug = 2008, + JsonDel = 2009, + JsonForget = 2010, + JsonGet = 2011, + JsonMGet = 2012, + JsonNumIncrBy = 2013, + JsonNumMultBy = 2014, + JsonObjKeys = 2015, + JsonObjLen = 2016, + JsonResp = 2017, + JsonSet = 2018, + JsonStrAppend = 2019, + JsonStrLen = 2020, + JsonToggle = 2021, + JsonType = 2022, + + //// Vector Search commands + FtList = 2101, + FtAggregate = 2102, + FtAliasAdd = 2103, + FtAliasDel = 2104, + FtAliasList = 2105, + FtAliasUpdate = 2106, + FtCreate = 2107, + FtDropIndex = 2108, + FtExplain = 2109, + FtExplainCli = 2110, + FtInfo = 2111, + FtProfile = 2112, + FtSearch = 2113, } fn get_two_word_command(first: &str, second: &str) -> Cmd { @@ -451,12 +648,48 @@ impl From<::protobuf::EnumOrUnknown> for RequestType { ProtobufRequestType::PubSubChannels => RequestType::PubSubChannels, ProtobufRequestType::PubSubNumSub => RequestType::PubSubNumSub, ProtobufRequestType::PubSubNumPat => RequestType::PubSubNumPat, - ProtobufRequestType::PubSubSChannels => RequestType::PubSubSChannels, - ProtobufRequestType::PubSubSNumSub => RequestType::PubSubSNumSub, + ProtobufRequestType::PubSubShardChannels => RequestType::PubSubShardChannels, + ProtobufRequestType::PubSubShardNumSub => RequestType::PubSubShardNumSub, ProtobufRequestType::ScriptExists => RequestType::ScriptExists, ProtobufRequestType::ScriptFlush => RequestType::ScriptFlush, ProtobufRequestType::ScriptKill => RequestType::ScriptKill, ProtobufRequestType::ScriptShow => RequestType::ScriptShow, + ProtobufRequestType::JsonArrAppend => RequestType::JsonArrAppend, + ProtobufRequestType::JsonArrIndex => RequestType::JsonArrIndex, + ProtobufRequestType::JsonArrInsert => RequestType::JsonArrInsert, + ProtobufRequestType::JsonArrLen => RequestType::JsonArrLen, + ProtobufRequestType::JsonArrPop => RequestType::JsonArrPop, + ProtobufRequestType::JsonArrTrim => RequestType::JsonArrTrim, + ProtobufRequestType::JsonClear => RequestType::JsonClear, + ProtobufRequestType::JsonDebug => RequestType::JsonDebug, + ProtobufRequestType::JsonDel => RequestType::JsonDel, + ProtobufRequestType::JsonForget => RequestType::JsonForget, + ProtobufRequestType::JsonGet => RequestType::JsonGet, + ProtobufRequestType::JsonMGet => RequestType::JsonMGet, + ProtobufRequestType::JsonNumIncrBy => RequestType::JsonNumIncrBy, + ProtobufRequestType::JsonNumMultBy => RequestType::JsonNumMultBy, + ProtobufRequestType::JsonObjKeys => RequestType::JsonObjKeys, + ProtobufRequestType::JsonObjLen => RequestType::JsonObjLen, + ProtobufRequestType::JsonResp => RequestType::JsonResp, + ProtobufRequestType::JsonSet => RequestType::JsonSet, + ProtobufRequestType::JsonStrAppend => RequestType::JsonStrAppend, + ProtobufRequestType::JsonStrLen => RequestType::JsonStrLen, + ProtobufRequestType::JsonToggle => RequestType::JsonToggle, + ProtobufRequestType::JsonType => RequestType::JsonType, + ProtobufRequestType::FtList => RequestType::FtList, + ProtobufRequestType::FtAggregate => RequestType::FtAggregate, + ProtobufRequestType::FtAliasAdd => RequestType::FtAliasAdd, + ProtobufRequestType::FtAliasDel => RequestType::FtAliasDel, + ProtobufRequestType::FtAliasList => RequestType::FtAliasList, + ProtobufRequestType::FtAliasUpdate => RequestType::FtAliasUpdate, + ProtobufRequestType::FtCreate => RequestType::FtCreate, + ProtobufRequestType::FtDropIndex => RequestType::FtDropIndex, + ProtobufRequestType::FtExplain => RequestType::FtExplain, + ProtobufRequestType::FtExplainCli => RequestType::FtExplainCli, + ProtobufRequestType::FtInfo => RequestType::FtInfo, + ProtobufRequestType::FtProfile => RequestType::FtProfile, + ProtobufRequestType::FtSearch => RequestType::FtSearch, + _ => todo!(), } } } @@ -679,12 +912,50 @@ impl RequestType { RequestType::PubSubChannels => Some(get_two_word_command("PUBSUB", "CHANNELS")), RequestType::PubSubNumSub => Some(get_two_word_command("PUBSUB", "NUMSUB")), RequestType::PubSubNumPat => Some(get_two_word_command("PUBSUB", "NUMPAT")), - RequestType::PubSubSChannels => Some(get_two_word_command("PUBSUB", "SHARDCHANNELS")), - RequestType::PubSubSNumSub => Some(get_two_word_command("PUBSUB", "SHARDNUMSUB")), + RequestType::PubSubShardChannels => { + Some(get_two_word_command("PUBSUB", "SHARDCHANNELS")) + } + RequestType::PubSubShardNumSub => Some(get_two_word_command("PUBSUB", "SHARDNUMSUB")), RequestType::ScriptShow => Some(get_two_word_command("SCRIPT", "SHOW")), RequestType::ScriptExists => Some(get_two_word_command("SCRIPT", "EXISTS")), RequestType::ScriptFlush => Some(get_two_word_command("SCRIPT", "FLUSH")), RequestType::ScriptKill => Some(get_two_word_command("SCRIPT", "KILL")), + RequestType::JsonArrAppend => Some(cmd("JSON.ARRAPPEND")), + RequestType::JsonArrIndex => Some(cmd("JSON.ARRINDEX")), + RequestType::JsonArrInsert => Some(cmd("JSON.ARRINSERT")), + RequestType::JsonArrLen => Some(cmd("JSON.ARRLEN")), + RequestType::JsonArrPop => Some(cmd("JSON.ARRPOP")), + RequestType::JsonArrTrim => Some(cmd("JSON.ARRTRIM")), + RequestType::JsonClear => Some(cmd("JSON.CLEAR")), + RequestType::JsonDebug => Some(cmd("JSON.DEBUG")), + RequestType::JsonDel => Some(cmd("JSON.DEL")), + RequestType::JsonForget => Some(cmd("JSON.FORGET")), + RequestType::JsonGet => Some(cmd("JSON.GET")), + RequestType::JsonMGet => Some(cmd("JSON.MGET")), + RequestType::JsonNumIncrBy => Some(cmd("JSON.NUMINCRBY")), + RequestType::JsonNumMultBy => Some(cmd("JSON.NUMMULTBY")), + RequestType::JsonObjKeys => Some(cmd("JSON.OBJKEYS")), + RequestType::JsonObjLen => Some(cmd("JSON.OBJLEN")), + RequestType::JsonResp => Some(cmd("JSON.RESP")), + RequestType::JsonSet => Some(cmd("JSON.SET")), + RequestType::JsonStrAppend => Some(cmd("JSON.STRAPPEND")), + RequestType::JsonStrLen => Some(cmd("JSON.STRLEN")), + RequestType::JsonToggle => Some(cmd("JSON.TOGGLE")), + RequestType::JsonType => Some(cmd("JSON.TYPE")), + RequestType::FtList => Some(cmd("FT._LIST")), + RequestType::FtAggregate => Some(cmd("FT.AGGREGATE")), + RequestType::FtAliasAdd => Some(cmd("FT.ALIASADD")), + RequestType::FtAliasDel => Some(cmd("FT.ALIASDEL")), + RequestType::FtAliasList => Some(cmd("FT._ALIASLIST")), + RequestType::FtAliasUpdate => Some(cmd("FT.ALIASUPDATE")), + RequestType::FtCreate => Some(cmd("FT.CREATE")), + RequestType::FtDropIndex => Some(cmd("FT.DROPINDEX")), + RequestType::FtExplain => Some(cmd("FT.EXPLAIN")), + RequestType::FtExplainCli => Some(cmd("FT.EXPLAINCLI")), + RequestType::FtInfo => Some(cmd("FT.INFO")), + RequestType::FtProfile => Some(cmd("FT.PROFILE")), + RequestType::FtSearch => Some(cmd("FT.SEARCH")), + _ => todo!(), } } } diff --git a/java/client/src/main/java/glide/api/GlideClusterClient.java b/java/client/src/main/java/glide/api/GlideClusterClient.java index 056fe49b15..241f270409 100644 --- a/java/client/src/main/java/glide/api/GlideClusterClient.java +++ b/java/client/src/main/java/glide/api/GlideClusterClient.java @@ -26,8 +26,8 @@ import static command_request.CommandRequestOuterClass.RequestType.LastSave; import static command_request.CommandRequestOuterClass.RequestType.Lolwut; import static command_request.CommandRequestOuterClass.RequestType.Ping; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSChannels; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSNumSub; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardChannels; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardNumSub; import static command_request.CommandRequestOuterClass.RequestType.RandomKey; import static command_request.CommandRequestOuterClass.RequestType.SPublish; import static command_request.CommandRequestOuterClass.RequestType.ScriptExists; @@ -1125,7 +1125,7 @@ public CompletableFuture publish( @Override public CompletableFuture pubsubShardChannels() { return commandManager.submitNewCommand( - PubSubSChannels, + PubSubShardChannels, new String[0], response -> castArray(handleArrayResponse(response), String.class)); } @@ -1133,7 +1133,7 @@ public CompletableFuture pubsubShardChannels() { @Override public CompletableFuture pubsubShardChannelsBinary() { return commandManager.submitNewCommand( - PubSubSChannels, + PubSubShardChannels, new GlideString[0], response -> castArray(handleArrayResponseBinary(response), GlideString.class)); } @@ -1141,7 +1141,7 @@ public CompletableFuture pubsubShardChannelsBinary() { @Override public CompletableFuture pubsubShardChannels(@NonNull String pattern) { return commandManager.submitNewCommand( - PubSubSChannels, + PubSubShardChannels, new String[] {pattern}, response -> castArray(handleArrayResponse(response), String.class)); } @@ -1149,21 +1149,21 @@ public CompletableFuture pubsubShardChannels(@NonNull String pattern) @Override public CompletableFuture pubsubShardChannels(@NonNull GlideString pattern) { return commandManager.submitNewCommand( - PubSubSChannels, + PubSubShardChannels, new GlideString[] {pattern}, response -> castArray(handleArrayResponseBinary(response), GlideString.class)); } @Override public CompletableFuture> pubsubShardNumSub(@NonNull String[] channels) { - return commandManager.submitNewCommand(PubSubSNumSub, channels, this::handleMapResponse); + return commandManager.submitNewCommand(PubSubShardNumSub, channels, this::handleMapResponse); } @Override public CompletableFuture> pubsubShardNumSub( @NonNull GlideString[] channels) { return commandManager.submitNewCommand( - PubSubSNumSub, channels, this::handleBinaryStringMapResponse); + PubSubShardNumSub, channels, this::handleBinaryStringMapResponse); } @Override diff --git a/java/client/src/main/java/glide/api/models/ClusterTransaction.java b/java/client/src/main/java/glide/api/models/ClusterTransaction.java index 15981c7f1a..6252d69d36 100644 --- a/java/client/src/main/java/glide/api/models/ClusterTransaction.java +++ b/java/client/src/main/java/glide/api/models/ClusterTransaction.java @@ -1,8 +1,8 @@ /** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */ package glide.api.models; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSChannels; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSNumSub; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardChannels; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardNumSub; import static command_request.CommandRequestOuterClass.RequestType.SPublish; import glide.api.GlideClusterClient; @@ -71,7 +71,8 @@ public ClusterTransaction publish( */ public ClusterTransaction pubsubShardNumSub(@NonNull ArgType[] channels) { checkTypeOrThrow(channels); - protobufTransaction.addCommands(buildCommand(PubSubSNumSub, newArgsBuilder().add(channels))); + protobufTransaction.addCommands( + buildCommand(PubSubShardNumSub, newArgsBuilder().add(channels))); return getThis(); } @@ -82,7 +83,7 @@ public ClusterTransaction pubsubShardNumSub(@NonNull ArgType[] channel * @return Command response - An Array of all active shard channels. */ public ClusterTransaction pubsubShardChannels() { - protobufTransaction.addCommands(buildCommand(PubSubSChannels)); + protobufTransaction.addCommands(buildCommand(PubSubShardChannels)); return getThis(); } @@ -97,7 +98,8 @@ public ClusterTransaction pubsubShardChannels() { */ public ClusterTransaction pubsubShardChannels(@NonNull ArgType pattern) { checkTypeOrThrow(pattern); - protobufTransaction.addCommands(buildCommand(PubSubSChannels, newArgsBuilder().add(pattern))); + protobufTransaction.addCommands( + buildCommand(PubSubShardChannels, newArgsBuilder().add(pattern))); return getThis(); } } diff --git a/java/client/src/test/java/glide/api/GlideClusterClientTest.java b/java/client/src/test/java/glide/api/GlideClusterClientTest.java index 4ab42385b3..61f4ffdf96 100644 --- a/java/client/src/test/java/glide/api/GlideClusterClientTest.java +++ b/java/client/src/test/java/glide/api/GlideClusterClientTest.java @@ -25,8 +25,8 @@ import static command_request.CommandRequestOuterClass.RequestType.LastSave; import static command_request.CommandRequestOuterClass.RequestType.Lolwut; import static command_request.CommandRequestOuterClass.RequestType.Ping; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSChannels; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSNumSub; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardChannels; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardNumSub; import static command_request.CommandRequestOuterClass.RequestType.RandomKey; import static command_request.CommandRequestOuterClass.RequestType.SPublish; import static command_request.CommandRequestOuterClass.RequestType.ScriptExists; @@ -2741,7 +2741,7 @@ public void pubsubShardChannels_returns_success() { testResponse.complete(value); // match on protobuf request - when(commandManager.submitNewCommand(eq(PubSubSChannels), eq(arguments), any())) + when(commandManager.submitNewCommand(eq(PubSubShardChannels), eq(arguments), any())) .thenReturn(testResponse); // exercise @@ -2764,7 +2764,8 @@ public void pubsubShardChannelsBinary_returns_success() { testResponse.complete(value); // match on protobuf request - when(commandManager.submitNewCommand(eq(PubSubSChannels), eq(arguments), any())) + when(commandManager.submitNewCommand( + eq(PubSubShardChannels), eq(arguments), any())) .thenReturn(testResponse); // exercise @@ -2788,7 +2789,7 @@ public void pubsubShardChannels_with_pattern_returns_success() { testResponse.complete(value); // match on protobuf request - when(commandManager.submitNewCommand(eq(PubSubSChannels), eq(arguments), any())) + when(commandManager.submitNewCommand(eq(PubSubShardChannels), eq(arguments), any())) .thenReturn(testResponse); // exercise @@ -2812,7 +2813,8 @@ public void pubsubShardChannelsBinary_with_pattern_returns_success() { testResponse.complete(value); // match on protobuf request - when(commandManager.submitNewCommand(eq(PubSubSChannels), eq(arguments), any())) + when(commandManager.submitNewCommand( + eq(PubSubShardChannels), eq(arguments), any())) .thenReturn(testResponse); // exercise @@ -2836,7 +2838,7 @@ public void pubsubShardNumSub_returns_success() { // match on protobuf request when(commandManager.>submitNewCommand( - eq(PubSubSNumSub), eq(arguments), any())) + eq(PubSubShardNumSub), eq(arguments), any())) .thenReturn(testResponse); // exercise @@ -2860,7 +2862,7 @@ public void pubsubShardNumSub_binary_returns_success() { // match on protobuf request when(commandManager.>submitNewCommand( - eq(PubSubSNumSub), eq(arguments), any())) + eq(PubSubShardNumSub), eq(arguments), any())) .thenReturn(testResponse); // exercise diff --git a/java/client/src/test/java/glide/api/models/ClusterTransactionTests.java b/java/client/src/test/java/glide/api/models/ClusterTransactionTests.java index 869583796c..2641835081 100644 --- a/java/client/src/test/java/glide/api/models/ClusterTransactionTests.java +++ b/java/client/src/test/java/glide/api/models/ClusterTransactionTests.java @@ -1,8 +1,8 @@ /** Copyright Valkey GLIDE Project Contributors - SPDX Identifier: Apache-2.0 */ package glide.api.models; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSChannels; -import static command_request.CommandRequestOuterClass.RequestType.PubSubSNumSub; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardChannels; +import static command_request.CommandRequestOuterClass.RequestType.PubSubShardNumSub; import static command_request.CommandRequestOuterClass.RequestType.SPublish; import static command_request.CommandRequestOuterClass.RequestType.Sort; import static command_request.CommandRequestOuterClass.RequestType.SortReadOnly; @@ -34,13 +34,13 @@ public void cluster_transaction_builds_protobuf_request() { results.add(Pair.of(SPublish, buildArgs("ch1", "msg"))); transaction.pubsubShardChannels(); - results.add(Pair.of(PubSubSChannels, buildArgs())); + results.add(Pair.of(PubSubShardChannels, buildArgs())); transaction.pubsubShardChannels("test*"); - results.add(Pair.of(PubSubSChannels, buildArgs("test*"))); + results.add(Pair.of(PubSubShardChannels, buildArgs("test*"))); transaction.pubsubShardNumSub(new String[] {"ch1", "ch2"}); - results.add(Pair.of(PubSubSNumSub, buildArgs("ch1", "ch2"))); + results.add(Pair.of(PubSubShardNumSub, buildArgs("ch1", "ch2"))); transaction.sortReadOnly( "key1", diff --git a/node/src/Commands.ts b/node/src/Commands.ts index 811504301c..8411cf212d 100644 --- a/node/src/Commands.ts +++ b/node/src/Commands.ts @@ -3994,7 +3994,10 @@ export function createPubSubNumSub( export function createPubsubShardChannels( pattern?: GlideString, ): command_request.Command { - return createCommand(RequestType.PubSubSChannels, pattern ? [pattern] : []); + return createCommand( + RequestType.PubSubShardChannels, + pattern ? [pattern] : [], + ); } /** @@ -4003,7 +4006,10 @@ export function createPubsubShardChannels( export function createPubSubShardNumSub( channels?: GlideString[], ): command_request.Command { - return createCommand(RequestType.PubSubSNumSub, channels ? channels : []); + return createCommand( + RequestType.PubSubShardNumSub, + channels ? channels : [], + ); } /** diff --git a/python/python/glide/async_commands/cluster_commands.py b/python/python/glide/async_commands/cluster_commands.py index e9904af8ac..584091ab32 100644 --- a/python/python/glide/async_commands/cluster_commands.py +++ b/python/python/glide/async_commands/cluster_commands.py @@ -814,7 +814,7 @@ async def pubsub_shardchannels( command_args = [pattern] if pattern is not None else [] return cast( List[bytes], - await self._execute_command(RequestType.PubSubSChannels, command_args), + await self._execute_command(RequestType.PubSubShardChannels, command_args), ) async def pubsub_shardnumsub( @@ -845,7 +845,7 @@ async def pubsub_shardnumsub( return cast( Mapping[bytes, int], await self._execute_command( - RequestType.PubSubSNumSub, channels if channels else [] + RequestType.PubSubShardNumSub, channels if channels else [] ), ) diff --git a/python/python/glide/async_commands/transaction.py b/python/python/glide/async_commands/transaction.py index 0e87f26dcd..9bb72770e3 100644 --- a/python/python/glide/async_commands/transaction.py +++ b/python/python/glide/async_commands/transaction.py @@ -5185,7 +5185,7 @@ def pubsub_shardchannels( If no pattern is specified, all active shard channels are returned. """ command_args = [pattern] if pattern is not None else [] - return self.append_command(RequestType.PubSubSChannels, command_args) + return self.append_command(RequestType.PubSubShardChannels, command_args) def pubsub_shardnumsub( self, channels: Optional[List[TEncodable]] = None @@ -5205,7 +5205,7 @@ def pubsub_shardnumsub( Mapping[bytes, int]: A map where keys are the shard channel names and values are the number of subscribers. """ return self.append_command( - RequestType.PubSubSNumSub, channels if channels else [] + RequestType.PubSubShardNumSub, channels if channels else [] ) # TODO: add all CLUSTER commands diff --git a/python/python/tests/test_proto_coded.py b/python/python/tests/test_proto_coded.py index 3834e5d1dc..96bc7bc0a9 100644 --- a/python/python/tests/test_proto_coded.py +++ b/python/python/tests/test_proto_coded.py @@ -21,7 +21,7 @@ def test_encode_decode_delimited(self): b_arr = bytearray() ProtobufCodec.encode_delimited(b_arr, request) msg_len_varint = int(b_arr[0]) - assert msg_len_varint == 18 + assert msg_len_varint == 19 assert len(b_arr) == msg_len_varint + 1 offset = 0 b_arr_view = memoryview(b_arr)