Skip to content

Commit b41f7c7

Browse files
committed
fix review and add readme
1 parent b7162ab commit b41f7c7

File tree

4 files changed

+134
-3
lines changed

4 files changed

+134
-3
lines changed

be/src/io/tools/readme.md

+133
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# File Cache Microbenchmark
2+
3+
## Compilation
4+
5+
To compile the project, run the following command:
6+
7+
```bash
8+
./build.sh --clean --file-cache-microbench --be
9+
```
10+
11+
This will generate the `file_cache_microbench` executable in the `apache_doris/output/be/lib` directory.
12+
13+
## Usage
14+
15+
1. Create a deployment directory:
16+
```bash
17+
mkdir {deploy_dir}
18+
```
19+
20+
2. Create a configuration directory:
21+
```bash
22+
mkdir {deploy_dir}/conf
23+
```
24+
25+
3. Copy the executable to the deployment directory:
26+
```bash
27+
cp -r apache_doris/output/be/lib/file_cache_microbench {deploy_dir}
28+
```
29+
30+
4. Copy the configuration file to the configuration directory:
31+
```bash
32+
cp -r apache_doris/output/be/conf/be.conf {deploy_dir}/conf
33+
```
34+
35+
5. Edit the configuration file `{deploy_dir}/conf/be.conf` and add the following configuration information:
36+
```ini
37+
enable_file_cache=true
38+
file_cache_path = [ {"path": "/mnt/disk2/file_cache", "total_size":53687091200, "query_limit": 10737418240}]
39+
test_s3_resource = "resource"
40+
test_s3_ak = "ak"
41+
test_s3_sk = "sk"
42+
test_s3_endpoint = "endpoint"
43+
test_s3_region = "region"
44+
test_s3_bucket = "bucket"
45+
test_s3_prefix = "prefix"
46+
```
47+
48+
6. Change to the deployment directory:
49+
```bash
50+
cd {deploy_dir}
51+
```
52+
53+
7. Run the microbenchmark:
54+
```bash
55+
./file_cache_microbench --port={test_port}
56+
```
57+
58+
8. Access the variables:
59+
```bash
60+
bvar http://${ip}:${port}/vars/
61+
```
62+
63+
9. Check the logs in `{deploy_dir}/log/`.
64+
65+
## API
66+
67+
### get_help
68+
```
69+
curl "http://localhost:{port}/MicrobenchService/get_help"
70+
```
71+
72+
#### Endpoints:
73+
- **GET /get_job_status/<job_id>**
74+
- Retrieve the status of a submitted job.
75+
- Parameters:
76+
- `job_id`: The ID of the job to retrieve status for.
77+
- `files` (optional): If provided, returns the associated file records for the job.
78+
- Example: `/get_job_status/job_id?files=10`
79+
80+
- **GET /list_jobs**
81+
- List all submitted jobs and their statuses.
82+
83+
- **GET /get_help**
84+
- Get this help information.
85+
86+
- **GET /file_cache_clear**
87+
- Clear the file cache with the following query parameters:
88+
```json
89+
{
90+
"sync": <true|false>, // Whether to synchronize the cache clear operation
91+
"segment_path": "<path>" // Optional path of the segment to clear from the cache
92+
}
93+
```
94+
If `segment_path` is not provided, all caches will be cleared based on the `sync` parameter.
95+
96+
- **GET /file_cache_reset**
97+
- Reset the file cache with the following query parameters:
98+
```json
99+
{
100+
"capacity": <new_capacity>, // New capacity for the specified path
101+
"path": "<path>" // Path of the segment to reset
102+
}
103+
```
104+
105+
- **GET /file_cache_release**
106+
- Release the file cache with the following query parameters:
107+
```json
108+
{
109+
"base_path": "<base_path>" // Optional base path to release specific caches
110+
}
111+
```
112+
113+
- **GET /update_config**
114+
- Update the configuration with the following JSON body:
115+
```json
116+
{
117+
"config_key": "<key>", // The configuration key to update
118+
"config_value": "<value>", // The new value for the configuration key
119+
"persist": <true|false> // Whether to persist the configuration change
120+
}
121+
```
122+
123+
- **GET /show_config**
124+
- Retrieve the current configuration settings.
125+
126+
### Notes:
127+
- Ensure that the S3 configuration is set correctly in the environment.
128+
- The program will create and read files in the specified S3 bucket.
129+
- Monitor the logs for detailed execution information and errors.
130+
131+
### Version Information:
132+
you can see it in get_help return msg
133+

be/src/runtime/exec_env_init.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ void ExecEnv::set_wal_mgr(std::unique_ptr<WalManager>&& wm) {
684684
void ExecEnv::clear_wal_mgr() {
685685
this->_wal_manager.reset();
686686
}
687-
688687
#endif
689688
// TODO(zhiqiang): Need refactor all thread pool. Each thread pool must have a Stop method.
690689
// We need to stop all threads before releasing resource.

build.sh

-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ FE_MODULES="$(
581581
IFS=','
582582
echo "${modules[*]}"
583583
)"
584-
FE_MODULES=''
585584

586585
# Clean and build Backend
587586
if [[ "${BUILD_BE}" -eq 1 ]]; then

common/cpp/s3_rate_limiter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class S3RateLimiter::SimpleSpinLock {
4444
spin_count++;
4545
if (spin_count >= MAX_SPIN_COUNT) {
4646
LOG(WARNING) << "Warning: Excessive spinning detected while acquiring lock. Spin "
47-
"count: " << spin_count;
47+
"count: ";
4848
spin_count = 0;
4949
}
5050
// Spin until we acquire the lock

0 commit comments

Comments
 (0)