Skip to content

[Translation] 完成 docs/proposal 目录的中英文翻译(#271) #1423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions docs/proposal/bpf_map_batch_delete_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: Kmesh BPF Map 批量删除
authors:
- "@bitcoffeeiux"
reviewers:
- "@robot"
- TBD
approvers:
- "@robot"
- TBD
creation-date: 2024-01-15
---

# Kmesh BPF Map 批量删除

## 摘要

本文档描述了 Kmesh 中 BPF Map 批量删除的设计方案,用于提高大规模数据删除的效率。

## 背景

在服务网格场景中,需要定期清理或批量删除大量 BPF Map 数据。批量删除机制可以显著提高删除效率,减少系统开销。

## 目标

1. 实现批量删除功能
2. 提高删除性能
3. 保证数据一致性
4. 支持错误恢复

## 设计细节

### 架构设计

批量删除系统包含以下组件:

1. 删除管理器
2. 事务控制器
3. 错误处理器
4. 性能监控器

### 数据结构

```c
struct BatchDeleteConfig {
__u32 batch_size; // 批量大小
__u32 timeout; // 超时时间
__u32 retry_count; // 重试次数
__u32 flags; // 删除标志
};

struct BatchDeleteStats {
__u64 total_deletes; // 总删除数
__u64 success_count; // 成功数量
__u64 failure_count; // 失败数量
__u64 retry_count; // 重试次数
};

struct BatchDelete {
__u32 map_id; // Map ID
void *keys; // 键数组
__u32 count; // 删除数量
__u32 flags; // 删除标志
};
```

### 删除接口

```go
type BatchDeleter interface {
BatchDelete(deletes []BatchDelete, config *BatchDeleteConfig) error
GetDeleteStats() (*BatchDeleteStats, error)
CancelDelete(batchID string) error
GetDeleteStatus(batchID string) (string, error)
}
```

## 使用示例

### 配置批量删除

```yaml
batch_delete_config:
batch_size: 1000
timeout: 30s
retry_count: 3
flags:
- ATOMIC
- ASYNC
```

### 执行删除

```bash
# 执行批量删除
kmesh map batch-delete --config=config.yaml --input=keys.json

# 查看删除状态
kmesh map delete-status <batch-id>

# 取消删除
kmesh map delete-cancel <batch-id>
```

## 注意事项

1. 数据一致性
2. 性能影响
3. 错误处理

## 未来工作

1. 支持更多删除模式
2. 优化性能
3. 增强监控能力

Check failure on line 115 in docs/proposal/bpf_map_batch_delete_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Files should end with a single newline character

docs/proposal/bpf_map_batch_delete_zh.md:115:10 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md047.md

Check failure on line 115 in docs/proposal/bpf_map_batch_delete_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Trailing spaces

docs/proposal/bpf_map_batch_delete_zh.md:115:10 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md
116 changes: 116 additions & 0 deletions docs/proposal/bpf_map_batch_lookup_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: Kmesh BPF Map 批量查询
authors:
- "@bitcoffeeiux"
reviewers:
- "@robot"
- TBD
approvers:
- "@robot"
- TBD
creation-date: 2024-01-15
---

# Kmesh BPF Map 批量查询

## 摘要

本文档描述了 Kmesh 中 BPF Map 批量查询的设计方案,用于提高大规模数据查询的效率。

## 背景

在服务网格场景中,经常需要同时查询大量 BPF Map 数据。批量查询机制可以显著提高查询效率,减少系统开销。

## 目标

1. 实现批量查询功能
2. 提高查询性能
3. 优化内存使用
4. 支持并发查询

## 设计细节

### 架构设计

批量查询系统包含以下组件:

1. 查询管理器
2. 缓存系统
3. 并发控制器
4. 性能监控器

### 数据结构

```c
struct BatchLookupConfig {
__u32 batch_size; // 批量大小
__u32 timeout; // 超时时间
__u32 max_concurrent; // 最大并发数
__u32 flags; // 查询标志
};

struct BatchLookupStats {
__u64 total_lookups; // 总查询数
__u64 cache_hits; // 缓存命中数
__u64 cache_misses; // 缓存未命中数
__u64 error_count; // 错误数量
};

struct BatchLookup {
__u32 map_id; // Map ID
void *keys; // 键数组
void *values; // 值数组缓冲区
__u32 count; // 查询数量
__u32 flags; // 查询标志
};
```

### 查询接口

```go
type BatchLookupManager interface {
BatchLookup(lookups []BatchLookup, config *BatchLookupConfig) error
GetLookupStats() (*BatchLookupStats, error)
CancelLookup(batchID string) error
GetLookupStatus(batchID string) (string, error)
}
```

## 使用示例

### 配置批量查询

```yaml
batch_lookup_config:
batch_size: 1000
timeout: 10s
max_concurrent: 4
flags:
- USE_CACHE
- ASYNC
```

### 执行查询

```bash
# 执行批量查询
kmesh map batch-lookup --config=config.yaml --input=keys.json

# 查看查询状态
kmesh map lookup-status <batch-id>

# 取消查询
kmesh map lookup-cancel <batch-id>
```

## 注意事项

1. 内存使用控制
2. 缓存管理
3. 性能监控

## 未来工作

1. 支持更多查询模式
2. 优化缓存策略
3. 增强监控能力

Check failure on line 116 in docs/proposal/bpf_map_batch_lookup_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Files should end with a single newline character

docs/proposal/bpf_map_batch_lookup_zh.md:116:10 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md047.md

Check failure on line 116 in docs/proposal/bpf_map_batch_lookup_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Trailing spaces

docs/proposal/bpf_map_batch_lookup_zh.md:116:10 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md
116 changes: 116 additions & 0 deletions docs/proposal/bpf_map_batch_update_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
title: Kmesh BPF Map 批量更新
authors:
- "@bitcoffeeiux"
reviewers:
- "@robot"
- TBD
approvers:
- "@robot"
- TBD
creation-date: 2024-01-15
---

# Kmesh BPF Map 批量更新

## 摘要

本文档描述了 Kmesh 中 BPF Map 批量更新的设计方案,用于提高大规模数据更新的效率。

## 背景

在大规模服务网格场景中,需要频繁更新大量 BPF Map 数据。批量更新机制可以显著提高更新效率,减少系统开销。

## 目标

1. 实现批量更新功能
2. 提高更新性能
3. 保证数据一致性
4. 支持错误恢复

## 设计细节

### 架构设计

批量更新系统包含以下组件:

1. 批处理管理器
2. 事务控制器
3. 错误处理器
4. 性能监控器

### 数据结构

```c
struct BatchUpdateConfig {
__u32 batch_size; // 批量大小
__u32 timeout; // 超时时间
__u32 retry_count; // 重试次数
__u32 flags; // 更新标志
};

struct BatchUpdateStats {
__u64 total_updates; // 总更新数
__u64 success_count; // 成功数量
__u64 failure_count; // 失败数量
__u64 retry_count; // 重试次数
};

struct BatchUpdate {
__u32 map_id; // Map ID
void *keys; // 键数组
void *values; // 值数组
__u32 count; // 更新数量
__u32 flags; // 更新标志
};
```

### 更新接口

```go
type BatchUpdater interface {
BatchUpdate(updates []BatchUpdate, config *BatchUpdateConfig) error
GetUpdateStats() (*BatchUpdateStats, error)
CancelUpdate(batchID string) error
GetUpdateStatus(batchID string) (string, error)
}
```

## 使用示例

### 配置批量更新

```yaml
batch_update_config:
batch_size: 1000
timeout: 30s
retry_count: 3
flags:
- ATOMIC
- ASYNC
```

### 执行更新

```bash
# 执行批量更新
kmesh map batch-update --config=config.yaml --input=updates.json

# 查看更新状态
kmesh map batch-status <batch-id>

# 取消更新
kmesh map batch-cancel <batch-id>
```

## 注意事项

1. 内存使用控制
2. 事务一致性
3. 性能监控

## 未来工作

1. 支持更多更新模式
2. 优化内存使用
3. 增强监控能力

Check failure on line 116 in docs/proposal/bpf_map_batch_update_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Files should end with a single newline character

docs/proposal/bpf_map_batch_update_zh.md:116:10 MD047/single-trailing-newline Files should end with a single newline character https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md047.md

Check failure on line 116 in docs/proposal/bpf_map_batch_update_zh.md

View workflow job for this annotation

GitHub Actions / build (1.23)

Trailing spaces

docs/proposal/bpf_map_batch_update_zh.md:116:10 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md009.md
Loading
Loading