@@ -186,7 +186,7 @@ public String getName() {
186
186
return name ;
187
187
}
188
188
189
- public Object [] getParams (final Object [] origParams , final Connection connection ) {
189
+ private Object [] getParams (final Object [] origParams , final Connection connection ) {
190
190
final Object [] ps = new Object [params .size ()];
191
191
192
192
int i = 0 ;
@@ -207,10 +207,6 @@ public Object[] getParams(final Object[] origParams, final Connection connection
207
207
return ps ;
208
208
}
209
209
210
- public int [] getTypes () {
211
- return types ;
212
- }
213
-
214
210
private static int [] createTypes (final List <StoredProcedureParameter > params ) {
215
211
int [] types = new int [params .size ()];
216
212
int i = 0 ;
@@ -220,7 +216,7 @@ private static int[] createTypes(final List<StoredProcedureParameter> params) {
220
216
return types ;
221
217
}
222
218
223
- public int getShardId (final Object [] objs ) {
219
+ private int getShardId (final Object [] objs ) {
224
220
if (shardKeyParameters .isEmpty ()) {
225
221
return shardStrategy .getShardId (null );
226
222
}
@@ -245,10 +241,6 @@ public String getSqlParameterList() {
245
241
return sqlParameterList ;
246
242
}
247
243
248
- public String getQuery () {
249
- return query ;
250
- }
251
-
252
244
private static String createSqlParameterList (final List <StoredProcedureParameter > params ) {
253
245
String s = "" ;
254
246
boolean first = true ;
@@ -476,7 +468,7 @@ public Object execute(final DataSourceProvider dp, final InvocationContext invoc
476
468
}
477
469
478
470
// most common case: only one shard and no argument partitioning
479
- return executor .executeSProc (firstDs , getQuery () , paramValues .get (0 ), getTypes () , invocation , returnType );
471
+ return executor .executeSProc (firstDs , query , paramValues .get (0 ), types , invocation , returnType );
480
472
} else {
481
473
Map <Integer , SameConnectionDatasource > transactionalDatasources = null ;
482
474
try {
@@ -561,12 +553,12 @@ private Object executeSequential(final DataSourceProvider dp, final InvocationCo
561
553
562
554
sprocResult = null ;
563
555
try {
564
- sprocResult = executor .executeSProc (shardDs , getQuery () , paramValues .get (i ), getTypes () , invocation ,
556
+ sprocResult = executor .executeSProc (shardDs , query , paramValues .get (i ), types , invocation ,
565
557
returnType );
566
558
} catch (final Exception e ) {
567
559
568
560
// remember all exceptions and go on
569
- exceptions .add ("shardId: " + shardId + ", message: " + e .getMessage () + ", query: " + getQuery () );
561
+ exceptions .add ("shardId: " + shardId + ", message: " + e .getMessage () + ", query: " + query );
570
562
causes .put (shardId , e );
571
563
}
572
564
@@ -603,9 +595,9 @@ private Object executeInParallel(final DataSourceProvider dp, final InvocationCo
603
595
final FutureTask <Object > task = new FutureTask <>(new Call (
604
596
executor ,
605
597
shardDs ,
606
- getQuery () ,
598
+ query ,
607
599
paramValues .get (i ),
608
- getTypes () ,
600
+ types ,
609
601
invocation ,
610
602
returnType
611
603
));
@@ -623,13 +615,13 @@ private Object executeInParallel(final DataSourceProvider dp, final InvocationCo
623
615
} catch (final InterruptedException ex ) {
624
616
625
617
// remember all exceptions and go on
626
- exceptions .add ("got sharding execution exception: " + ex .getMessage () + ", query: " + getQuery () );
618
+ exceptions .add ("got sharding execution exception: " + ex .getMessage () + ", query: " + query );
627
619
causes .put (taskToFinish .getKey (), ex );
628
620
} catch (final ExecutionException ex ) {
629
621
630
622
// remember all exceptions and go on
631
623
exceptions .add ("got sharding execution exception: " + ex .getCause ().getMessage () + ", query: "
632
- + getQuery () );
624
+ + query );
633
625
causes .put (taskToFinish .getKey (), ex .getCause ());
634
626
}
635
627
0 commit comments