Skip to content

Commit

Permalink
RATIS-2106. Add configuration reference for RaftClient (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
smengcl authored and SzyWilliam committed Jun 12, 2024
1 parent aae246a commit f1725e2
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ interface Rpc {
String PREFIX = RaftClientConfigKeys.PREFIX + ".rpc";

String REQUEST_TIMEOUT_KEY = PREFIX + ".request.timeout";
TimeDuration REQUEST_TIMEOUT_DEFAULT = TimeDuration.valueOf(3000, TimeUnit.MILLISECONDS);
TimeDuration REQUEST_TIMEOUT_DEFAULT = TimeDuration.valueOf(3, TimeUnit.SECONDS);
static TimeDuration requestTimeout(RaftProperties properties) {
return getTimeDuration(properties.getTimeDuration(REQUEST_TIMEOUT_DEFAULT.getUnit()),
REQUEST_TIMEOUT_KEY, REQUEST_TIMEOUT_DEFAULT, getDefaultLog());
Expand All @@ -52,8 +52,7 @@ static void setRequestTimeout(RaftProperties properties, TimeDuration timeoutDur
}

String WATCH_REQUEST_TIMEOUT_KEY = PREFIX + ".watch.request.timeout";
TimeDuration WATCH_REQUEST_TIMEOUT_DEFAULT =
TimeDuration.valueOf(10000, TimeUnit.MILLISECONDS);
TimeDuration WATCH_REQUEST_TIMEOUT_DEFAULT = TimeDuration.valueOf(10, TimeUnit.SECONDS);
static TimeDuration watchRequestTimeout(RaftProperties properties) {
return getTimeDuration(properties.getTimeDuration(WATCH_REQUEST_TIMEOUT_DEFAULT.getUnit()),
WATCH_REQUEST_TIMEOUT_KEY, WATCH_REQUEST_TIMEOUT_DEFAULT, getDefaultLog());
Expand Down Expand Up @@ -125,7 +124,7 @@ static void setFlushRequestBytesMin(RaftProperties properties, SizeInBytes flush
}

String REQUEST_TIMEOUT_KEY = PREFIX + ".request.timeout";
TimeDuration REQUEST_TIMEOUT_DEFAULT = TimeDuration.valueOf(10000, TimeUnit.MILLISECONDS);
TimeDuration REQUEST_TIMEOUT_DEFAULT = TimeDuration.valueOf(10, TimeUnit.SECONDS);
static TimeDuration requestTimeout(RaftProperties properties) {
return getTimeDuration(properties.getTimeDuration(REQUEST_TIMEOUT_DEFAULT.getUnit()),
REQUEST_TIMEOUT_KEY, REQUEST_TIMEOUT_DEFAULT, getDefaultLog());
Expand Down
63 changes: 62 additions & 1 deletion ratis-docs/src/site/markdown/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,4 +675,65 @@ For examples,
2. However, setConf to a 3-member group by removing 2 of members and adding 2 new members is a majority-add.

- Note also that adding 1 new member to an 1-member group is always allowed,
although it is a majority-add.
although it is a majority-add.


## Client Configurations

Client configurations are located at `RaftClientConfigKeys`.

### RPC - Configurations related to Client RPC timeout.

| **Property** | `raft.client.rpc.request.timeout` |
|:----------------|:------------------------------------------|
| **Description** | client side timeout for sending a request |
| **Type** | TimeDuration |
| **Default** | 3s |

| **Property** | `raft.client.rpc.watch.request.timeout` |
|:----------------|:------------------------------------------------|
| **Description** | client side timeout for sending a watch request |
| **Type** | TimeDuration |
| **Default** | 10s |

### Async - Configurations related to async requests.

| **Property** | `raft.client.async.outstanding-requests.max` |
|:----------------|:---------------------------------------------|
| **Description** | maximum number of outstanding async requests |
| **Type** | int |
| **Default** | 100 |

### DataStream - Configurations related to DataStream Api.

| **Property** | `raft.client.data-stream.outstanding-requests.max` |
|:----------------|:---------------------------------------------------|
| **Description** | maximum number of outstanding data stream requests |
| **Type** | int |
| **Default** | 100 |

| **Property** | `raft.client.data-stream.flush.request.count.min` |
|:----------------|:-----------------------------------------------------------------|
| **Description** | minimum number of requests before data stream flush would happen |
| **Type** | int |
| **Default** | 0 |

| **Property** | `raft.client.data-stream.flush.request.bytes.min` |
|:----------------|:--------------------------------------------------------------|
| **Description** | minimum number of bytes before data stream flush would happen |
| **Type** | SizeInBytes |
| **Default** | 1MB |

| **Property** | `raft.client.data-stream.request.timeout` |
|:----------------|:------------------------------------------|
| **Description** | timeout for data stream request |
| **Type** | TimeDuration |
| **Default** | 10s |

### MessageStream - Configurations related to MessageStream Api.

| **Property** | `raft.client.message-stream.submessage-size` |
|:----------------|:---------------------------------------------|
| **Description** | maximum size of a sub message |
| **Type** | SizeInBytes |
| **Default** | 1MB |

0 comments on commit f1725e2

Please sign in to comment.