Skip to content

Commit 5476f04

Browse files
release300.1.1
1 parent 6b37910 commit 5476f04

10 files changed

+256
-165
lines changed

src/BasicDBTask.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void finish()
3434
{
3535
semaphore.Release();
3636
}
37-
public BasicDBTask(string script, List<IEntity> args, int priority = 4, int parallelism = 2, bool clearMemory = false)
37+
public BasicDBTask(string script, List<IEntity> args, int priority = 4, int parallelism = 64, bool clearMemory = false)
3838
{
3939
semaphore.WaitOne();
4040
this.script = script;
@@ -43,7 +43,7 @@ public BasicDBTask(string script, List<IEntity> args, int priority = 4, int para
4343
this.priority_ = priority;
4444
this.parallelism_ = parallelism;
4545
}
46-
public BasicDBTask(string script, int priority = 4, int parallelism = 2, bool clearMemory = false)
46+
public BasicDBTask(string script, int priority = 4, int parallelism = 64, bool clearMemory = false)
4747
{
4848
semaphore.WaitOne();
4949
this.script = script;

src/DBConnection.cs

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,17 @@ public void login()
309309
}
310310
}
311311

312-
public IEntity run(string script, ProgressListener listener = null, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
312+
public IEntity run(string script, ProgressListener listener = null, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
313313
{
314-
return run(script, "script", null, null, priority, parallelism, fetchSize, clearMemory);
314+
return runInternal(script, "script", null, null, priority, parallelism, fetchSize, clearMemory);
315315
}
316316

317-
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
317+
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
318318
{
319-
return run(function, "function", null, arguments, priority, parallelism, fetchSize, clearMemory);
319+
return runInternal(function, "function", null, arguments, priority, parallelism, fetchSize, clearMemory);
320320
}
321321

322-
private IEntity run(string script, string scriptType, IList<IEntity> arguments, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
323-
{
324-
return run(script, scriptType, null, arguments, priority, parallelism, fetchSize, clearMemory);
325-
}
326-
327-
private IEntity run(string script, string scriptType, ProgressListener listener = null, IList<IEntity> arguments = null, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
322+
private IEntity runInternal(string script, string scriptType, ProgressListener listener = null, IList<IEntity> arguments = null, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
328323
{
329324
try
330325
{
@@ -446,7 +441,7 @@ public void upload(IDictionary<string, IEntity> variableObjectMap)
446441
varNames.Append(key + ",");
447442
objects.Add(variableObjectMap[key]);
448443
}
449-
run(varNames.ToString(), "variable", objects);
444+
runInternal(varNames.ToString(), "variable", null, objects);
450445
}
451446

452447
private bool isVariableCandidate(string word)
@@ -724,7 +719,7 @@ public virtual IEntity tryRun(string script)
724719
}
725720
try
726721
{
727-
return run(script);
722+
return runInternal(script);
728723
}
729724
catch
730725
{
@@ -733,13 +728,13 @@ public virtual IEntity tryRun(string script)
733728
}
734729

735730
#if NETCOREAPP
736-
public async Task<IEntity> runAsync(string script, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
731+
public async Task<IEntity> runAsync(string script, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
737732
{
738733
IEntity result = await Task.Run(() => run(script, priority, parallelism, fetchSize, clearMemory));
739734
return result;
740735
}
741736

742-
public async Task<IEntity> runAsync(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
737+
public async Task<IEntity> runAsync(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
743738
{
744739
IEntity result = await Task.Run(() => run(function, arguments, priority, parallelism, fetchSize, clearMemory));
745740
return result;
@@ -748,22 +743,22 @@ public async Task<IEntity> runAsync(string function, IList<IEntity> arguments, i
748743

749744
public IEntity run(string script)
750745
{
751-
return run(script, (ProgressListener)null);
746+
return runInternal(script, (ProgressListener)null);
752747
}
753748

754749
public IEntity run(string script, ProgressListener listener)
755750
{
756-
return run(script, listener, false);
751+
return runInternal(script, listener);
757752
}
758753

759754
public IEntity run(string script, bool clearSessionMemory)
760755
{
761-
return run(script, (ProgressListener)null, clearSessionMemory);
756+
return runInternal(script, (ProgressListener)null, 4, 64, 0, clearSessionMemory);
762757
}
763758

764759
public IEntity run(string script, ProgressListener listener, bool clearSessionMemory)
765760
{
766-
return run(script, listener, 4, 2, 0, clearSessionMemory);
761+
return runInternal(script, listener, 4, 64, 0, clearSessionMemory);
767762
}
768763

769764
public IEntity tryRun(string function, IList<IEntity> arguments)
@@ -781,12 +776,16 @@ public IEntity tryRun(string function, IList<IEntity> arguments)
781776
}
782777
}
783778

784-
public IEntity run(string script, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
779+
public IEntity run(string script, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
785780
{
786-
return run(script, (ProgressListener)null, priority, parallelism, fetchSize, clearMemory);
781+
return runInternal(script, (ProgressListener)null, priority, parallelism, fetchSize, clearMemory);
782+
}
783+
784+
public IEntity run(string script, ProgressListener listener = null, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false){
785+
return runInternal(script, listener, priority, parallelism, fetchSize, clearMemory);
787786
}
788787

789-
public IEntity run(string script, ProgressListener listener = null, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
788+
private IEntity runInternal(string script, ProgressListener listener = null, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
790789
{
791790
lock (threadLock_)
792791
{
@@ -825,7 +824,13 @@ public IEntity run(string script, ProgressListener listener = null, int priority
825824
}
826825
}
827826
}
828-
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, int fetchSize = 0, bool clearMemory = false)
827+
828+
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
829+
{
830+
return runInternal(function, arguments, priority, parallelism, fetchSize, clearMemory);
831+
}
832+
833+
private IEntity runInternal(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, int fetchSize = 0, bool clearMemory = false)
829834
{
830835
lock (threadLock_)
831836
{
@@ -867,7 +872,7 @@ public IEntity run(string function, IList<IEntity> arguments, int priority = 4,
867872

868873
public IEntity run(string script, ProgressListener listener, int priority, int parallelism, int fetchSize)
869874
{
870-
return run(script, listener, priority, parallelism, fetchSize, false);
875+
return runInternal(script, listener, priority, parallelism, fetchSize, false);
871876
}
872877

873878
public void tryUpload(IDictionary<string, IEntity> variableObjectMap)
@@ -914,26 +919,26 @@ public void upload(IDictionary<string, IEntity> variableObjectMap)
914919
}
915920
}
916921

917-
public List<IEntity> run(IList<string> sqlList, int priority = 4, int parallelism = 2, bool clearMemory = false)
922+
public List<IEntity> run(IList<string> sqlList, int priority = 4, int parallelism = 64, bool clearMemory = false)
918923
{
919924
List<IEntity> results = new List<IEntity>();
920925
foreach (string sql in sqlList)
921926
{
922-
IEntity entity = run(sql, priority, parallelism, 0, clearMemory);
927+
IEntity entity = runInternal(sql, (ProgressListener)null, priority, parallelism, 0, clearMemory);
923928
results.Add(entity);
924929
}
925930
return results;
926931
}
927932

928933
#if NETCOREAPP
929-
public async Task<List<IEntity>> runAsync(IList<string> sqlList, int priority = 4, int parallelism = 2, bool clearMemory = false)
934+
public async Task<List<IEntity>> runAsync(IList<string> sqlList, int priority = 4, int parallelism = 64, bool clearMemory = false)
930935
{
931936
List<IEntity> result = await Task.Run(() => run(sqlList, priority, parallelism, clearMemory));
932937
return result;
933938
}
934939
#endif
935940

936-
public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 2, bool clearMemory = false)
941+
public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 64, bool clearMemory = false)
937942
{
938943
if(sqlList.Count != argumentsList.Count)
939944
{
@@ -942,14 +947,14 @@ public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsL
942947
List<IEntity> results = new List<IEntity>();
943948
for(int i = 0; i < sqlList.Count; i++)
944949
{
945-
IEntity entity = run(sqlList[i], argumentsList[i], priority, parallelism, 0, clearMemory);
950+
IEntity entity = runInternal(sqlList[i], argumentsList[i], priority, parallelism, 0, clearMemory);
946951
results.Add(entity);
947952
}
948953
return results;
949954
}
950955

951956
#if NETCOREAPP
952-
public async Task<List<IEntity>> runAsync(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 2, bool clearMemory = false)
957+
public async Task<List<IEntity>> runAsync(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 64, bool clearMemory = false)
953958
{
954959
List<IEntity> result = await Task.Run(() => run(sqlList, argumentsList, priority, parallelism, clearMemory));
955960
return result;

src/ExclusiveDBConnectionPool.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,20 @@ public void execute(IDBTask task) {
216216
}
217217

218218
#if NETCOREAPP
219-
public async Task<IEntity> runAsync(string script, int priority = 4, int parallelism = 2, bool clearMemory = false)
219+
public async Task<IEntity> runAsync(string script, int priority = 4, int parallelism = 64, bool clearMemory = false)
220220
{
221221
IEntity result = await Task.Run(() => run(script, priority, parallelism, clearMemory));
222222
return result;
223223
}
224224

225-
public async Task<IEntity> runAsync(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, bool clearMemory = false)
225+
public async Task<IEntity> runAsync(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, bool clearMemory = false)
226226
{
227227
IEntity result = await Task.Run(() => run(function, arguments, priority, parallelism, clearMemory));
228228
return result;
229229
}
230230
#endif
231231

232-
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, bool clearMemory = false)
232+
public IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, bool clearMemory = false)
233233
{
234234
IDBTask task = new BasicDBTask(function, (List<IEntity>)arguments, priority, parallelism, clearMemory);
235235
execute(task);
@@ -240,7 +240,7 @@ public IEntity run(string function, IList<IEntity> arguments, int priority = 4,
240240
return task.getResults();
241241
}
242242

243-
public IEntity run(string script, int priority = 4, int parallelism = 2, bool clearMemory = false)
243+
public IEntity run(string script, int priority = 4, int parallelism = 64, bool clearMemory = false)
244244
{
245245
IDBTask task = new BasicDBTask(script, priority, parallelism, clearMemory);
246246
execute(task);
@@ -291,7 +291,7 @@ public void shutdown() {
291291
}
292292
}
293293

294-
public List<IEntity> run(IList<string> sqlList, int priority = 4, int parallelism = 2, bool clearMemory = false)
294+
public List<IEntity> run(IList<string> sqlList, int priority = 4, int parallelism = 64, bool clearMemory = false)
295295
{
296296
List<IDBTask> tasks = new List<IDBTask>();
297297
foreach (string sql in sqlList)
@@ -313,14 +313,14 @@ public List<IEntity> run(IList<string> sqlList, int priority = 4, int parallelis
313313
}
314314

315315
#if NETCOREAPP
316-
public async Task<List<IEntity>> runAsync(IList<string> sqlList, int priority = 4, int parallelism = 2, bool clearMemory = false)
316+
public async Task<List<IEntity>> runAsync(IList<string> sqlList, int priority = 4, int parallelism = 64, bool clearMemory = false)
317317
{
318318
List<IEntity> result = await Task.Run(() => run(sqlList, priority, parallelism, clearMemory));
319319
return result;
320320
}
321321
#endif
322322

323-
public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 2, bool clearMemory = false)
323+
public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 64, bool clearMemory = false)
324324
{
325325
if (sqlList.Count != argumentsList.Count)
326326
{
@@ -347,7 +347,7 @@ public List<IEntity> run(IList<string> sqlList, IList<IList<IEntity>> argumentsL
347347
}
348348

349349
#if NETCOREAPP
350-
public async Task<List<IEntity>> runAsync(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 2, bool clearMemory = false)
350+
public async Task<List<IEntity>> runAsync(IList<string> sqlList, IList<IList<IEntity>> argumentsList, int priority = 4, int parallelism = 64, bool clearMemory = false)
351351
{
352352
List<IEntity> result = await Task.Run(() => run(sqlList, argumentsList, priority, parallelism, clearMemory));
353353
return result;

src/IDBConnectionPool.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public interface IDBConnectionPool
1616
void shutdown();
1717
void waitForThreadCompletion();
1818

19-
IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 2, bool clearMemory = false);
19+
IEntity run(string function, IList<IEntity> arguments, int priority = 4, int parallelism = 64, bool clearMemory = false);
2020

21-
IEntity run(string script, int priority = 4, int parallelism = 2, bool clearMemory = false);
21+
IEntity run(string script, int priority = 4, int parallelism = 64, bool clearMemory = false);
2222
}
2323
}

src/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
3333
//通过使用 "*",如下所示:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("3.00.1.0")]
36-
[assembly: AssemblyFileVersion("3.00.1.0")]
35+
[assembly: AssemblyVersion("3.00.1.1")]
36+
[assembly: AssemblyFileVersion("3.00.1.1")]

src/data/Utils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class Utils
3030
private static readonly int[] cumLeapMonthDays = new int[] { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 };
3131
private static readonly int[] monthDays = new int[] { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
3232
private static readonly int[] leapMonthDays = new int[] { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
33-
private static string API_VERSION = "3.00.1.0";
33+
private static string API_VERSION = "3.00.1.1";
3434

3535
public static string getAPIVersion()
3636
{

0 commit comments

Comments
 (0)