@@ -622,7 +622,7 @@ public DBConnection(boolean asynchronousTask, boolean useSSL, boolean compress,
622
622
}
623
623
624
624
/**
625
- * This method has been deprecated since 'Java API 1.30.22.4' and will be privated in the next version: 'Java API xxx' .
625
+ * This method has been deprecated since 'Java API 1.30.22.4'.
626
626
* @param asynchronousTask
627
627
* @param useSSL
628
628
* @param compress
@@ -1031,7 +1031,7 @@ public Entity tryRun(String script, int priority, int parallelism,int fetchSize,
1031
1031
}
1032
1032
1033
1033
public Entity run (String script , String tableName ) throws IOException {
1034
- return run (script , (ProgressListener ) null , DEFAULT_PRIORITY , DEFAULT_PARALLELISM , 0 , false , tableName , true );
1034
+ return run (script , (ProgressListener ) null , DEFAULT_PRIORITY , DEFAULT_PARALLELISM , 0 , false , tableName );
1035
1035
}
1036
1036
1037
1037
public Entity run (String script ) throws IOException {
@@ -1089,7 +1089,7 @@ public Entity run(String script, boolean clearSessionMemory) throws IOException
1089
1089
}
1090
1090
1091
1091
public Entity run (String script , ProgressListener listener , int priority , int parallelism , int fetchSize , boolean clearSessionMemory ) throws IOException {
1092
- return run (script , listener , priority , parallelism , fetchSize , clearSessionMemory , "" , true );
1092
+ return run (script , listener , priority , parallelism , fetchSize , clearSessionMemory , "" );
1093
1093
}
1094
1094
1095
1095
public Entity run (String script , ProgressListener listener , int priority , int parallelism , int fetchSize , boolean clearSessionMemory , String tableName , boolean enableSeqNo ) throws IOException {
@@ -1130,7 +1130,38 @@ else if (type == ExceptionType.ET_UNKNOW)
1130
1130
}
1131
1131
}
1132
1132
1133
-
1133
+ public Entity run (String script , ProgressListener listener , int priority , int parallelism , int fetchSize , boolean clearSessionMemory , String tableName ) throws IOException {
1134
+ mutex_ .lock ();
1135
+ try {
1136
+ if (!nodes_ .isEmpty ()) {
1137
+ long curSeqNo = newSeqNo ();
1138
+ while (!closed_ ) {
1139
+ try {
1140
+ return conn_ .run (script , listener , priority , parallelism , fetchSize , clearSessionMemory , tableName , curSeqNo );
1141
+ } catch (IOException e ) {
1142
+ if (curSeqNo >0 )
1143
+ curSeqNo = -curSeqNo ;
1144
+ Node node = new Node ();
1145
+ if (connected ()) {
1146
+ ExceptionType type = parseException (e .getMessage (), node );
1147
+ if (type == ExceptionType .ET_IGNORE )
1148
+ return new Void ();
1149
+ else if (type == ExceptionType .ET_UNKNOW )
1150
+ throw e ;
1151
+ }else {
1152
+ parseException (e .getMessage (), node );
1153
+ }
1154
+ switchDataNode (node );
1155
+ }
1156
+ }
1157
+ return null ;
1158
+ } else {
1159
+ return conn_ .run (script , listener , priority , parallelism , fetchSize , clearSessionMemory , tableName , 0 );
1160
+ }
1161
+ } finally {
1162
+ mutex_ .unlock ();
1163
+ }
1164
+ }
1134
1165
1135
1166
public Entity tryRun (String function , List <Entity > arguments ) throws IOException {
1136
1167
return tryRun (function , arguments , DEFAULT_PRIORITY , DEFAULT_PARALLELISM );
@@ -1143,7 +1174,7 @@ public Entity tryRun(String function, List<Entity> arguments, int priority, int
1143
1174
if (!mutex_ .tryLock ())
1144
1175
return null ;
1145
1176
try {
1146
- return run (function , arguments , priority , parallelism , fetchSize , true );
1177
+ return run (function , arguments , priority , parallelism , fetchSize );
1147
1178
} finally {
1148
1179
mutex_ .unlock ();
1149
1180
}
@@ -1158,7 +1189,7 @@ public Entity run(String function, List<Entity> arguments, int priority) throws
1158
1189
}
1159
1190
1160
1191
public Entity run (String function , List <Entity > arguments , int priority , int parallelism ) throws IOException {
1161
- return run (function , arguments , priority , parallelism , 0 , true );
1192
+ return run (function , arguments , priority , parallelism , 0 );
1162
1193
}
1163
1194
private long newSeqNo (){
1164
1195
mutex_ .lock ();
@@ -1209,7 +1240,38 @@ else if (type == ExceptionType.ET_UNKNOW)
1209
1240
}
1210
1241
}
1211
1242
1212
-
1243
+ public Entity run (String function , List <Entity > arguments , int priority , int parallelism , int fetchSize ) throws IOException {
1244
+ mutex_ .lock ();
1245
+ try {
1246
+ if (!nodes_ .isEmpty ()){
1247
+ long seqNo = newSeqNo ();
1248
+ while (!closed_ ){
1249
+ try {
1250
+ return conn_ .run (function , (ProgressListener )null , arguments , priority , parallelism , fetchSize , false ,seqNo );
1251
+ }catch (IOException e ){
1252
+ if (seqNo > 0 )
1253
+ seqNo = -seqNo ;
1254
+ Node node = new Node ();
1255
+ if (connected ()){
1256
+ ExceptionType type = parseException (e .getMessage (), node );
1257
+ if (type == ExceptionType .ET_IGNORE )
1258
+ return new Void ();
1259
+ else if (type == ExceptionType .ET_UNKNOW )
1260
+ throw e ;
1261
+ }else {
1262
+ parseException (e .getMessage (), node );
1263
+ }
1264
+ switchDataNode (node );
1265
+ }
1266
+ }
1267
+ return null ;
1268
+ }else {
1269
+ return conn_ .run (function , (ProgressListener )null , arguments , priority , parallelism , fetchSize , false , 0 );
1270
+ }
1271
+ }finally {
1272
+ mutex_ .unlock ();
1273
+ }
1274
+ }
1213
1275
1214
1276
public void tryUpload (final Map <String , Entity > variableObjectMap ) throws IOException {
1215
1277
if (!mutex_ .tryLock ())
0 commit comments