File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Expand file tree Collapse file tree 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';
4646import * as CLUSTER_LINKS from '../commands/CLUSTER_LINKS' ;
4747import * as CLUSTER_MEET from '../commands/CLUSTER_MEET' ;
4848import * as CLUSTER_MYID from '../commands/CLUSTER_MYID' ;
49+ import * as CLUSTER_MYSHARDID from '../commands/CLUSTER_MYSHARDID' ;
4950import * as CLUSTER_NODES from '../commands/CLUSTER_NODES' ;
5051import * as CLUSTER_REPLICAS from '../commands/CLUSTER_REPLICAS' ;
5152import * as CLUSTER_REPLICATE from '../commands/CLUSTER_REPLICATE' ;
@@ -216,6 +217,8 @@ export default {
216217 clusterMeet : CLUSTER_MEET ,
217218 CLUSTER_MYID ,
218219 clusterMyId : CLUSTER_MYID ,
220+ CLUSTER_MYSHARDID ,
221+ clusterMyShardId : CLUSTER_MYSHARDID ,
219222 CLUSTER_NODES ,
220223 clusterNodes : CLUSTER_NODES ,
221224 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