Sample code for parameter setting
ObTableClient client = new ObTableClient();
client.setFullUserName("your user name");
client.setPassword("your passwd");
client.setParamURL("your OCP url");
obTableClient.setSysUserName("your sys user name");
obTableClient.setSysPassword("your sys password");
// Set parameters for ObTableClient. For example,
// set the bolt.netty.buffer.low.watermark parameter to 64*1024 and the bolt.netty.buffer.high.watermark parameter to 128*1024.
client.addProperty(Property.NETTY_BUFFER_LOW_WATERMARK.getKey(), Integer.toString(64*1024));
client.addProperty(Property.NETTY_BUFFER_HIGH_WATERMARK.getKey(), Integer.toString(128*1024));
client.init();
// do insert/update/query/delete operation
...
Notice
Note that you must set parameters before you call the client.init() function.
Parameters
The following table shows the parameters that you can configure. Important ones are displayed in boldface. For a specific parameter, if you are using the client of a different version, refer to the member variables of the Property class.
| Category | Parameter | Default value | Description | Client version |
|---|---|---|---|---|
| RPC | rpc.connect.timeout | 500 | The timeout period for creating an RPC connection. | 1.0.0 |
| RPC | rpc.connect.try.times | 3 | The number of attempts to create an RPC connection. | 1.0.0 |
| RPC | rpc.execute.timeout | 3000 | The socket timeout period for executing the RPC request. | 1.0.0 |
| RPC | rpc.login.timeout | 1000 | The timeout period of the RPC logon request. | 1.0.0 |
| RPC | rpc.login.try.times | 3 | The number of attempts of the RPC logon request. | 1.0.0 |
| RPC | rpc.operation.timeout | 10000 | The timeout period for executing an internal RPC request in OceanBase Database. | 1.0.0 |
| META | metadata.refresh.interval | 60000 | The time interval of metadata refresh. | 1.0.0 |
| META | metadata.refresh.lock.timeout | 8000 | The lock timeout period after which the metadata is refreshed. | 1.0.0 |
| RS_LIST | rs.list.acquire.connect.timeout | 200 | The timeout period for creating the connection to retrieve the RS list. | 1.0.0 |
| RS_LIST | rs.list.acquire.read.timeout | 1000 | The RS list read timeout period for retrieving the RS list. | 1.0.0 |
| RS_LIST | rs.list.acquire.try.times | 3 | The number of attempts to retrieve the RS list. | 1.0.0 |
| RS_LIST | rs.list.acquire.retry.interval | 100 | The time interval between attempts to retrieve the RS list. | 1.0.0 |
| TableEntry | table.entry.acquire.connect.timeout | 500 | The timeout period for creating a connection after which the table address is refreshed. | 1.0.0 |
| TableEntry | table.entry.acquire.socket.timeout | 3000 | The socket timeout period after which the table address is refreshed. | 1.0.0 |
| TableEntry | table.entry.refresh.interval.base | 100 | The basic time interval for refreshing the table address. | 1.0.0 |
| TableEntry | table.entry.refresh.interval.ceiling | 1600 | The maximum time interval for refreshing the table address. | 1.0.0 |
| TableEntry | table.entry.refresh.interval.wait | false | Specifies whether to wait for the specified interval when refreshing the table address. | 1.0.0 |
| TableEntry | table.entry.refresh.lock.timeout | 4000 | The lock timeout period after which the table address is refreshed. | 1.0.0 |
| TableEntry | table.entry.refresh.try.times | 3 | The number of attempts to refresh the table address. | 1.0.0 |
| TableEntry | table.entry.refresh.continuous.failure.ceiling | 10 | The threshold of failed table address refreshes before refreshing the metadata. | 1.0.0 |
| SERVER | server.address.priority.timeout | 1800000 | The period before the server address priority expires. | 1.0.0 |
| SERVER | server.connection.pool.size | 1 | The maximum number of connections per server. | 1.2.4 |
| RUNTIME | runtime.continuous.failure.ceiling | 100 | The threshold of consecutive runtime failures before refreshing the table address. | 1.0.0 |
| RUNTIME | runtime.retry.times | 1 | The number of retries when a retriable error occurs during the runtime. | 1.0.0 |
| RUNTIME | runtime.retry.interval | 1 | The time interval between retries when a runtime error occurs. | 1.0.0 |
| RUNTIME | runtime.max.wait | 3000 | The timeout period for the execution of a single request. The request execution is retried within the timeout period. | 1.0.0 |
| RUNTIME | runtime.batch.max.wait | 3000 | The timeout period for the batch execution of multiple requests. | 1.0.0 |
| Netty | bolt.netty.buffer.low.watermark | 512K | The lower limit of resource usage for Netty write buffer. | 1.2.5 |
| Netty | bolt.netty.buffer.high.watermark | 1M | The upper limit of resource usage for Netty write buffer. | 1.2.5 |
| Netty | bolt.netty.blocking.wait.interval | 1ms | The wait time after the Netty write buffer is full. | 1.2.5 |