Skip to content

Commit

Permalink
Update README.
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWL committed Mar 7, 2024
1 parent 01902a6 commit f793a48
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ API 介绍,使用文档和测试程序请参考如下 `maker` 生成程序下
|     | 待开始 | [c](maker/c) | ANSC c xdb 生成程序实现 | [Lion](https://github.com/lionsoul2014) |
| :white_check_mark: | 已完成 | [python](maker/python) | python xdb 生成程序实现 | [leolin49](https://github.com/leolin49) |
| :white_check_mark: | 已完成 | [csharp](maker/csharp) | csharp xdb 生成程序实现 | [Alan Lee](https://github.com/malus2077) |
| :white_check_mark: | 已完成 | [rust](maker/rust) | rust xdb 生成程序实现 | [KevinWang](https://github.com/KevinWL) |


# `xdb` 数据更新
Expand Down
20 changes: 19 additions & 1 deletion maker/rust/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ip2region xdb rust 生成实现

## 使用方法
* 当前目录下执行 `cargo build --release` 编译生成工具
* 当前目录下maker子目录下执行 `cargo build --release` 编译生成工具
* 目标生成在targe/release 目录下 maker
* 使用方法:
```
Expand All @@ -12,3 +12,21 @@
-h, --help Print help
-V, --version Print version
```

例如,通过默认的 data/ip.merge.txt 原数据,在target目录下生成一个 ip2region.xdb 二进制文件:

```
kevin@ubuntu ~/i/m/r/m/t/release (master)> ./maker -i ../../../../../data/ip.merge.txt -o ip2region.xdb
load 683844 lines
try to write the segment index ptr ...
write done, dataBlocks: 13827, IndexBlock: 683844, indexPtr: (983587, 11070069)
Done, elpsed: 0m7s
```

## 数据查询/bench 测试
* 通过将以上步骤生成的二进制文件和python 生成工具生成的二进制文件进行二进制比对,除时间戳位置不同,其它均相同。

![](./vimdiff.png)
* 已经完成开发的 [binding](../../binding/) 都有查询和 bench 测试程序以及使用文档,你可以使用你熟悉的语言的 searcher 进行查询测试或者bench测试,来确认数据的正确性和完整性。

Binary file added maker/rust/vimdiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f793a48

Please sign in to comment.