@@ -44,7 +44,7 @@ public class UnifiedJedis implements JedisCommands, JedisBinaryCommands,
44
44
protected final ConnectionProvider provider ;
45
45
protected final CommandExecutor executor ;
46
46
private final CommandObjects commandObjects ;
47
- private final GraphCommandObjects graphCommandObjects = new GraphCommandObjects ( this ) ;
47
+ private final GraphCommandObjects graphCommandObjects ;
48
48
private JedisBroadcastAndRoundRobinConfig broadcastAndRoundRobinConfig = null ;
49
49
50
50
public UnifiedJedis () {
@@ -87,6 +87,8 @@ public UnifiedJedis(ConnectionProvider provider) {
87
87
this .provider = provider ;
88
88
this .executor = new DefaultCommandExecutor (provider );
89
89
this .commandObjects = new CommandObjects ();
90
+ this .graphCommandObjects = new GraphCommandObjects (this );
91
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
90
92
}
91
93
92
94
/**
@@ -109,6 +111,7 @@ public UnifiedJedis(Connection connection) {
109
111
this .provider = null ;
110
112
this .executor = new SimpleCommandExecutor (connection );
111
113
this .commandObjects = new CommandObjects ();
114
+ this .graphCommandObjects = new GraphCommandObjects (this );
112
115
}
113
116
114
117
public UnifiedJedis (Set <HostAndPort > jedisClusterNodes , JedisClientConfig clientConfig , int maxAttempts ) {
@@ -129,24 +132,32 @@ public UnifiedJedis(ClusterConnectionProvider provider, int maxAttempts, Duratio
129
132
this .provider = provider ;
130
133
this .executor = new ClusterCommandExecutor (provider , maxAttempts , maxTotalRetriesDuration );
131
134
this .commandObjects = new ClusterCommandObjects ();
135
+ this .graphCommandObjects = new GraphCommandObjects (this );
136
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
132
137
}
133
138
134
139
public UnifiedJedis (ShardedConnectionProvider provider ) {
135
140
this .provider = provider ;
136
141
this .executor = new DefaultCommandExecutor (provider );
137
142
this .commandObjects = new ShardedCommandObjects (provider .getHashingAlgo ());
143
+ this .graphCommandObjects = new GraphCommandObjects (this );
144
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
138
145
}
139
146
140
147
public UnifiedJedis (ShardedConnectionProvider provider , Pattern tagPattern ) {
141
148
this .provider = provider ;
142
149
this .executor = new DefaultCommandExecutor (provider );
143
150
this .commandObjects = new ShardedCommandObjects (provider .getHashingAlgo (), tagPattern );
151
+ this .graphCommandObjects = new GraphCommandObjects (this );
152
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
144
153
}
145
154
146
155
public UnifiedJedis (ConnectionProvider provider , int maxAttempts , Duration maxTotalRetriesDuration ) {
147
156
this .provider = provider ;
148
157
this .executor = new RetryableCommandExecutor (provider , maxAttempts , maxTotalRetriesDuration );
149
158
this .commandObjects = new CommandObjects ();
159
+ this .graphCommandObjects = new GraphCommandObjects (this );
160
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
150
161
}
151
162
152
163
/**
@@ -159,6 +170,8 @@ public UnifiedJedis(CommandExecutor executor) {
159
170
this .provider = null ;
160
171
this .executor = executor ;
161
172
this .commandObjects = new CommandObjects ();
173
+ this .graphCommandObjects = new GraphCommandObjects (this );
174
+ this .graphCommandObjects .setBaseCommandArgumentsCreator ((comm ) -> this .commandObjects .commandArguments (comm ));
162
175
}
163
176
164
177
@ Override
0 commit comments