File tree 3 files changed +32
-0
lines changed
3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ import * as CLUSTER_KEYSLOT from '../commands/CLUSTER_KEYSLOT';
46
46
import * as CLUSTER_LINKS from '../commands/CLUSTER_LINKS' ;
47
47
import * as CLUSTER_MEET from '../commands/CLUSTER_MEET' ;
48
48
import * as CLUSTER_MYID from '../commands/CLUSTER_MYID' ;
49
+ import * as CLUSTER_MYSHARDID from '../commands/CLUSTER_MYSHARDID' ;
49
50
import * as CLUSTER_NODES from '../commands/CLUSTER_NODES' ;
50
51
import * as CLUSTER_REPLICAS from '../commands/CLUSTER_REPLICAS' ;
51
52
import * as CLUSTER_REPLICATE from '../commands/CLUSTER_REPLICATE' ;
@@ -216,6 +217,8 @@ export default {
216
217
clusterMeet : CLUSTER_MEET ,
217
218
CLUSTER_MYID ,
218
219
clusterMyId : CLUSTER_MYID ,
220
+ CLUSTER_MYSHARDID ,
221
+ clusterMyShardId : CLUSTER_MYSHARDID ,
219
222
CLUSTER_NODES ,
220
223
clusterNodes : CLUSTER_NODES ,
221
224
CLUSTER_REPLICAS ,
Original file line number Diff line number Diff line change
1
+ import { strict as assert } from 'assert' ;
2
+ import testUtils , { GLOBAL } from '../test-utils' ;
3
+ import { transformArguments } from './CLUSTER_MYSHARDID' ;
4
+
5
+ describe ( 'CLUSTER MYSHARDID' , ( ) => {
6
+ testUtils . isVersionGreaterThanHook ( [ 7 , 2 ] ) ;
7
+
8
+ it ( 'transformArguments' , ( ) => {
9
+ assert . deepEqual (
10
+ transformArguments ( ) ,
11
+ [ 'CLUSTER' , 'MYSHARDID' ]
12
+ ) ;
13
+ } ) ;
14
+
15
+ testUtils . testWithCluster ( 'clusterNode.clusterMyShardId' , async cluster => {
16
+ const client = await cluster . nodeClient ( cluster . masters [ 0 ] ) ;
17
+ assert . equal (
18
+ typeof await client . clusterMyShardId ( ) ,
19
+ 'string'
20
+ ) ;
21
+ } , GLOBAL . CLUSTERS . OPEN ) ;
22
+ } ) ;
Original file line number Diff line number Diff line change
1
+ export const IS_READ_ONLY = true ;
2
+
3
+ export function transformArguments ( ) {
4
+ return [ 'CLUSTER' , 'MYSHARDID' ] ;
5
+ }
6
+
7
+ export declare function transformReply ( ) : string | Buffer ;
You can’t perform that action at this time.
0 commit comments