You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the connection is established without a username and password, you only have guest privileges. To be granted with more privileges, we can log in by executing `conn.login('admin', '123456', true)`.
113
113
114
-
To define and use user-defined functions in a Java program, you can pass in the user-defined scripts to the parameter initialScript. The advantages are:
115
-
(1) These functions don't need to be defined repeatedly every time `run` is called;
114
+
To define and use user-defined functions in a Java program, you can pass in the user-defined scripts to the parameter initialScript. The advantages are:
115
+
(1) These functions don't need to be defined repeatedly every time `run` is called;
116
116
(2) The API client can automatically connect to the server after disconnection. If the parameter *initialScript* is specified, the Java API will automatically execute the script and register the functions. The parameter can be very useful for scenarios where the network is not stable but the program needs to run continuously.
To enable high availability, set the parameter *enableHighAvailability* to true.
122
+
To enable high availability, set the parameter *enableHighAvailability* to true.
123
123
124
124
As of version 1.30.22.2, load balancing is automatically enabled for HA mode. Since 2.00.11.0, the `connect` method supports a new parameter *enableLoadBalance* which allows users to enable/disable load balancing in HA mode. Load balancing is only supported in HA mode and it is disabled by default.
125
125
@@ -233,7 +233,7 @@ The Java API provides connection pool `ExclusiveDBConnectionPool`. Users can exe
233
233
| getConnectionCount() | Get the number of connections. |
234
234
| shutdown() | Shut down the connection pool. |
235
235
236
-
**Note**: If the current `ExclusiveDBConnectionPool` is no longer in use, Java API will automatically close the connection after a while. To release the connection resources, call `shutdown()`upon the completion of thread tasks.
236
+
**Note**: If the current `ExclusiveDBConnectionPool` is no longer in use, Java API will automatically close the connection after a while. To release the connection resources, call `shutdown()`upon the completion of thread tasks.
237
237
238
238
`BasicDBTask` wraps the functions and arguments to be executed.
239
239
@@ -563,7 +563,7 @@ public void testVoid() throws IOException{
563
563
There are 2 types of DolphinDB tables:
564
564
565
565
- In-memory table: it has the fastest access speed, but if the node shuts down the data will be lost.
566
-
- DFS table: data are distributed across disks of multiple nodes.
566
+
- DFS table: data are distributed across disks of multiple nodes.
567
567
568
568
### 7.1. Write to an In-Memory Table
569
569
@@ -610,7 +610,7 @@ The example above uses partial application in DolphinDB to embed a table in `tab
610
610
611
611
#### 7.1.3. Save BasicTable Objects With Function `tableInsert`
612
612
613
-
Function `tableInsert` can also accept a BasicTable object in Java as a parameter to append data to a table in batches.
613
+
Function `tableInsert` can also accept a BasicTable object in Java as a parameter to append data to a table in batches.
@@ -762,7 +762,7 @@ public void test_loop_basicTable(BasicTable table1) throws Exception{
762
762
763
763
### 7.4. Append Data Asynchronously
764
764
765
-
You can use methods of `MultithreadedTableWriter` class to asynchronously append data to a DolphinDB in-memory table, dimension table, or a DFS table. The class maintains a buffer queue. Even when the server is fully occupied with network I/O operations, the writing threads of the API client will not be blocked.
765
+
You can use methods of `MultithreadedTableWriter` class to asynchronously append data to a DolphinDB in-memory table, dimension table, or a DFS table. The class maintains a buffer queue. Even when the server is fully occupied with network I/O operations, the writing threads of the API client will not be blocked.
766
766
767
767
For asynchronous writes:
768
768
@@ -791,7 +791,7 @@ Parameters:
791
791
-**port**: port number
792
792
-**userId** / **password**: username and password
793
793
-**dbPath**: a STRING indicating the DFS database path. Leave it unspecified for an in-memory table.
794
-
-**tableName**: a STRING indicating the in-memory or DFS table name.
794
+
-**tableName**: a STRING indicating the in-memory or DFS table name.
795
795
796
796
**Note:** For API 1.30.17 or lower versions, when writing to an in-memory table, please specify the in-memory table name for *dbPath* and leave *tableName* empty.
Insert unwritten data. The result is in the same format as `insert`. The difference is that `insertUnwrittenData` can insert multiple records at a time.
863
863
@@ -877,7 +877,7 @@ ErrorCodeInfo ret = multithreadedTableWriter_.insertUnwrittenData(unwrittenData)
877
877
Status getStatus()
878
878
```
879
879
880
-
**Details:**
880
+
**Details:**
881
881
882
882
Get the current status of the `MultithreadedTableWriter` object.
-`hasError()`: return true if an error occurred, false otherwise.
912
912
-`succeed()`: return true if the data is written successfully, false otherwise.
913
913
914
-
914
+
915
915
(5) waitForThreadCompletion
916
916
917
917
```java
918
918
waitForThreadCompletion()
919
919
```
920
920
921
-
**Details:**
921
+
**Details:**
922
922
923
923
After calling the method, `MultithreadedTableWriter` will wait until all working threads complete their tasks. If you call `insert` or `insertUnwrittenData` after the execution of `waitForThreadCompletion`, an error "thread is exiting" will be raised.
924
924
@@ -1000,7 +1000,7 @@ Output:
1000
1000
The above example calls method `writer.insert()` to write data to writer, and obtains the status with `writer.getStatus()`. Please note that the method `writer.waitForThreadCompletion()` will wait for `MultithreadedTableWriter` to finish the data writes, and then terminate all working threads with the last status retained. A new MTW object must be created to write data again.
1001
1001
1002
1002
As shown in the above example, `MultithreadedTableWriter` applies multiple threads to data conversion and writes. The API client also uses multiple threads to call `MultithreadedTableWriter`, and the implementation is thread-safe.
1003
-
1003
+
1004
1004
#### 7.4.2. Exceptions Raised by MultithreadedTableWriter
1005
1005
1006
1006
When calling method `insert` of class `MultithreadedTableWriter`:
0 commit comments