diff --git a/CMakeLists.txt b/CMakeLists.txt index 9419ac3a76..a4df60cfd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,7 +615,7 @@ set(PROTO_FILES idl_options.proto brpc/trackme.proto brpc/streaming_rpc_meta.proto brpc/proto_base.proto - brpc/rdma/rdma_handshake.proto) + brpc/rdma_handshake.proto) file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/output/include/brpc) set(PROTOC_FLAGS ${PROTOC_FLAGS} -I${PROTOBUF_INCLUDE_DIR}) compile_proto(PROTO_HDRS PROTO_SRCS ${PROJECT_BINARY_DIR} diff --git a/Makefile b/Makefile index 86de388448..90be5516c3 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ JSON2PB_DIRS = src/json2pb JSON2PB_SOURCES = $(foreach d,$(JSON2PB_DIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS)))) JSON2PB_OBJS = $(addsuffix .o, $(basename $(JSON2PB_SOURCES))) -BRPC_DIRS = src/brpc src/brpc/details src/brpc/builtin src/brpc/policy src/brpc/policy/mysql src/brpc/rdma +BRPC_DIRS = src/brpc src/brpc/details src/brpc/builtin src/brpc/handshake src/brpc/policy src/brpc/policy/mysql src/brpc/rdma THRIFT_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/thrift*,$(SRCEXTS)))) EXCLUDE_SOURCES = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/event_dispatcher_*,$(SRCEXTS)))) BRPC_SOURCES_ALL = $(foreach d,$(BRPC_DIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS)))) diff --git a/docs/cn/handshake_common_design.md b/docs/cn/handshake_common_design.md new file mode 100644 index 0000000000..169866dc6d --- /dev/null +++ b/docs/cn/handshake_common_design.md @@ -0,0 +1,499 @@ +# RDMA、URMA、UBSHM 公共握手设计(修订版) + +## 1. 文档目的 + +本文在现有公共 framing、`HandshakeSession` 和协议字段 adapter 的基础上,进一步明确四个职责边界: + +1. `Socket` 只感知一个顶层 `AdapterTransport`,不感知 TCP、RDMA、URMA、UBSHM,也不感知握手 phase。 +2. `AdapterTransport` 自动完成连接升级;升级成功或回退 TCP 后,统一通知 `Socket` 建链完成。 +3. 具体 Transport 只提供握手所需的资源操作接口;握手顺序、状态转换和 fallback 由上层统一编排。 +4. Transport 只负责数据传输和资源生命周期,不负责 TCP 建链、wire framing、握手状态机或握手流程编排。 + +本文只定义架构和迁移方向,不改变 RDMA/URMA/UBSHM 当前 wire format。 + +## 2. 当前问题 + +现有实现已经抽取了 `HandshakeSession`、`HandshakeCodec` 和公共 framing,但职责仍未完全收敛: + +- `ProcessHandshakeAtClient` 仍位于具体 Transport 或 endpoint 路径中,client 的握手入口不统一。 +- `RdmaTransport`、`UBShmTransport` 等仍通过各自的 `S_*` 常量暴露握手阶段;`HandshakePhases` 需要填入不同 transport 的 phase,公共 session 无法真正统一。 +- server handshake adapter 需要通过 `Socket` 找到 `AdapterTransport`,再找到具体 Transport,并且直接驱动资源创建、激活和 fallback。 +- `AdapterTransport` 虽然已经是 `Socket` 的顶层对象,但握手的 client/server 入口、连接完成通知和数据面切换仍分散在多个层次。 +- “握手成功”与“Socket 建链完成”不是同一个明确事件,导致 TCP fallback、升级成功和异常退出的发布顺序难以验证。 + +根因是把“传输能力”和“建链流程”混在了一起。Transport 是被流程调用的参与者,不应成为流程的拥有者。 + +## 3. 目标架构 + +### 3.1 分层 + +```text +Socket + | + v +AdapterTransport Socket 唯一感知的 Transport + |-- TcpTransport TCP 控制面和 fallback 数据面 + |-- HighSpeedTransport RDMA / URMA / UBSHM 数据面 + |-- ConnectionUpgradeCoordinator 统一的建链与升级编排 + | |-- HandshakeSession 公共状态机、I/O、framing + | |-- HandshakeCodec 协议 wire 字段编解码 + | |-- TransportUpgradeOps 被调用的资源阶段接口 + | `-- SocketConnectionNotifier 建链完成/失败通知 + `-- ActiveTransport 根据统一状态选择数据面 +``` + +这里的 `ConnectionUpgradeCoordinator` 可以先作为 `AdapterTransport` 的内部实现,不要求立即新增独立公开类;重要的是职责必须集中在该层,而不是分散到具体 Transport。 + +### 3.2 依赖方向 + +```text +Socket -> AdapterTransport -> TcpTransport / HighSpeedTransport +Socket -> AdapterTransport -> ConnectionUpgradeCoordinator +ConnectionUpgradeCoordinator -> TransportUpgradeOps +ConnectionUpgradeCoordinator -> HandshakeSession +TransportUpgradeOps -> transport-specific endpoint/resource +``` + +禁止以下反向依赖: + +- `Socket` 直接调用具体 Transport 或 handshake adapter。 +- `TcpTransport` 调用具体高速度 Transport 的握手函数。 +- `RdmaTransport`、`UrmaTransport`、`UBShmTransport` 调用 `ProcessHandshakeAtClient`、`RunServerHandshake` 等流程函数。 +- 公共 `HandshakeSession` 依赖 `ibv_*`、`urma_*`、UBRING 类型。 +- 具体 Transport 通过自定义 phase 影响 `Socket` 的建链判断。 + +## 4. 统一状态模型 + +### 4.1 握手状态由上层拥有 + +公共状态只描述连接升级流程,不描述某一种资源如何创建: + +```cpp +namespace brpc { +namespace handshake { + +enum class Phase { + kUninitialized, + kPreparing, + kHelloSending, + kHelloWaiting, + kNegotiating, + kAckSending, + kAckWaiting, + kEstablished, + kFallbackTcp, + kFailed, +}; + +enum class StepResult { + kOk, + kFallback, + kNeedMore, + kNotMine, + kError, +}; + +} // namespace handshake +} // namespace brpc +``` + +`Socket` 和 `AdapterTransport` 只读取 `Phase` 的终态:`kEstablished`、`kFallbackTcp`、`kFailed`。中间状态只由 coordinator/session 使用。 + +### 4.2 删除 `HandshakePhases` + +不再使用: + +```cpp +struct HandshakePhases { + int prepare_local; + int hello_send; + int hello_wait; + int negotiate; + int ack_send; + int ack_wait; +}; +``` + +原因是这些数字并不是协议字段,也不是数据面状态;它们只是历史实现中的日志/状态映射。公共 session 应使用固定的 `Phase`,具体 Transport 的资源子状态留在自身实现中,不向上暴露。 + +例如 RDMA 的 `S_ALLOC_QPCQ`、`S_BRINGUP_QP`、UBSHM 的 `S_ALLOC_SHM` 都只能是具体 Transport 的内部 debug 状态;它们不能再填入公共 `HandshakePhases`,也不能作为 `Socket` 判断建链完成的依据。 + +## 5. 模块职责 + +### 5.1 Socket + +`Socket` 只保存和调用一个 `Transport*`,实际对象始终为 `AdapterTransport`。它只关心以下事件: + +- TCP socket 是否连接成功; +- `AdapterTransport` 是否报告建链完成; +- 当前数据面读写是否可用; +- 连接是否失败或 EOF。 + +Socket 不直接读取 handshake phase,也不负责决定 TCP 还是高速度 Transport。 + +### 5.2 AdapterTransport + +`AdapterTransport` 是顶层 Transport 和连接升级协调器的宿主,负责: + +- 创建并持有 TCP Transport 和候选高速度 Transport; +- 建立 TCP 控制连接; +- 自动启动 client/server 的升级编排; +- 将 TCP 可读事件交给 coordinator,直到升级进入终态; +- 在 `kEstablished` 与 `kFallbackTcp` 之间选择 active data transport; +- 对升级结果执行一次性的连接完成通知; +- 保证 fallback 数据回放和状态发布的内存顺序。 + +建议的内部接口如下: + +```cpp +class AdapterTransport : public Transport { +public: + std::shared_ptr Connect() override; + void ProcessEvent(bthread_attr_t attr) override; + + // 由上层 Socket/连接流程使用,不暴露具体 Transport 类型。 + handshake::Phase connection_phase() const; + +private: + void StartClientUpgrade(); + void ProcessUpgradeReadable(); + void CompleteConnection(handshake::Phase terminal_phase); + void ActivateTcp(); + void ActivateHighSpeed(); + + handshake::HandshakeSession _handshake; + std::unique_ptr _tcp_transport; + std::unique_ptr _high_speed_transport; + std::unique_ptr _upgrade; +}; +``` + +`StartClientUpgrade` 和 `ProcessUpgradeReadable` 是上层编排入口。它们不能下沉到 `RdmaTransport`、`UBShmTransport` 或 endpoint。 + +### 5.3 ConnectionUpgradeCoordinator / HandshakeSession + +该模块拥有连接升级的完整流程: + +- 选择协议 codec; +- 通过 TCP 发送和接收 hello/ack; +- 增量 framing、半包和非本协议数据回放; +- 按固定顺序调用 Transport 能力接口; +- 将协议不支持、资源失败转换为 fallback; +- 发布 `kEstablished`、`kFallbackTcp` 或 `kFailed`; +- 在终态时通知 `AdapterTransport` 完成建链。 + +`HandshakeSession` 不知道 RDMA、URMA、UBSHM 的资源类型,只调用抽象的阶段接口。 + +### 5.4 具体 Transport + +具体 Transport 只负责: + +- 数据面读写、事件和 completion; +- 资源创建、导入、激活、停用和释放; +- 提供本端 hello 所需的只读能力/字段; +- 接收上层解析后的远端参数; +- 报告资源阶段成功、不可用或失败。 + +具体 Transport 不负责: + +- TCP fd 读写; +- magic/length framing; +- hello/ack 的收发顺序; +- server 增量解析; +- fallback 决策; +- `Socket` 建链完成通知; +- 公共 handshake phase 的推进。 + +## 6. Transport 能力接口 + +Transport 提供的是“被上层调用的资源能力”,不是 handshake driver。建议抽象为以下接口;具体命名可根据现有类调整: + +```cpp +class TransportUpgradeOps { +public: + virtual ~TransportUpgradeOps() = default; + + // 返回本端能力和协议 adapter 所需的字段来源。 + virtual handshake::StepResult PrepareLocal() = 0; + + // 上层完成 wire parse/validate 后交付远端参数。 + virtual handshake::StepResult ApplyRemote(const RemoteParameters&) = 0; + + // 创建、导入或建立数据面资源。 + virtual handshake::StepResult PrepareResources() = 0; + virtual handshake::StepResult NegotiateResources() = 0; + + // 握手 ACK 已发送/确认后切换数据面。 + virtual handshake::StepResult Activate() = 0; + + // fallback 或失败时关闭本次升级准备的资源。 + virtual void Deactivate() = 0; +}; +``` + +说明: + +- `PrepareLocal`、`ApplyRemote`、`PrepareResources`、`NegotiateResources` 的具体数量可以按现有资源模型合并,但调用顺序由 coordinator 固定。 +- 只有 `TransportUpgradeOps` 的实现可以访问 endpoint 和 transport-specific 类型。 +- 如果某种 Transport 不支持升级,应返回 `kFallback`,而不是创建一套假的握手状态机。 +- `Activate` 成功后,coordinator 才能发布 `kEstablished`。 +- 资源失败默认进入 `kFallbackTcp`;不可恢复的协议错误才进入 `kFailed`,具体策略由 coordinator 统一决定。 + +## 7. 协议 adapter 与公共编排的边界 + +每一种 wire protocol 保留自己的 `HandshakeCodec` 和字段 adapter: + +```cpp +struct HandshakeCodec { + int protocol_version; + FrameSpec hello_frame; + FrameSpec ack_frame; + std::function build_hello; + std::function parse_hello; + std::function build_ack; + std::function parse_ack; +}; +``` + +adapter 只处理以下内容: + +- magic、版本、字段序列化和反序列化; +- payload 合法性检查; +- 将字段转换为 `RemoteParameters`; +- 生成本端 hello 和 ack。 + +adapter 不再实现完整的 `RunServerHandshake` 或 `ProcessHandshakeAtClient`。这些函数中的流程代码应迁移到 coordinator;adapter 只提供 codec 和 `TransportUpgradeOps` 所需的字段转换。 + +server 端的 `HandshakeAdapter::ExecuteServerHandshake` 如果暂时需要保留以兼容 `InputMessenger`,其实现只能是薄适配层: + +```text +InputMessenger -> AdapterTransport/Coordinator -> HandshakeSession + | + `-> protocol codec + TransportUpgradeOps +``` + +它不应再根据 `SocketMode` 选择不同的 phase,也不应直接调用具体 Transport 的握手流程。 + +## 8. Client 建链时序 + +```mermaid +sequenceDiagram + participant S as Socket + participant A as AdapterTransport + participant C as Coordinator + participant T as TcpTransport + participant H as HandshakeSession + participant U as TransportUpgradeOps + + S->>A: Connect() + A->>T: 建立 TCP 控制连接 + T-->>A: TCP connected + A->>C: StartClientUpgrade() + C->>U: PrepareLocal() + C->>H: 发送 local hello + H->>T: WriteFrame() + T-->>H: 接收 remote hello + C->>U: ApplyRemote() / PrepareResources() + C->>U: NegotiateResources() + alt 升级成功 + C->>H: 发送 enabled ACK + C->>U: Activate() + C->>A: kEstablished + A->>S: ConnectionReady(high-speed) + else 对端不支持或资源失败 + C->>H: 发送 disabled ACK(如协议要求) + C->>U: Deactivate() + C->>A: kFallbackTcp + A->>S: ConnectionReady(tcp) + end +``` + +关键约束:`ConnectionReady` 只发送一次,并且必须发生在 active transport 已设置、fallback 缓冲区已回放、终态已 release-store 之后。 + +## 9. Server 建链时序 + +server 收到 TCP 数据后,由 `AdapterTransport` 的上层 coordinator 处理;具体 Transport 不参与入口选择: + +```text +TCP readable + -> AdapterTransport::ProcessUpgradeReadable + -> HandshakeSession::RunServer(input) + -> 根据 magic 选择 codec + -> 增量读取完整 hello + -> codec parse/validate + -> TransportUpgradeOps::ApplyRemote/NegotiateResources + -> 发送 ACK + -> Activate 或 Deactivate + -> AdapterTransport::CompleteConnection +``` + +对于 `IOBuf` 增量输入: + +- `kNeedMore` 时不得消费不完整 frame; +- magic 不匹配时必须把已检查的数据回放给 TCP parser; +- 已确认属于升级协议但资源失败时不能把完整握手 frame 当作普通 TCP 数据; +- ACK 没有 magic 时,选中的 codec 必须保存在 coordinator/session context 中,而不能依赖重新探测。 + +## 10. 连接终态与 Socket 通知 + +### 10.1 终态定义 + +| 终态 | active data transport | Socket 结果 | 说明 | +|---|---|---|---| +| `kEstablished` | 高速度 Transport | 建链完成 | `Activate()` 成功后发布 | +| `kFallbackTcp` | TCP Transport | 建链完成 | 协议不支持或资源不可用 | +| `kFailed` | 无 | 建链失败 | I/O、协议或不可恢复错误 | + +`kFallbackTcp` 不是失败。它表示控制连接成功且连接可继续使用 TCP。 + +### 10.2 发布顺序 + +统一采用以下顺序: + +```text +1. 设置 active transport +2. 回放 fallback 时已读但不属于握手的数据(仅 TCP fallback) +3. 发布终态 phase(release) +4. 通知 Socket::ConnectionReady / ConnectionFailed +``` + +事件线程观察到终态后,才能读取 active transport 和回放数据。禁止在 phase 发布后再修改 active transport。 + +### 10.3 TCP 数据保护 + +进入 `kEstablished` 后,TCP 只作为控制连接存在;如果收到额外 TCP 应用数据,应按协议错误处理,不能静默交给高速度数据面。进入 `kFallbackTcp` 后,后续数据全部交给 TCP Transport。 + +## 11. 现有实现迁移方案 + +### Phase 1:统一公共状态 + +- 用 `handshake::Phase` 替换 `HandshakePhases` 的六个 transport-specific 数值。 +- `HandshakeSession` 只写入统一 phase。 +- 保留具体 Transport 内部状态用于日志和资源调试,但不再通过 `handshake_phase()` 暴露给 Socket。 + +### Phase 2:收拢 client 入口 + +- 将所有 `ProcessHandshakeAtClient` 的调用点迁移到 `AdapterTransport::StartClientUpgrade`。 +- 删除具体 Transport 中的 client handshake driver。 +- 具体 Transport 改为实现 `TransportUpgradeOps`,只提供资源阶段操作。 +- `AdapterTransport::Connect` 在 TCP connected 后自动启动 coordinator。 + +### Phase 3:收拢 server 入口 + +- `InputMessenger` 只把 handshake 输入交给 `AdapterTransport`/coordinator。 +- `RdmaServerHandshakeAdapter`、`UBShmServerHandshakeAdapter` 等降级为 codec/字段 adapter 或薄兼容层。 +- 删除 adapter 内按 `SocketMode` 选择 `S_ACK_WAIT` 等 phase 的逻辑。 +- URMA 接入时直接实现统一的 codec 和 `TransportUpgradeOps`,不复制一套 server driver。 + +### Phase 4:统一连接完成通知 + +- 为 `AdapterTransport` 增加单一的 `CompleteConnection` 路径。 +- 升级成功、TCP fallback、失败分别通过统一终态通知 Socket。 +- 增加断言,确保 `ConnectionReady` 只发生一次,且发生在终态发布之后。 + +### Phase 5:删除旧路径 + +- 删除具体 Transport 的 `ProcessHandshakeAtClient`、`RunServerHandshake` 和握手 phase 映射。 +- 删除 Socket 对具体 Transport 类型和 transport-specific phase 的依赖。 +- 清理只为旧握手路径存在的 endpoint 回调。 + +## 12. 兼容性与测试要求 + +### 12.1 Wire compatibility + +重构不得改变: + +- RDMA v2/v3、URMA v2/v3、UBSHM v2 的 magic; +- frame length 的字节序和语义; +- hello/ack 的字段布局和 ACK bit; +- fallback hello 的兼容行为。 + +### 12.2 公共模块测试 + +至少覆盖: + +- 2 字节和 4 字节 magic; +- fixed、U16 total length、U32 body length; +- 半包、粘包和多余数据; +- `kNeedMore` 不消费不完整输入; +- magic 不匹配的 push-back; +- I/O error、EOF、超时和协议错误; +- 终态发布顺序和一次性连接通知。 + +### 12.3 集成矩阵 + +| 场景 | 预期结果 | +|---|---| +| RDMA v2 ↔ RDMA v2 | 高速度 Transport 建链 | +| RDMA v3 ↔ RDMA v3 | 高速度 Transport 建链 | +| URMA v2/v3 ↔ 对应版本 | 高速度 Transport 建链 | +| UBSHM ↔ UBSHM | UBSHM 建链 | +| 高速度 client ↔ TCP server | TCP fallback,Socket 建链成功 | +| TCP client ↔ 高速度 server | TCP 建链成功 | +| hello 合法但资源创建失败 | TCP fallback | +| 已识别握手协议后发生协议错误 | 建链失败,不回放为 TCP 数据 | + +## 13. 验收标准 + +设计落地后应满足: + +1. `Socket::_transport` 永远只指向 `AdapterTransport`,Socket 源码中没有具体 Transport 类型判断。 +2. client 和 server 都只有一个握手编排入口,代码库中不再存在具体 Transport 的 `ProcessHandshakeAtClient`。 +3. 公共握手状态只有一套 `handshake::Phase`,不存在 RDMA/UBSHM/URMA 到公共 phase 的数字映射。 +4. 具体 Transport 不读写 TCP fd,不解析 magic/length,不调用 `HandshakeSession::RunClient/RunServer`。 +5. 升级成功和 TCP fallback 都由 `AdapterTransport` 自动完成 active transport 切换,并向 Socket 发出一次建链完成通知。 +6. 在 wire compatibility 测试通过的前提下,握手流程、fallback 和连接完成通知可以通过公共 coordinator 单元测试验证。 + +## 14. 结论 + +最终边界如下: + +```text +Socket + 只感知 AdapterTransport 和 ConnectionReady + +AdapterTransport / Coordinator + 拥有 TCP-first、握手状态机、升级/fallback 编排、active transport 切换 + +HandshakeSession / Codec + 拥有公共 I/O、framing、协议字段编解码和统一状态 + +TransportUpgradeOps + 提供具体传输所需的资源阶段接口 + +RDMA / URMA / UBSHM Transport + 只拥有各自资源、数据面和 completion +``` + +一句话概括:**握手是上层连接编排,Transport 是被编排的数据传输能力;Socket 只通过 AdapterTransport 观察连接结果。** +## 15. 整体架构图 + +```mermaid +flowchart TB + S["Socket\n只感知 AdapterTransport"] + A["AdapterTransport\nTCP-first / 建链编排 / active transport"] + C["Connection Upgrade Coordinator\nStartClientUpgrade / ProcessUpgradeReadable\nCompleteConnection"] + H["HandshakeSession\n统一 framing / I/O / handshake::Phase"] + RA["Protocol Codec Adapter\nRDMA v2/v3 / URMA / UBSHM"] + O["TransportUpgradeOps\nPrepare / Negotiate / Activate / Deactivate"] + T["Concrete Transport\nTCP / RDMA / URMA / UBSHM"] + E["Endpoint / Resource\n只提供传输资源能力"] + IM["InputMessenger\nserver 增量输入"] + READY["ConnectionReady\nESTABLISHED / FALLBACK_TCP"] + FAIL["ConnectionFailed\nFAILED"] + + S -->|Connect| A + A -->|TCP connected| C + IM -->|ProcessUpgradeReadable| A + A --> C + C <--> H + C --> RA + C --> O + O --> T + T --> E + C -->|terminal phase| A + A --> READY + A --> FAIL +``` + +核心边界:`HandshakeSession` 负责公共握手流程,协议 Adapter 只负责 wire codec,`TransportUpgradeOps` 只负责资源能力;具体 Transport 不读取握手输入、不编排握手阶段,也不向 Socket 暴露 transport-specific phase。 diff --git a/src/brpc/adapter_transport.cpp b/src/brpc/adapter_transport.cpp new file mode 100644 index 0000000000..f7db329f26 --- /dev/null +++ b/src/brpc/adapter_transport.cpp @@ -0,0 +1,519 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/adapter_transport.h" + +#include +#include +#include + +#include "brpc/input_messenger.h" +#include "brpc/destroyable.h" +#include "brpc/handshake/rdma_handshake.h" +#include "brpc/handshake/ubshm_handshake.h" +#if BRPC_WITH_RDMA +#include "brpc/rdma/rdma_helper.h" +#endif +#if BRPC_WITH_UBRING +#include "brpc/ubshm/ub_helper.h" +#include "brpc/ubshm/ubr_trx.h" +#endif +#include "brpc/rdma_transport.h" +#include "brpc/tcp_transport.h" +#include "brpc/ubshm_transport.h" + +namespace brpc { + +namespace { + +class AdapterConnect : public AppConnect { +public: + explicit AdapterConnect(const std::shared_ptr& app_connect) + : _app_connect(app_connect) {} + + void StartConnect(const Socket* socket, + void (*done)(int, void*), void* data) override { + ApplicationConnectTask* task = new ApplicationConnectTask{ + socket, _app_connect, done, data}; + if (AdapterTransport::StartClientUpgrade( + socket, OnUpgradeComplete, task) != 0) { + AdapterTransport::Get(socket)->CompleteConnection( + handshake::FAILED); + const int error = errno != 0 ? errno : EAGAIN; + delete task; + done(error, data); + } + } + + void StopConnect(Socket*) override {} + +private: + struct ApplicationConnectTask { + const Socket* socket; + std::shared_ptr app_connect; + void (*done)(int, void*); + void* data; + }; + + static void OnApplicationComplete(int error, void* arg) { + std::unique_ptr task( + static_cast(arg)); + task->done(error, task->data); + } + + static void OnUpgradeComplete(int error, void* arg) { + ApplicationConnectTask* task = + static_cast(arg); + if (error != 0 || !task->app_connect) { + std::unique_ptr owned(task); + task->done(error, task->data); + return; + } + task->app_connect->StartConnect( + task->socket, OnApplicationComplete, task); + } + + std::shared_ptr _app_connect; +}; + +struct ClientHandshakeTask { + AdapterTransport* adapter; + void (*done)(int, void*); + void* data; +}; + +} // namespace + +AdapterTransport::~AdapterTransport() = default; + +AdapterTransport* AdapterTransport::Get(Socket* socket) { + CHECK(socket != NULL); + return static_cast(socket->_transport.get()); +} + +const AdapterTransport* AdapterTransport::Get(const Socket* socket) { + CHECK(socket != NULL); + return static_cast(socket->_transport.get()); +} + +int AdapterTransport::StartClientUpgrade(const Socket* socket, + void (*done)(int, void*), + void* data) { + AdapterTransport* adapter = Get(const_cast(socket)); + ClientHandshakeTask* task = new ClientHandshakeTask{adapter, done, data}; + bthread_t tid; + bthread_attr_t attr = BTHREAD_ATTR_NORMAL; + bthread_attr_set_name(&attr, "StartClientUpgrade"); + if (bthread_start_background(&tid, &attr, + ProcessClientHandshake, task) < 0) { + delete task; + return -1; + } + return 0; +} + +ParseResult AdapterTransport::ProcessUpgradeReadable(butil::IOBuf* source) { + ParseResult result; + if (_socket->parsing_context() != NULL) { + handshake::ServerHandshakeContext* context = + static_cast( + _socket->parsing_context()); + CHECK(context->adapter() != NULL); + result = context->adapter()->ExecuteServerHandshake(source, _socket); + } else { + const char* first = static_cast(source->fetch1()); + handshake::HandshakeAdapter* adapter = + first != NULL && *first == 'U' + ? handshake::GetUBShmServerHandshakeAdapter() + : handshake::GetRdmaServerHandshakeAdapter(); + result = adapter->ExecuteServerHandshake(source, _socket); + } + const int phase = _handshake.phase(); + if (!connection_completed() && + (phase == handshake::ESTABLISHED || + phase == handshake::FALLBACK_TCP || phase == handshake::FAILED)) { + CompleteConnection(static_cast(phase)); + } + return result; +} + +void AdapterTransport::CompleteConnection(handshake::Phase terminal_phase) { + CHECK(terminal_phase == handshake::ESTABLISHED || + terminal_phase == handshake::FALLBACK_TCP || + terminal_phase == handshake::FAILED); + if (terminal_phase == handshake::FAILED && + _handshake.phase() != handshake::FAILED) { + _handshake.MarkFailed(); + } + int expected = 0; + _connection_completed.compare_exchange_strong( + expected, 1, butil::memory_order_release, + butil::memory_order_relaxed); +} + +void* AdapterTransport::ProcessClientHandshake(void* arg) { + std::unique_ptr task( + static_cast(arg)); + AdapterTransport* adapter = task->adapter; + SocketUniquePtr socket(adapter->_socket); + int connect_error = 0; + +#if BRPC_WITH_RDMA + if (adapter->_mode == SOCKET_MODE_RDMA) { + RdmaTransport* transport = static_cast( + adapter->_high_speed_transport.get()); + if (!rdma::IsRdmaAvailable()) { + adapter->FallbackToTcp(); + adapter->CompleteConnection(handshake::FALLBACK_TCP); + task->done(0, task->data); + return NULL; + } + + std::unique_ptr protocol = + transport->CreateClientHandshakeAdapter(); + CHECK(protocol != NULL); + rdma::ParsedHello remote{}; + handshake::ClientHandshakeCallbacks callbacks{}; + callbacks.codec = protocol->MakeCodec(&remote); + callbacks.transport.prepare_resources = [&]() { + if (transport->PrepareUpgradeResources() == 0) { + return handshake::STEP_OK; + } + errno = 0; + return handshake::STEP_FALLBACK; + }; + callbacks.transport.negotiate_resources = [&]() { + return transport->NegotiateUpgradeResources(remote, false) == 0 + ? handshake::STEP_OK : handshake::STEP_FALLBACK; + }; + callbacks.transport.set_high_speed_active = [transport]() { + transport->ActivateUpgrade(); + }; + callbacks.transport.set_tcp_active = [transport]() { + transport->DeactivateUpgrade(); + }; + callbacks.transport.on_failed = [&]() { + const int saved_errno = errno != 0 ? errno : EPROTO; + socket->SetFailed(saved_errno, + "Fail to complete rdma handshake from %s: %s", + socket->description().c_str(), + berror(saved_errno)); + }; + const handshake::StepResult result = adapter->_handshake.RunClient(callbacks); + if (result == handshake::STEP_ERROR) { + connect_error = errno != 0 ? errno : EPROTO; + } + adapter->CompleteConnection(static_cast( + adapter->_handshake.phase())); + task->done(connect_error, task->data); + return NULL; + } +#endif + +#if BRPC_WITH_UBRING + if (adapter->_mode == SOCKET_MODE_UBRING) { + UBShmTransport* transport = static_cast( + adapter->_high_speed_transport.get()); + if (!ubring::IsUBAvailable()) { + adapter->FallbackToTcp(); + adapter->CompleteConnection(handshake::FALLBACK_TCP); + task->done(0, task->data); + return NULL; + } + + const size_t local_shm_len = + static_cast(ubring::FLAGS_data_queue_size) * MB_TO_BYTE; + ubring::SHM local_trx_shm = { + NULL, local_shm_len, 0, {0}, static_cast(socket->fd())}; + const std::string shm_name_str = + butil::endpoint2str(socket->local_side()); + ubring::HelloMessage remote{}; + ubring::UBShmHandshakeAdapter wire; + handshake::ClientHandshakeCallbacks callbacks{}; + callbacks.codec = wire.MakeCodec(); + callbacks.codec.build_hello = [&](bool enabled, std::string* payload) { + CHECK(enabled); + return wire.BuildHello(true, local_shm_len, shm_name_str.c_str(), + payload); + }; + callbacks.codec.parse_hello = [&](const std::string& payload) { + return wire.ParseHello(payload, &remote); + }; + callbacks.transport.prepare_resources = [&]() { + return transport->PrepareUpgradeResources( + &local_trx_shm, shm_name_str.c_str()) == 0 + ? handshake::STEP_OK : handshake::STEP_FALLBACK; + }; + callbacks.transport.negotiate_resources = [&]() { + return transport->NegotiateUpgradeResources( + &local_trx_shm, shm_name_str.c_str()) == 0 + ? handshake::STEP_OK : handshake::STEP_FALLBACK; + }; + callbacks.transport.set_high_speed_active = [transport]() { + transport->ActivateUpgrade(); + }; + callbacks.transport.set_tcp_active = [transport]() { + transport->DeactivateUpgrade(); + }; + callbacks.transport.on_failed = [&]() { + const int saved_errno = errno != 0 ? errno : EPROTO; + socket->SetFailed(saved_errno, + "Fail to complete ubring handshake from %s: %s", + socket->description().c_str(), + berror(saved_errno)); + }; + const handshake::StepResult result = adapter->_handshake.RunClient(callbacks); + if (result == handshake::STEP_OK) { + transport->FinishUpgrade(); + } + if (result == handshake::STEP_ERROR) { + connect_error = errno != 0 ? errno : EPROTO; + } + adapter->CompleteConnection(static_cast( + adapter->_handshake.phase())); + task->done(connect_error, task->data); + return NULL; + } +#endif + + socket->SetFailed(EPROTO, "Unsupported client transport handshake"); + adapter->CompleteConnection(handshake::FAILED); + task->done(EPROTO, task->data); + return NULL; +} + +void AdapterTransport::Init(Socket* socket, const SocketOptions& options) { + CHECK_EQ(_mode, options.socket_mode); + _socket = socket; + _default_connect = options.app_connect; + _on_edge_trigger = options.on_edge_triggered_events; + if (options.need_on_edge_trigger && _on_edge_trigger == NULL) { + if (_mode == SOCKET_MODE_TCP) { + _on_edge_trigger = InputMessenger::OnNewMessages; +#if BRPC_WITH_RDMA + } else if (_mode == SOCKET_MODE_RDMA && + options.user != static_cast( + get_client_side_messenger())) { + // RDMA server handshake is parsed by InputMessenger. + _on_edge_trigger = InputMessenger::OnNewMessages; +#endif +#if BRPC_WITH_UBRING + } else if (_mode == SOCKET_MODE_UBRING && + options.user != static_cast( + get_client_side_messenger())) { + // UBSHM server handshake is parsed by InputMessenger. + _on_edge_trigger = InputMessenger::OnNewMessages; +#endif + } else { + _on_edge_trigger = OnNewDataFromTcp; + } + } + _handshake.Reset(socket); + _connection_completed.store(0, butil::memory_order_relaxed); + _tcp_transport.reset(new TcpTransport); + _tcp_transport->Init(socket, options); + + switch (_mode) { +#if BRPC_WITH_RDMA + case SOCKET_MODE_RDMA: + _high_speed_transport.reset(new RdmaTransport); + break; +#endif +#if BRPC_WITH_UBRING + case SOCKET_MODE_UBRING: + _high_speed_transport.reset(new UBShmTransport); + break; +#endif + default: + break; + } + if (_high_speed_transport) { + _high_speed_transport->Init(socket, options); + } +} + +void AdapterTransport::Release() { + if (_high_speed_transport) { + _high_speed_transport->Release(); + } + _tcp_transport->Release(); +} + +int AdapterTransport::Reset(int32_t expected_nref) { + if (_high_speed_transport) { + _high_speed_transport->Reset(expected_nref); + } + _tcp_transport->Reset(expected_nref); + _handshake.Reset(_socket); + _connection_completed.store(0, butil::memory_order_relaxed); + return 0; +} + +std::shared_ptr AdapterTransport::Connect() { + if (_high_speed_transport) { + return std::make_shared(_default_connect); + } + return _tcp_transport->Connect(); +} + +Transport* AdapterTransport::ActiveTransport() const { + if (_high_speed_transport && + _handshake.phase() == handshake::ESTABLISHED) { + return _high_speed_transport.get(); + } + return _tcp_transport.get(); +} + +int AdapterTransport::CutFromIOBuf(butil::IOBuf* buf) { + return ActiveTransport()->CutFromIOBuf(buf); +} + +ssize_t AdapterTransport::CutFromIOBufList( + butil::IOBuf** buf, size_t ndata) { + return ActiveTransport()->CutFromIOBufList(buf, ndata); +} + +int AdapterTransport::WaitEpollOut(butil::atomic* epollout_butex, + bool pollin, timespec duetime) { + return ActiveTransport()->WaitEpollOut( + epollout_butex, pollin, duetime); +} + +void AdapterTransport::ProcessEvent(bthread_attr_t attr) { + ActiveTransport()->ProcessEvent(attr); +} + +void AdapterTransport::QueueMessage(InputMessageClosure& input_msg, + int* num_bthread_created, + bool last_msg) { + ActiveTransport()->QueueMessage( + input_msg, num_bthread_created, last_msg); +} + +void AdapterTransport::Debug(std::ostream& os) { + if (_high_speed_transport) { + _high_speed_transport->Debug(os); + } + const char* state = "UNKNOWN"; + switch (_handshake.phase()) { + case handshake::UNINITIALIZED: state = "UNINITIALIZED"; break; + case handshake::PREPARING: state = "PREPARING"; break; + case handshake::HELLO_SEND: state = "HELLO_SEND"; break; + case handshake::HELLO_WAIT: state = "HELLO_WAIT"; break; + case handshake::NEGOTIATING: state = "NEGOTIATING"; break; + case handshake::ACK_SEND: state = "ACK_SEND"; break; + case handshake::ACK_WAIT: state = "ACK_WAIT"; break; + case handshake::ESTABLISHED: state = "ESTABLISHED"; break; + case handshake::FALLBACK_TCP: state = "FALLBACK_TCP"; break; + case handshake::FAILED: state = "FAILED"; break; + } + os << "\nhandshake_state=" << state + << "\nhandshake_version=" << _handshake.protocol_version(); +} + +void AdapterTransport::FallbackToTcp() { + _handshake.PublishFallback([this]() { + SetHighSpeedAvailable(false); + }); +} + +void AdapterTransport::SetHighSpeedAvailable(bool available) { + if (!_high_speed_transport) { + return; + } + switch (_mode) { +#if BRPC_WITH_RDMA + case SOCKET_MODE_RDMA: + static_cast(_high_speed_transport.get()) + ->SetHighSpeedAvailable(available); + break; +#endif +#if BRPC_WITH_UBRING + case SOCKET_MODE_UBRING: + static_cast(_high_speed_transport.get()) + ->SetHighSpeedAvailable(available); + break; +#endif + default: + break; + } +} + +void AdapterTransport::OnNewDataFromTcp(Socket* socket) { + static_cast(socket->_transport.get())->ProcessTcpEvent(); +} + +void AdapterTransport::ProcessTcpEvent() { + int progress = Socket::PROGRESS_INIT; + while (true) { + const int phase = _handshake.phase(); + if (phase != handshake::UNINITIALIZED && + phase < handshake::ESTABLISHED) { + _handshake.NotifyReadable(); + } else if (phase == handshake::FALLBACK_TCP) { + InputMessenger::OnNewMessages(_socket); + return; + } else if (phase == handshake::ESTABLISHED) { + CheckUnexpectedTcpData(); + return; + } + if (!_socket->MoreReadEvents(&progress)) { + break; + } + } +} + +void AdapterTransport::CheckUnexpectedTcpData() { + int progress = Socket::PROGRESS_INIT; + while (true) { + uint8_t byte; + const ssize_t nr = read(_socket->fd(), &byte, 1); + if (nr == 0) { + _socket->SetEOF(); + return; + } + if (nr > 0) { + _socket->SetFailed(EPROTO, "Read unexpected data from %s", + _socket->description().c_str()); + return; + } + if (errno != EAGAIN) { + const int saved_errno = errno; + _socket->SetFailed(saved_errno, "Fail to read from %s: %s", + _socket->description().c_str(), + berror(saved_errno)); + return; + } + if (!_socket->MoreReadEvents(&progress)) { + return; + } + } +} + +void AdapterTransport::TryReadOnTcp() { + if (_socket->_nevent.fetch_add(1, butil::memory_order_acq_rel) != 0) { + return; + } + const int phase = _handshake.phase(); + if (phase == handshake::FALLBACK_TCP) { + InputMessenger::OnNewMessages(_socket); + } else if (phase == handshake::ESTABLISHED) { + CheckUnexpectedTcpData(); + } +} + +} // namespace brpc diff --git a/src/brpc/adapter_transport.h b/src/brpc/adapter_transport.h new file mode 100644 index 0000000000..637a508435 --- /dev/null +++ b/src/brpc/adapter_transport.h @@ -0,0 +1,101 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_ADAPTER_TRANSPORT_H +#define BRPC_ADAPTER_TRANSPORT_H + +#include + +#include "brpc/socket_mode.h" +#include "brpc/transport.h" +#include "brpc/transport_handshake.h" +#include "brpc/parse_result.h" + +namespace brpc { + +class TcpTransport; +class RdmaTransport; +class UBShmTransport; + +// The top-level Transport installed in Socket. It starts on TcpTransport and +// may switch to an independent RDMA/URMA/UBSHM Transport after a successful +// handshake. TCP remains usable before negotiation and after fallback. +class AdapterTransport : public Transport { + friend class TransportFactory; + friend class RdmaTransport; + friend class UBShmTransport; +public: + void Init(Socket* socket, const SocketOptions& options) override; + void Release() override; + int Reset(int32_t expected_nref) override; + std::shared_ptr Connect() override; + int CutFromIOBuf(butil::IOBuf* buf) override; + ssize_t CutFromIOBufList(butil::IOBuf** buf, size_t ndata) override; + int WaitEpollOut(butil::atomic* epollout_butex, + bool pollin, timespec duetime) override; + void ProcessEvent(bthread_attr_t attr) override; + void QueueMessage(InputMessageClosure& input_msg, + int* num_bthread_created, bool last_msg) override; + void Debug(std::ostream& os) override; + + int handshake_phase() const { return _handshake.phase(); } + int handshake_version() const { return _handshake.protocol_version(); } + handshake::HandshakeSession* handshake_session() { return &_handshake; } + Transport* high_speed_transport() const { + return _high_speed_transport.get(); + } + bool upgrade_capable() const { return _high_speed_transport != NULL; } + + static AdapterTransport* Get(Socket* socket); + static const AdapterTransport* Get(const Socket* socket); + + // The only client-side upgrade entry point. Concrete transports provide + // resources; AdapterTransport owns the handshake orchestration. + static int StartClientUpgrade(const Socket* socket, + void (*done)(int, void*), void* data); + + ParseResult ProcessUpgradeReadable(butil::IOBuf* source); + void CompleteConnection(handshake::Phase terminal_phase); + bool connection_completed() const { + return _connection_completed.load(butil::memory_order_acquire) != 0; + } + + static void OnNewDataFromTcp(Socket* socket); + +private: + explicit AdapterTransport(SocketMode mode) + : _mode(mode), _connection_completed(0) {} + ~AdapterTransport() override; + + Transport* ActiveTransport() const; + void SetHighSpeedAvailable(bool available); + void FallbackToTcp(); + void TryReadOnTcp(); + void ProcessTcpEvent(); + void CheckUnexpectedTcpData(); + static void* ProcessClientHandshake(void* arg); + + SocketMode _mode; + handshake::HandshakeSession _handshake; + std::unique_ptr _tcp_transport; + std::unique_ptr _high_speed_transport; + butil::atomic _connection_completed; +}; + +} // namespace brpc + +#endif // BRPC_ADAPTER_TRANSPORT_H diff --git a/src/brpc/global.cpp b/src/brpc/global.cpp index 812a79a183..9e45165e4a 100644 --- a/src/brpc/global.cpp +++ b/src/brpc/global.cpp @@ -15,48 +15,47 @@ // specific language governing permissions and limitations // under the License. - #ifndef USE_MESALINK -#include #include +#include + #else #include #endif +#include // O_RDONLY #include -#include // O_RDONLY #include -#include "butil/build_config.h" // OS_LINUX +#include "butil/build_config.h" // OS_LINUX #include "butil/debug/leak_annotations.h" // Naming services #ifdef BAIDU_INTERNAL #include "brpc/policy/baidu_naming_service.h" #endif -#include "brpc/policy/file_naming_service.h" -#include "brpc/policy/list_naming_service.h" -#include "brpc/policy/domain_naming_service.h" -#include "brpc/policy/remote_file_naming_service.h" #include "brpc/policy/consul_naming_service.h" #include "brpc/policy/discovery_naming_service.h" +#include "brpc/policy/domain_naming_service.h" +#include "brpc/policy/file_naming_service.h" +#include "brpc/policy/list_naming_service.h" #include "brpc/policy/nacos_naming_service.h" +#include "brpc/policy/remote_file_naming_service.h" // Load Balancers -#include "brpc/policy/round_robin_load_balancer.h" -#include "brpc/policy/weighted_round_robin_load_balancer.h" -#include "brpc/policy/randomized_load_balancer.h" -#include "brpc/policy/weighted_randomized_load_balancer.h" -#include "brpc/policy/locality_aware_load_balancer.h" -#include "brpc/policy/p2c_ewma_load_balancer.h" #include "brpc/policy/consistent_hashing_load_balancer.h" -#include "brpc/policy/hasher.h" #include "brpc/policy/dynpart_load_balancer.h" - +#include "brpc/policy/hasher.h" +#include "brpc/policy/locality_aware_load_balancer.h" +#include "brpc/policy/p2c_ewma_load_balancer.h" +#include "brpc/policy/randomized_load_balancer.h" +#include "brpc/policy/round_robin_load_balancer.h" +#include "brpc/policy/weighted_randomized_load_balancer.h" +#include "brpc/policy/weighted_round_robin_load_balancer.h" // Span #include "brpc/span.h" -#include "bthread/unstable.h" #include "bthread/bthread.h" +#include "bthread/unstable.h" // Compress handlers #include "brpc/compress.h" @@ -68,27 +67,28 @@ #include "brpc/policy/crc32c_checksum.h" // Protocols -#include "brpc/protocol.h" -#include "brpc/policy/rdma_handshake_protocol.h" #include "brpc/policy/baidu_rpc_protocol.h" -#include "brpc/policy/http_rpc_protocol.h" +#include "brpc/policy/couchbase_protocol.h" +#include "brpc/policy/esp_protocol.h" #include "brpc/policy/http2_rpc_protocol.h" +#include "brpc/policy/http_rpc_protocol.h" #include "brpc/policy/hulu_pbrpc_protocol.h" -#include "brpc/policy/nova_pbrpc_protocol.h" -#include "brpc/policy/public_pbrpc_protocol.h" -#include "brpc/policy/ubrpc2pb_protocol.h" -#include "brpc/policy/sofa_pbrpc_protocol.h" #include "brpc/policy/memcache_binary_protocol.h" -#include "brpc/policy/couchbase_protocol.h" -#include "brpc/policy/streaming_rpc_protocol.h" #include "brpc/policy/mongo_protocol.h" -#include "brpc/policy/redis_protocol.h" +#include "brpc/policy/mysql/mysql_protocol.h" +#include "brpc/policy/nova_pbrpc_protocol.h" #include "brpc/policy/nshead_mcpack_protocol.h" +#include "brpc/policy/public_pbrpc_protocol.h" +#include "brpc/policy/redis_protocol.h" #include "brpc/policy/rtmp_protocol.h" -#include "brpc/policy/esp_protocol.h" -#include "brpc/policy/mysql/mysql_protocol.h" +#include "brpc/policy/sofa_pbrpc_protocol.h" +#include "brpc/policy/streaming_rpc_protocol.h" +#include "brpc/policy/transport_handshake_protocol.h" +#include "brpc/policy/ubrpc2pb_protocol.h" +#include "brpc/protocol.h" + #ifdef ENABLE_THRIFT_FRAMED_PROTOCOL -# include "brpc/policy/thrift_protocol.h" +#include "brpc/policy/thrift_protocol.h" #endif // Concurrency Limiters @@ -97,13 +97,14 @@ #include "brpc/policy/constant_concurrency_limiter.h" #include "brpc/policy/timeout_concurrency_limiter.h" -#include "brpc/input_messenger.h" // get_or_new_client_side_messenger -#include "brpc/socket_map.h" // SocketMapList -#include "brpc/server.h" -#include "brpc/trackme.h" // TrackMe #include "brpc/details/usercode_backup_pool.h" +#include "brpc/input_messenger.h" // get_or_new_client_side_messenger +#include "brpc/server.h" +#include "brpc/socket_map.h" // SocketMapList +#include "brpc/trackme.h" // TrackMe + #if defined(OS_LINUX) -#include // malloc_trim +#include // malloc_trim #endif #include "butil/fd_guard.h" #include "butil/files/file_watcher.h" @@ -125,583 +126,658 @@ BRPC_VALIDATE_GFLAG(free_memory_to_system_interval, PassValidate); namespace policy { // Defined in http_rpc_protocol.cpp void InitCommonStrings(); -} +} // namespace policy using namespace policy; -const char* const DUMMY_SERVER_PORT_FILE = "dummy_server.port"; +const char *const DUMMY_SERVER_PORT_FILE = "dummy_server.port"; struct GlobalExtensions { - GlobalExtensions() - : dns(80) - , dns_with_ssl(443) - , ch_mh_lb(CONS_HASH_LB_MURMUR3) - , ch_md5_lb(CONS_HASH_LB_MD5) - , ch_ketama_lb(CONS_HASH_LB_KETAMA) - , constant_cl(0) { - } - + GlobalExtensions() + : dns(80), dns_with_ssl(443), ch_mh_lb(CONS_HASH_LB_MURMUR3), + ch_md5_lb(CONS_HASH_LB_MD5), ch_ketama_lb(CONS_HASH_LB_KETAMA), + constant_cl(0) {} + #ifdef BAIDU_INTERNAL - BaiduNamingService bns; + BaiduNamingService bns; #endif - FileNamingService fns; - ListNamingService lns; - DomainListNamingService dlns; - DomainNamingService dns; - DomainNamingService dns_with_ssl; - RemoteFileNamingService rfns; - ConsulNamingService cns; - DiscoveryNamingService dcns; - NacosNamingService nns; - - RoundRobinLoadBalancer rr_lb; - WeightedRoundRobinLoadBalancer wrr_lb; - RandomizedLoadBalancer randomized_lb; - WeightedRandomizedLoadBalancer wr_lb; - LocalityAwareLoadBalancer la_lb; - P2CEwmaLoadBalancer p2c_ewma_lb; - ConsistentHashingLoadBalancer ch_mh_lb; - ConsistentHashingLoadBalancer ch_md5_lb; - ConsistentHashingLoadBalancer ch_ketama_lb; - DynPartLoadBalancer dynpart_lb; - - AutoConcurrencyLimiter auto_cl; - ConstantConcurrencyLimiter constant_cl; - TimeoutConcurrencyLimiter timeout_cl; + FileNamingService fns; + ListNamingService lns; + DomainListNamingService dlns; + DomainNamingService dns; + DomainNamingService dns_with_ssl; + RemoteFileNamingService rfns; + ConsulNamingService cns; + DiscoveryNamingService dcns; + NacosNamingService nns; + + RoundRobinLoadBalancer rr_lb; + WeightedRoundRobinLoadBalancer wrr_lb; + RandomizedLoadBalancer randomized_lb; + WeightedRandomizedLoadBalancer wr_lb; + LocalityAwareLoadBalancer la_lb; + P2CEwmaLoadBalancer p2c_ewma_lb; + ConsistentHashingLoadBalancer ch_mh_lb; + ConsistentHashingLoadBalancer ch_md5_lb; + ConsistentHashingLoadBalancer ch_ketama_lb; + DynPartLoadBalancer dynpart_lb; + + AutoConcurrencyLimiter auto_cl; + ConstantConcurrencyLimiter constant_cl; + TimeoutConcurrencyLimiter timeout_cl; }; static pthread_once_t register_extensions_once = PTHREAD_ONCE_INIT; -static GlobalExtensions* g_ext = nullptr; - -static long ReadPortOfDummyServer(const char* filename) { - butil::fd_guard fd(open(filename, O_RDONLY)); - if (fd < 0) { - LOG(ERROR) << "Fail to open `" << DUMMY_SERVER_PORT_FILE << "'"; - return -1; - } - char port_str[32]; - const ssize_t nr = read(fd, port_str, sizeof(port_str)); - if (nr <= 0) { - LOG(ERROR) << "Fail to read `" << DUMMY_SERVER_PORT_FILE << "': " - << (nr == 0 ? "nothing to read" : berror()); - return -1; - } - port_str[std::min((size_t)nr, sizeof(port_str)-1)] = '\0'; - const char* p = port_str; - for (; isspace(*p); ++p) {} - char* endptr = nullptr; - const long port = strtol(p, &endptr, 10); - for (; isspace(*endptr); ++endptr) {} - if (*endptr != '\0') { - LOG(ERROR) << "Invalid port=`" << port_str << "'"; - return -1; - } - return port; +static GlobalExtensions *g_ext = nullptr; + +static long ReadPortOfDummyServer(const char *filename) { + butil::fd_guard fd(open(filename, O_RDONLY)); + if (fd < 0) { + LOG(ERROR) << "Fail to open `" << DUMMY_SERVER_PORT_FILE << "'"; + return -1; + } + char port_str[32]; + const ssize_t nr = read(fd, port_str, sizeof(port_str)); + if (nr <= 0) { + LOG(ERROR) << "Fail to read `" << DUMMY_SERVER_PORT_FILE + << "': " << (nr == 0 ? "nothing to read" : berror()); + return -1; + } + port_str[std::min((size_t)nr, sizeof(port_str) - 1)] = '\0'; + const char *p = port_str; + for (; isspace(*p); ++p) { + } + char *endptr = nullptr; + const long port = strtol(p, &endptr, 10); + for (; isspace(*endptr); ++endptr) { + } + if (*endptr != '\0') { + LOG(ERROR) << "Invalid port=`" << port_str << "'"; + return -1; + } + return port; } // Expose counters of butil::IOBuf -static int64_t GetIOBufBlockCount(void*) { - return butil::IOBuf::block_count(); +static int64_t GetIOBufBlockCount(void *) { + return butil::IOBuf::block_count(); } -static int64_t GetIOBufBlockCountHitTLSThreshold(void*) { - return butil::IOBuf::block_count_hit_tls_threshold(); +static int64_t GetIOBufBlockCountHitTLSThreshold(void *) { + return butil::IOBuf::block_count_hit_tls_threshold(); } -static int64_t GetIOBufNewBigViewCount(void*) { - return butil::IOBuf::new_bigview_count(); +static int64_t GetIOBufNewBigViewCount(void *) { + return butil::IOBuf::new_bigview_count(); } -static int64_t GetIOBufBlockMemory(void*) { - return butil::IOBuf::block_memory(); +static int64_t GetIOBufBlockMemory(void *) { + return butil::IOBuf::block_memory(); } // Defined in server.cpp extern butil::static_atomic g_running_server_count; -static int GetRunningServerCount(void*) { - return g_running_server_count.load(butil::memory_order_relaxed); +static int GetRunningServerCount(void *) { + return g_running_server_count.load(butil::memory_order_relaxed); } // Update global stuff periodically. -static void* GlobalUpdate(void*) { - // This bthread runs for the whole process lifetime and never returns, so - // the local objects below live until the process exits and their - // destructors never run. They are reachable from this bthread's stack, so - // the objects themselves are not reported as leaks, but the heap buffers - // they allocate while exposing themselves (variable names, watched path) - // would be. Disable leak detection only around their construction and - // re-enable it right after. - ANNOTATE_MEMORY_LEAK_DISABLE(); - // Expose variables. - bvar::PassiveStatus var_iobuf_block_count( - "iobuf_block_count", GetIOBufBlockCount, nullptr); - bvar::PassiveStatus var_iobuf_block_count_hit_tls_threshold( - "iobuf_block_count_hit_tls_threshold", - GetIOBufBlockCountHitTLSThreshold, nullptr); - bvar::PassiveStatus var_iobuf_new_bigview_count( - GetIOBufNewBigViewCount, nullptr); - bvar::PerSecond > var_iobuf_new_bigview_second( - "iobuf_newbigview_second", &var_iobuf_new_bigview_count); - bvar::PassiveStatus var_iobuf_block_memory( - "iobuf_block_memory", GetIOBufBlockMemory, nullptr); - bvar::PassiveStatus var_running_server_count( - "rpc_server_count", GetRunningServerCount, nullptr); - - butil::FileWatcher fw; - const int fw_rc = fw.init_from_not_exist(DUMMY_SERVER_PORT_FILE); - ANNOTATE_MEMORY_LEAK_ENABLE(); - if (fw_rc < 0) { - LOG(FATAL) << "Fail to init FileWatcher on `" << DUMMY_SERVER_PORT_FILE << "'"; - return nullptr; - } - - std::vector conns; - const int64_t start_time_us = butil::cpuwide_time_us(); - const int WARN_NOSLEEP_THRESHOLD = 2; - int64_t last_time_us = start_time_us; - int consecutive_nosleep = 0; - int64_t last_return_free_memory_time = start_time_us; - while (1) { - const int64_t sleep_us = 1000000L + last_time_us - butil::cpuwide_time_us(); - if (sleep_us > 0) { - if (bthread_usleep(sleep_us) < 0) { - PLOG_IF(FATAL, errno != ESTOP) << "Fail to sleep"; - break; - } - consecutive_nosleep = 0; - } else { - if (++consecutive_nosleep >= WARN_NOSLEEP_THRESHOLD) { - consecutive_nosleep = 0; - LOG(WARNING) << __FUNCTION__ << " is too busy!"; - } - } - last_time_us = butil::cpuwide_time_us(); - - TrackMe(); - - if (!IsDummyServerRunning() - && g_running_server_count.load(butil::memory_order_relaxed) == 0 - && fw.check_and_consume() > 0) { - long port = ReadPortOfDummyServer(DUMMY_SERVER_PORT_FILE); - if (port >= 0) { - StartDummyServerAt(port); - } - } - - { - // See detail above. - ANNOTATE_SCOPED_MEMORY_LEAK; - SocketMapList(&conns); - } - const int64_t now_ms = butil::cpuwide_time_ms(); - for (size_t i = 0; i < conns.size(); ++i) { - SocketUniquePtr ptr; - if (Socket::Address(conns[i], &ptr) == 0) { - ptr->UpdateStatsEverySecond(now_ms); - } - } - - const int return_mem_interval = - FLAGS_free_memory_to_system_interval/*reloadable*/; - if (return_mem_interval > 0 && - last_time_us >= last_return_free_memory_time + - return_mem_interval * 1000000L) { - last_return_free_memory_time = last_time_us; - // TODO: Calling MallocExtension::instance()->ReleaseFreeMemory may - // crash the program in later calls to malloc, verified on tcmalloc - // 1.7 and 2.5, which means making the static member function weak - // in details/tcmalloc_extension.cpp is probably not correct, however - // it does work for heap profilers. - if (MallocExtension_ReleaseFreeMemory != nullptr) { - MallocExtension_ReleaseFreeMemory(); - } else { +static void *GlobalUpdate(void *) { + // This bthread runs for the whole process lifetime and never returns, so + // the local objects below live until the process exits and their + // destructors never run. They are reachable from this bthread's stack, so + // the objects themselves are not reported as leaks, but the heap buffers + // they allocate while exposing themselves (variable names, watched path) + // would be. Disable leak detection only around their construction and + // re-enable it right after. + ANNOTATE_MEMORY_LEAK_DISABLE(); + // Expose variables. + bvar::PassiveStatus var_iobuf_block_count( + "iobuf_block_count", GetIOBufBlockCount, nullptr); + bvar::PassiveStatus var_iobuf_block_count_hit_tls_threshold( + "iobuf_block_count_hit_tls_threshold", GetIOBufBlockCountHitTLSThreshold, + nullptr); + bvar::PassiveStatus var_iobuf_new_bigview_count( + GetIOBufNewBigViewCount, nullptr); + bvar::PerSecond> var_iobuf_new_bigview_second( + "iobuf_newbigview_second", &var_iobuf_new_bigview_count); + bvar::PassiveStatus var_iobuf_block_memory( + "iobuf_block_memory", GetIOBufBlockMemory, nullptr); + bvar::PassiveStatus var_running_server_count( + "rpc_server_count", GetRunningServerCount, nullptr); + + butil::FileWatcher fw; + const int fw_rc = fw.init_from_not_exist(DUMMY_SERVER_PORT_FILE); + ANNOTATE_MEMORY_LEAK_ENABLE(); + if (fw_rc < 0) { + LOG(FATAL) << "Fail to init FileWatcher on `" << DUMMY_SERVER_PORT_FILE + << "'"; + return nullptr; + } + + std::vector conns; + const int64_t start_time_us = butil::cpuwide_time_us(); + const int WARN_NOSLEEP_THRESHOLD = 2; + int64_t last_time_us = start_time_us; + int consecutive_nosleep = 0; + int64_t last_return_free_memory_time = start_time_us; + while (1) { + const int64_t sleep_us = 1000000L + last_time_us - butil::cpuwide_time_us(); + if (sleep_us > 0) { + if (bthread_usleep(sleep_us) < 0) { + PLOG_IF(FATAL, errno != ESTOP) << "Fail to sleep"; + break; + } + consecutive_nosleep = 0; + } else { + if (++consecutive_nosleep >= WARN_NOSLEEP_THRESHOLD) { + consecutive_nosleep = 0; + LOG(WARNING) << __FUNCTION__ << " is too busy!"; + } + } + last_time_us = butil::cpuwide_time_us(); + + TrackMe(); + + if (!IsDummyServerRunning() && + g_running_server_count.load(butil::memory_order_relaxed) == 0 && + fw.check_and_consume() > 0) { + long port = ReadPortOfDummyServer(DUMMY_SERVER_PORT_FILE); + if (port >= 0) { + StartDummyServerAt(port); + } + } + + { + // See detail above. + ANNOTATE_SCOPED_MEMORY_LEAK; + SocketMapList(&conns); + } + const int64_t now_ms = butil::cpuwide_time_ms(); + for (size_t i = 0; i < conns.size(); ++i) { + SocketUniquePtr ptr; + if (Socket::Address(conns[i], &ptr) == 0) { + ptr->UpdateStatsEverySecond(now_ms); + } + } + + const int return_mem_interval = + FLAGS_free_memory_to_system_interval /*reloadable*/; + if (return_mem_interval > 0 && + last_time_us >= + last_return_free_memory_time + return_mem_interval * 1000000L) { + last_return_free_memory_time = last_time_us; + // TODO: Calling MallocExtension::instance()->ReleaseFreeMemory may + // crash the program in later calls to malloc, verified on tcmalloc + // 1.7 and 2.5, which means making the static member function weak + // in details/tcmalloc_extension.cpp is probably not correct, however + // it does work for heap profilers. + if (MallocExtension_ReleaseFreeMemory != nullptr) { + MallocExtension_ReleaseFreeMemory(); + } else { #if defined(OS_LINUX) - // GNU specific. - malloc_trim(10 * 1024 * 1024/*leave 10M pad*/); + // GNU specific. + malloc_trim(10 * 1024 * 1024 /*leave 10M pad*/); #endif - } - } + } } - return nullptr; + } + return nullptr; } #if GOOGLE_PROTOBUF_VERSION < 3022000 static void BaiduStreamingLogHandler(google::protobuf::LogLevel level, - const char* filename, int line, - const std::string& message) { - switch (level) { - case google::protobuf::LOGLEVEL_INFO: - LOG(INFO) << filename << ':' << line << ' ' << message; - return; - case google::protobuf::LOGLEVEL_WARNING: - LOG(WARNING) << filename << ':' << line << ' ' << message; - return; - case google::protobuf::LOGLEVEL_ERROR: - LOG(ERROR) << filename << ':' << line << ' ' << message; - return; - case google::protobuf::LOGLEVEL_FATAL: - LOG(FATAL) << filename << ':' << line << ' ' << message; - return; - } - CHECK(false) << filename << ':' << line << ' ' << message; + const char *filename, int line, + const std::string &message) { + switch (level) { + case google::protobuf::LOGLEVEL_INFO: + LOG(INFO) << filename << ':' << line << ' ' << message; + return; + case google::protobuf::LOGLEVEL_WARNING: + LOG(WARNING) << filename << ':' << line << ' ' << message; + return; + case google::protobuf::LOGLEVEL_ERROR: + LOG(ERROR) << filename << ':' << line << ' ' << message; + return; + case google::protobuf::LOGLEVEL_FATAL: + LOG(FATAL) << filename << ':' << line << ' ' << message; + return; + } + CHECK(false) << filename << ':' << line << ' ' << message; } #endif static void GlobalInitializeOrDieImpl() { - ////////////////////////////////////////////////////////////////// - // Be careful about usages of gflags inside this function which // - // may be called before main() only seeing gflags with default // - // values even if the gflags will be set after main(). // - ////////////////////////////////////////////////////////////////// - - // Ignore SIGPIPE. - struct sigaction oldact; - if (sigaction(SIGPIPE, nullptr, &oldact) != 0 || - (oldact.sa_handler == nullptr && oldact.sa_sigaction == nullptr)) { - CHECK(SIG_ERR != signal(SIGPIPE, SIG_IGN)); - } + ////////////////////////////////////////////////////////////////// + // Be careful about usages of gflags inside this function which // + // may be called before main() only seeing gflags with default // + // values even if the gflags will be set after main(). // + ////////////////////////////////////////////////////////////////// + + // Ignore SIGPIPE. + struct sigaction oldact; + if (sigaction(SIGPIPE, nullptr, &oldact) != 0 || + (oldact.sa_handler == nullptr && oldact.sa_sigaction == nullptr)) { + CHECK(SIG_ERR != signal(SIGPIPE, SIG_IGN)); + } #if GOOGLE_PROTOBUF_VERSION < 3022000 - // Make GOOGLE_LOG print to comlog device - SetLogHandler(&BaiduStreamingLogHandler); + // Make GOOGLE_LOG print to comlog device + SetLogHandler(&BaiduStreamingLogHandler); #endif - if (bthread_set_span_funcs(CreateBthreadSpanAsVoid, - DestroyRpczParentSpan, - EndBthreadSpan) != 0) { - LOG(FATAL) << "Failed to register span callbacks to bthread"; - } - - // Setting the variable here does not work, the profiler probably check - // the variable before main() for only once. - // setenv("TCMALLOC_SAMPLE_PARAMETER", "524288", 0); - - // Initialize openssl library - SSL_library_init(); - // RPC doesn't require openssl.cnf, users can load it by themselves if needed - SSL_load_error_strings(); - if (SSLThreadInit() != 0 || SSLDHInit() != 0) { - exit(1); - } - - // Defined in http_rpc_protocol.cpp - InitCommonStrings(); - - // Leave memory of these extensions to process's clean up. - g_ext = new GlobalExtensions(); - // Naming Services + if (bthread_set_span_funcs(CreateBthreadSpanAsVoid, DestroyRpczParentSpan, + EndBthreadSpan) != 0) { + LOG(FATAL) << "Failed to register span callbacks to bthread"; + } + + // Setting the variable here does not work, the profiler probably check + // the variable before main() for only once. + // setenv("TCMALLOC_SAMPLE_PARAMETER", "524288", 0); + + // Initialize openssl library + SSL_library_init(); + // RPC doesn't require openssl.cnf, users can load it by themselves if needed + SSL_load_error_strings(); + if (SSLThreadInit() != 0 || SSLDHInit() != 0) { + exit(1); + } + + // Defined in http_rpc_protocol.cpp + InitCommonStrings(); + + // Leave memory of these extensions to process's clean up. + g_ext = new GlobalExtensions(); + // Naming Services #ifdef BAIDU_INTERNAL - NamingServiceExtension()->RegisterOrDie("bns", &g_ext->bns); + NamingServiceExtension()->RegisterOrDie("bns", &g_ext->bns); #endif - NamingServiceExtension()->RegisterOrDie("file", &g_ext->fns); - NamingServiceExtension()->RegisterOrDie("list", &g_ext->lns); - NamingServiceExtension()->RegisterOrDie("dlist", &g_ext->dlns); - NamingServiceExtension()->RegisterOrDie("http", &g_ext->dns); - NamingServiceExtension()->RegisterOrDie("https", &g_ext->dns_with_ssl); - NamingServiceExtension()->RegisterOrDie("redis", &g_ext->dns); - NamingServiceExtension()->RegisterOrDie("remotefile", &g_ext->rfns); - NamingServiceExtension()->RegisterOrDie("consul", &g_ext->cns); - NamingServiceExtension()->RegisterOrDie("discovery", &g_ext->dcns); - NamingServiceExtension()->RegisterOrDie("nacos", &g_ext->nns); - - // Load Balancers - LoadBalancerExtension()->RegisterOrDie("rr", &g_ext->rr_lb); - LoadBalancerExtension()->RegisterOrDie("wrr", &g_ext->wrr_lb); - LoadBalancerExtension()->RegisterOrDie("random", &g_ext->randomized_lb); - LoadBalancerExtension()->RegisterOrDie("wr", &g_ext->wr_lb); - LoadBalancerExtension()->RegisterOrDie("la", &g_ext->la_lb); - LoadBalancerExtension()->RegisterOrDie("p2c", &g_ext->p2c_ewma_lb); - LoadBalancerExtension()->RegisterOrDie("c_murmurhash", &g_ext->ch_mh_lb); - LoadBalancerExtension()->RegisterOrDie("c_md5", &g_ext->ch_md5_lb); - LoadBalancerExtension()->RegisterOrDie("c_ketama", &g_ext->ch_ketama_lb); - LoadBalancerExtension()->RegisterOrDie("_dynpart", &g_ext->dynpart_lb); - - // Compress Handlers - CompressHandler gzip_compress = { GzipCompress, GzipDecompress, "gzip" }; - if (RegisterCompressHandler(COMPRESS_TYPE_GZIP, gzip_compress) != 0) { - exit(1); - } - CompressHandler zlib_compress = { ZlibCompress, ZlibDecompress, "zlib" }; - if (RegisterCompressHandler(COMPRESS_TYPE_ZLIB, zlib_compress) != 0) { - exit(1); - } - CompressHandler snappy_compress = { SnappyCompress, SnappyDecompress, "snappy" }; - if (RegisterCompressHandler(COMPRESS_TYPE_SNAPPY, snappy_compress) != 0) { - exit(1); - } - - // Checksum Handlers - const ChecksumHandler crc32c_checksum = {Crc32cCompute, Crc32cVerify, - "crc32c"}; - if (RegisterChecksumHandler(CHECKSUM_TYPE_CRC32C, crc32c_checksum) != 0) { - exit(1); - } - - // Protocols - Protocol rdma_handshake_protocol = { - ParseRdmaHandshake, nullptr, nullptr, - ProcessRdmaHandshake, nullptr, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_ALL, "rdma_handshake" }; - if (RegisterProtocol(PROTOCOL_RDMA_HANDSHAKE, rdma_handshake_protocol) != 0) { - exit(1); - } - - Protocol baidu_protocol = { ParseRpcMessage, - SerializeRpcRequest, PackRpcRequest, - ProcessRpcRequest, ProcessRpcResponse, - VerifyRpcRequest, nullptr, nullptr, - CONNECTION_TYPE_ALL, "baidu_std" }; - if (RegisterProtocol(PROTOCOL_BAIDU_STD, baidu_protocol) != 0) { - exit(1); - } - - Protocol streaming_protocol = { ParseStreamingMessage, - nullptr, nullptr, ProcessStreamingMessage, - ProcessStreamingMessage, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_SINGLE, "streaming_rpc" }; - - if (RegisterProtocol(PROTOCOL_STREAMING_RPC, streaming_protocol) != 0) { - exit(1); - } - - Protocol http_protocol = { ParseHttpMessage, - SerializeHttpRequest, PackHttpRequest, - ProcessHttpRequest, ProcessHttpResponse, - VerifyHttpRequest, ParseHttpServerAddress, - GetHttpMethodName, - CONNECTION_TYPE_POOLED_AND_SHORT, - "http" }; - if (RegisterProtocol(PROTOCOL_HTTP, http_protocol) != 0) { - exit(1); - } - - Protocol http2_protocol = { ParseH2Message, - SerializeHttpRequest, PackH2Request, - ProcessHttpRequest, ProcessHttpResponse, - VerifyHttpRequest, ParseHttpServerAddress, - GetHttpMethodName, - CONNECTION_TYPE_SINGLE, - "h2" }; - if (RegisterProtocol(PROTOCOL_H2, http2_protocol) != 0) { - exit(1); - } - - Protocol hulu_protocol = { ParseHuluMessage, - SerializeRequestDefault, PackHuluRequest, - ProcessHuluRequest, ProcessHuluResponse, - VerifyHuluRequest, nullptr, nullptr, - CONNECTION_TYPE_ALL, "hulu_pbrpc" }; - if (RegisterProtocol(PROTOCOL_HULU_PBRPC, hulu_protocol) != 0) { - exit(1); - } - - // Only valid at client side - Protocol nova_protocol = { ParseNsheadMessage, - SerializeNovaRequest, PackNovaRequest, - nullptr, ProcessNovaResponse, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "nova_pbrpc" }; - if (RegisterProtocol(PROTOCOL_NOVA_PBRPC, nova_protocol) != 0) { - exit(1); - } - - // Only valid at client side - Protocol public_pbrpc_protocol = { ParseNsheadMessage, - SerializePublicPbrpcRequest, - PackPublicPbrpcRequest, - nullptr, ProcessPublicPbrpcResponse, - nullptr, nullptr, nullptr, - // public_pbrpc server implementation - // doesn't support full duplex - CONNECTION_TYPE_POOLED_AND_SHORT, - "public_pbrpc" }; - if (RegisterProtocol(PROTOCOL_PUBLIC_PBRPC, public_pbrpc_protocol) != 0) { - exit(1); - } - - Protocol sofa_protocol = { ParseSofaMessage, - SerializeRequestDefault, PackSofaRequest, - ProcessSofaRequest, ProcessSofaResponse, - VerifySofaRequest, nullptr, nullptr, - CONNECTION_TYPE_ALL, "sofa_pbrpc" }; - if (RegisterProtocol(PROTOCOL_SOFA_PBRPC, sofa_protocol) != 0) { - exit(1); - } - - // Only valid at server side. We generalize all the protocols that - // prefixes with nshead as `nshead_protocol' and specify the content - // parsing after nshead by ServerOptions.nshead_service. - Protocol nshead_protocol = { ParseNsheadMessage, - SerializeNsheadRequest, PackNsheadRequest, - ProcessNsheadRequest, ProcessNsheadResponse, - VerifyNsheadRequest, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "nshead" }; - if (RegisterProtocol(PROTOCOL_NSHEAD, nshead_protocol) != 0) { - exit(1); - } - - Protocol mc_binary_protocol = { ParseMemcacheMessage, - SerializeMemcacheRequest, - PackMemcacheRequest, - nullptr, ProcessMemcacheResponse, - nullptr, nullptr, GetMemcacheMethodName, - CONNECTION_TYPE_ALL, "memcache" }; - if (RegisterProtocol(PROTOCOL_MEMCACHE, mc_binary_protocol) != 0) { - exit(1); - } - - Protocol couchbase_protocol = { ParseCouchbaseMessage, - SerializeCouchbaseRequest, - PackCouchbaseRequest, - nullptr, ProcessCouchbaseResponse, - nullptr, nullptr, GetCouchbaseMethodName, - CONNECTION_TYPE_ALL, "couchbase" }; - if (RegisterProtocol(PROTOCOL_COUCHBASE, couchbase_protocol) != 0) { - exit(1); - } - - Protocol redis_protocol = { ParseRedisMessage, - SerializeRedisRequest, - PackRedisRequest, - ProcessRedisRequest, ProcessRedisResponse, - nullptr, nullptr, GetRedisMethodName, - CONNECTION_TYPE_ALL, "redis" }; - if (RegisterProtocol(PROTOCOL_REDIS, redis_protocol) != 0) { - exit(1); - } - - Protocol mongo_protocol = { ParseMongoMessage, - nullptr, nullptr, - ProcessMongoRequest, nullptr, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED, "mongo" }; - if (RegisterProtocol(PROTOCOL_MONGO, mongo_protocol) != 0) { - exit(1); - } - -// Use Macro is more straight forward than weak link technology(becasue of static link issue) + NamingServiceExtension()->RegisterOrDie("file", &g_ext->fns); + NamingServiceExtension()->RegisterOrDie("list", &g_ext->lns); + NamingServiceExtension()->RegisterOrDie("dlist", &g_ext->dlns); + NamingServiceExtension()->RegisterOrDie("http", &g_ext->dns); + NamingServiceExtension()->RegisterOrDie("https", &g_ext->dns_with_ssl); + NamingServiceExtension()->RegisterOrDie("redis", &g_ext->dns); + NamingServiceExtension()->RegisterOrDie("remotefile", &g_ext->rfns); + NamingServiceExtension()->RegisterOrDie("consul", &g_ext->cns); + NamingServiceExtension()->RegisterOrDie("discovery", &g_ext->dcns); + NamingServiceExtension()->RegisterOrDie("nacos", &g_ext->nns); + + // Load Balancers + LoadBalancerExtension()->RegisterOrDie("rr", &g_ext->rr_lb); + LoadBalancerExtension()->RegisterOrDie("wrr", &g_ext->wrr_lb); + LoadBalancerExtension()->RegisterOrDie("random", &g_ext->randomized_lb); + LoadBalancerExtension()->RegisterOrDie("wr", &g_ext->wr_lb); + LoadBalancerExtension()->RegisterOrDie("la", &g_ext->la_lb); + LoadBalancerExtension()->RegisterOrDie("p2c", &g_ext->p2c_ewma_lb); + LoadBalancerExtension()->RegisterOrDie("c_murmurhash", &g_ext->ch_mh_lb); + LoadBalancerExtension()->RegisterOrDie("c_md5", &g_ext->ch_md5_lb); + LoadBalancerExtension()->RegisterOrDie("c_ketama", &g_ext->ch_ketama_lb); + LoadBalancerExtension()->RegisterOrDie("_dynpart", &g_ext->dynpart_lb); + + // Compress Handlers + CompressHandler gzip_compress = {GzipCompress, GzipDecompress, "gzip"}; + if (RegisterCompressHandler(COMPRESS_TYPE_GZIP, gzip_compress) != 0) { + exit(1); + } + CompressHandler zlib_compress = {ZlibCompress, ZlibDecompress, "zlib"}; + if (RegisterCompressHandler(COMPRESS_TYPE_ZLIB, zlib_compress) != 0) { + exit(1); + } + CompressHandler snappy_compress = {SnappyCompress, SnappyDecompress, + "snappy"}; + if (RegisterCompressHandler(COMPRESS_TYPE_SNAPPY, snappy_compress) != 0) { + exit(1); + } + + // Checksum Handlers + const ChecksumHandler crc32c_checksum = {Crc32cCompute, Crc32cVerify, + "crc32c"}; + if (RegisterChecksumHandler(CHECKSUM_TYPE_CRC32C, crc32c_checksum) != 0) { + exit(1); + } + + // Protocols + Protocol transport_handshake_protocol = {ParseTransportHandshake, + nullptr, + nullptr, + ProcessTransportHandshake, + nullptr, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_ALL, + "rdma_handshake"}; + + Protocol rdma_handshake_protocol = {ParseRdmaHandshake, + nullptr, + nullptr, + ProcessRdmaHandshake, + nullptr, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_ALL, + "rdma_handshake"}; + // Retain the existing enum value and registered name to avoid changing + // public protocol identifiers while widening the implementation from RDMA + // to all transport upgrades. + if (RegisterProtocol(PROTOCOL_RDMA_HANDSHAKE, transport_handshake_protocol) != + 0) { + exit(1); + } + + Protocol baidu_protocol = {ParseRpcMessage, + SerializeRpcRequest, + PackRpcRequest, + ProcessRpcRequest, + ProcessRpcResponse, + VerifyRpcRequest, + nullptr, + nullptr, + CONNECTION_TYPE_ALL, + "baidu_std"}; + if (RegisterProtocol(PROTOCOL_BAIDU_STD, baidu_protocol) != 0) { + exit(1); + } + + Protocol streaming_protocol = { + ParseStreamingMessage, nullptr, nullptr, ProcessStreamingMessage, + ProcessStreamingMessage, nullptr, nullptr, nullptr, + CONNECTION_TYPE_SINGLE, "streaming_rpc"}; + + if (RegisterProtocol(PROTOCOL_STREAMING_RPC, streaming_protocol) != 0) { + exit(1); + } + + Protocol http_protocol = {ParseHttpMessage, + SerializeHttpRequest, + PackHttpRequest, + ProcessHttpRequest, + ProcessHttpResponse, + VerifyHttpRequest, + ParseHttpServerAddress, + GetHttpMethodName, + CONNECTION_TYPE_POOLED_AND_SHORT, + "http"}; + if (RegisterProtocol(PROTOCOL_HTTP, http_protocol) != 0) { + exit(1); + } + + Protocol http2_protocol = {ParseH2Message, SerializeHttpRequest, + PackH2Request, ProcessHttpRequest, + ProcessHttpResponse, VerifyHttpRequest, + ParseHttpServerAddress, GetHttpMethodName, + CONNECTION_TYPE_SINGLE, "h2"}; + if (RegisterProtocol(PROTOCOL_H2, http2_protocol) != 0) { + exit(1); + } + + Protocol hulu_protocol = {ParseHuluMessage, + SerializeRequestDefault, + PackHuluRequest, + ProcessHuluRequest, + ProcessHuluResponse, + VerifyHuluRequest, + nullptr, + nullptr, + CONNECTION_TYPE_ALL, + "hulu_pbrpc"}; + if (RegisterProtocol(PROTOCOL_HULU_PBRPC, hulu_protocol) != 0) { + exit(1); + } + + // Only valid at client side + Protocol nova_protocol = {ParseNsheadMessage, + SerializeNovaRequest, + PackNovaRequest, + nullptr, + ProcessNovaResponse, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "nova_pbrpc"}; + if (RegisterProtocol(PROTOCOL_NOVA_PBRPC, nova_protocol) != 0) { + exit(1); + } + + // Only valid at client side + Protocol public_pbrpc_protocol = { + ParseNsheadMessage, SerializePublicPbrpcRequest, PackPublicPbrpcRequest, + nullptr, ProcessPublicPbrpcResponse, nullptr, nullptr, nullptr, + // public_pbrpc server implementation + // doesn't support full duplex + CONNECTION_TYPE_POOLED_AND_SHORT, "public_pbrpc"}; + if (RegisterProtocol(PROTOCOL_PUBLIC_PBRPC, public_pbrpc_protocol) != 0) { + exit(1); + } + + Protocol sofa_protocol = {ParseSofaMessage, + SerializeRequestDefault, + PackSofaRequest, + ProcessSofaRequest, + ProcessSofaResponse, + VerifySofaRequest, + nullptr, + nullptr, + CONNECTION_TYPE_ALL, + "sofa_pbrpc"}; + if (RegisterProtocol(PROTOCOL_SOFA_PBRPC, sofa_protocol) != 0) { + exit(1); + } + + // Only valid at server side. We generalize all the protocols that + // prefixes with nshead as `nshead_protocol' and specify the content + // parsing after nshead by ServerOptions.nshead_service. + Protocol nshead_protocol = {ParseNsheadMessage, + SerializeNsheadRequest, + PackNsheadRequest, + ProcessNsheadRequest, + ProcessNsheadResponse, + VerifyNsheadRequest, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "nshead"}; + if (RegisterProtocol(PROTOCOL_NSHEAD, nshead_protocol) != 0) { + exit(1); + } + + Protocol mc_binary_protocol = {ParseMemcacheMessage, + SerializeMemcacheRequest, + PackMemcacheRequest, + nullptr, + ProcessMemcacheResponse, + nullptr, + nullptr, + GetMemcacheMethodName, + CONNECTION_TYPE_ALL, + "memcache"}; + if (RegisterProtocol(PROTOCOL_MEMCACHE, mc_binary_protocol) != 0) { + exit(1); + } + + Protocol couchbase_protocol = {ParseCouchbaseMessage, + SerializeCouchbaseRequest, + PackCouchbaseRequest, + nullptr, + ProcessCouchbaseResponse, + nullptr, + nullptr, + GetCouchbaseMethodName, + CONNECTION_TYPE_ALL, + "couchbase"}; + if (RegisterProtocol(PROTOCOL_COUCHBASE, couchbase_protocol) != 0) { + exit(1); + } + + Protocol redis_protocol = {ParseRedisMessage, + SerializeRedisRequest, + PackRedisRequest, + ProcessRedisRequest, + ProcessRedisResponse, + nullptr, + nullptr, + GetRedisMethodName, + CONNECTION_TYPE_ALL, + "redis"}; + if (RegisterProtocol(PROTOCOL_REDIS, redis_protocol) != 0) { + exit(1); + } + + Protocol mongo_protocol = { + ParseMongoMessage, nullptr, nullptr, ProcessMongoRequest, nullptr, + nullptr, nullptr, nullptr, CONNECTION_TYPE_POOLED, "mongo"}; + if (RegisterProtocol(PROTOCOL_MONGO, mongo_protocol) != 0) { + exit(1); + } + +// Use Macro is more straight forward than weak link technology(becasue of +// static link issue) #ifdef ENABLE_THRIFT_FRAMED_PROTOCOL - Protocol thrift_binary_protocol = { - policy::ParseThriftMessage, - policy::SerializeThriftRequest, policy::PackThriftRequest, - policy::ProcessThriftRequest, policy::ProcessThriftResponse, - policy::VerifyThriftRequest, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "thrift" }; - if (RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) { - exit(1); - } + Protocol thrift_binary_protocol = {policy::ParseThriftMessage, + policy::SerializeThriftRequest, + policy::PackThriftRequest, + policy::ProcessThriftRequest, + policy::ProcessThriftResponse, + policy::VerifyThriftRequest, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "thrift"}; + if (RegisterProtocol(PROTOCOL_THRIFT, thrift_binary_protocol) != 0) { + exit(1); + } #endif - // Only valid at client side - Protocol ubrpc_compack_protocol = { - ParseNsheadMessage, - SerializeUbrpcCompackRequest, PackUbrpcRequest, - nullptr, ProcessUbrpcResponse, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "ubrpc_compack" }; - if (RegisterProtocol(PROTOCOL_UBRPC_COMPACK, ubrpc_compack_protocol) != 0) { - exit(1); - } - Protocol ubrpc_mcpack2_protocol = { - ParseNsheadMessage, - SerializeUbrpcMcpack2Request, PackUbrpcRequest, - nullptr, ProcessUbrpcResponse, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "ubrpc_mcpack2" }; - if (RegisterProtocol(PROTOCOL_UBRPC_MCPACK2, ubrpc_mcpack2_protocol) != 0) { - exit(1); - } - - // Only valid at client side - Protocol nshead_mcpack_protocol = { - ParseNsheadMessage, - SerializeNsheadMcpackRequest, PackNsheadMcpackRequest, - nullptr, ProcessNsheadMcpackResponse, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "nshead_mcpack" }; - if (RegisterProtocol(PROTOCOL_NSHEAD_MCPACK, nshead_mcpack_protocol) != 0) { - exit(1); - } - - Protocol rtmp_protocol = { - ParseRtmpMessage, - SerializeRtmpRequest, PackRtmpRequest, - ProcessRtmpMessage, ProcessRtmpMessage, - nullptr, nullptr, nullptr, - (ConnectionType)(CONNECTION_TYPE_SINGLE|CONNECTION_TYPE_SHORT), - "rtmp" }; - if (RegisterProtocol(PROTOCOL_RTMP, rtmp_protocol) != 0) { + // Only valid at client side + Protocol ubrpc_compack_protocol = {ParseNsheadMessage, + SerializeUbrpcCompackRequest, + PackUbrpcRequest, + nullptr, + ProcessUbrpcResponse, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "ubrpc_compack"}; + if (RegisterProtocol(PROTOCOL_UBRPC_COMPACK, ubrpc_compack_protocol) != 0) { + exit(1); + } + Protocol ubrpc_mcpack2_protocol = {ParseNsheadMessage, + SerializeUbrpcMcpack2Request, + PackUbrpcRequest, + nullptr, + ProcessUbrpcResponse, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "ubrpc_mcpack2"}; + if (RegisterProtocol(PROTOCOL_UBRPC_MCPACK2, ubrpc_mcpack2_protocol) != 0) { + exit(1); + } + + // Only valid at client side + Protocol nshead_mcpack_protocol = {ParseNsheadMessage, + SerializeNsheadMcpackRequest, + PackNsheadMcpackRequest, + nullptr, + ProcessNsheadMcpackResponse, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "nshead_mcpack"}; + if (RegisterProtocol(PROTOCOL_NSHEAD_MCPACK, nshead_mcpack_protocol) != 0) { + exit(1); + } + + Protocol rtmp_protocol = { + ParseRtmpMessage, + SerializeRtmpRequest, + PackRtmpRequest, + ProcessRtmpMessage, + ProcessRtmpMessage, + nullptr, + nullptr, + nullptr, + (ConnectionType)(CONNECTION_TYPE_SINGLE | CONNECTION_TYPE_SHORT), + "rtmp"}; + if (RegisterProtocol(PROTOCOL_RTMP, rtmp_protocol) != 0) { + exit(1); + } + + Protocol esp_protocol = {ParseEspMessage, + SerializeEspRequest, + PackEspRequest, + nullptr, + ProcessEspResponse, + nullptr, + nullptr, + nullptr, + CONNECTION_TYPE_POOLED_AND_SHORT, + "esp"}; + if (RegisterProtocol(PROTOCOL_ESP, esp_protocol) != 0) { + exit(1); + } + + Protocol mysql_protocol = {ParseMysqlMessage, + SerializeMysqlRequest, + PackMysqlRequest, + nullptr, + ProcessMysqlResponse, + nullptr, + nullptr, + GetMysqlMethodName, + CONNECTION_TYPE_POOLED_AND_SHORT, + "mysql"}; + if (RegisterProtocol(PROTOCOL_MYSQL, mysql_protocol) != 0) { + exit(1); + } + + std::vector protocols; + ListProtocols(&protocols); + for (size_t i = 0; i < protocols.size(); ++i) { + if (protocols[i].process_response) { + InputMessageHandler handler; + // `process_response' is required at client side + handler.parse = protocols[i].parse; + handler.process = protocols[i].process_response; + // No need to verify at client side + handler.verify = nullptr; + handler.arg = nullptr; + handler.name = protocols[i].name; + if (get_or_new_client_side_messenger()->AddHandler(handler) != 0) { exit(1); - } - - Protocol esp_protocol = { - ParseEspMessage, - SerializeEspRequest, PackEspRequest, - nullptr, ProcessEspResponse, - nullptr, nullptr, nullptr, - CONNECTION_TYPE_POOLED_AND_SHORT, "esp"}; - if (RegisterProtocol(PROTOCOL_ESP, esp_protocol) != 0) { - exit(1); - } - - Protocol mysql_protocol = {ParseMysqlMessage, - SerializeMysqlRequest, - PackMysqlRequest, - nullptr, - ProcessMysqlResponse, - nullptr, - nullptr, - GetMysqlMethodName, - CONNECTION_TYPE_POOLED_AND_SHORT, - "mysql"}; - if (RegisterProtocol(PROTOCOL_MYSQL, mysql_protocol) != 0) { - exit(1); - } - - std::vector protocols; - ListProtocols(&protocols); - for (size_t i = 0; i < protocols.size(); ++i) { - if (protocols[i].process_response) { - InputMessageHandler handler; - // `process_response' is required at client side - handler.parse = protocols[i].parse; - handler.process = protocols[i].process_response; - // No need to verify at client side - handler.verify = nullptr; - handler.arg = nullptr; - handler.name = protocols[i].name; - if (get_or_new_client_side_messenger()->AddHandler(handler) != 0) { - exit(1); - } - } - } - - // Concurrency Limiters - ConcurrencyLimiterExtension()->RegisterOrDie("auto", &g_ext->auto_cl); - ConcurrencyLimiterExtension()->RegisterOrDie("constant", &g_ext->constant_cl); - ConcurrencyLimiterExtension()->RegisterOrDie("timeout", &g_ext->timeout_cl); - - if (FLAGS_usercode_in_pthread) { - // Optional. If channel/server are initialized before main(), this - // flag may be false at here even if it will be set to true after - // main(). In which case, the usercode pool will not be initialized - // until the pool is used. - InitUserCodeBackupPoolOnceOrDie(); - } - - // We never join GlobalUpdate, let it quit with the process. - bthread_t th; - bthread_attr_t attr = BTHREAD_ATTR_NORMAL; - bthread_attr_set_name(&attr, "GlobalUpdate"); - CHECK(bthread_start_background(&th, &attr, GlobalUpdate, nullptr) == 0) - << "Fail to start GlobalUpdate"; + } + } + } + + // Concurrency Limiters + ConcurrencyLimiterExtension()->RegisterOrDie("auto", &g_ext->auto_cl); + ConcurrencyLimiterExtension()->RegisterOrDie("constant", &g_ext->constant_cl); + ConcurrencyLimiterExtension()->RegisterOrDie("timeout", &g_ext->timeout_cl); + + if (FLAGS_usercode_in_pthread) { + // Optional. If channel/server are initialized before main(), this + // flag may be false at here even if it will be set to true after + // main(). In which case, the usercode pool will not be initialized + // until the pool is used. + InitUserCodeBackupPoolOnceOrDie(); + } + + // We never join GlobalUpdate, let it quit with the process. + bthread_t th; + bthread_attr_t attr = BTHREAD_ATTR_NORMAL; + bthread_attr_set_name(&attr, "GlobalUpdate"); + CHECK(bthread_start_background(&th, &attr, GlobalUpdate, nullptr) == 0) + << "Fail to start GlobalUpdate"; } void GlobalInitializeOrDie() { - if (pthread_once(®ister_extensions_once, - GlobalInitializeOrDieImpl) != 0) { - LOG(FATAL) << "Fail to pthread_once"; - exit(1); - } + if (pthread_once(®ister_extensions_once, GlobalInitializeOrDieImpl) != 0) { + LOG(FATAL) << "Fail to pthread_once"; + exit(1); + } } } // namespace brpc diff --git a/src/brpc/handshake/handshake_adapter.cpp b/src/brpc/handshake/handshake_adapter.cpp new file mode 100644 index 0000000000..0c9c72765a --- /dev/null +++ b/src/brpc/handshake/handshake_adapter.cpp @@ -0,0 +1,55 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/handshake/handshake_adapter.h" + +#include "brpc/socket.h" + +namespace brpc { +namespace handshake { + +// InputMessenger may call this entry repeatedly while bytes arrive. Keep all +// connection state in HandshakeSession and Socket rather than in the adapter, +// so a single stateless adapter can serve every connection. The parsing +// context retains that selected adapter between the server hello and the peer +// ACK, whose frame has no protocol magic of its own. +ParseResult StandardHandshakeAdapter::ExecuteServerHandshake( + butil::IOBuf* source, Socket* socket) { + const StepResult result = RunServerStep(source, socket); + if (result == STEP_NEED_MORE) { + if (GetSession(socket)->phase() == ACK_WAIT && + socket->parsing_context() == NULL) { + ServerHandshakeContext* context = + ServerHandshakeContext::Create(this); + if (context == NULL) { + GetSession(socket)->MarkFailed(); + return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); + } + socket->reset_parsing_context(context); + } + return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); + } + + socket->reset_parsing_context(NULL); + if (result == STEP_ERROR) { + return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); + } + return MakeParseError(PARSE_ERROR_TRY_OTHERS); +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/handshake/handshake_adapter.h b/src/brpc/handshake/handshake_adapter.h new file mode 100644 index 0000000000..2a344c9ed3 --- /dev/null +++ b/src/brpc/handshake/handshake_adapter.h @@ -0,0 +1,73 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_HANDSHAKE_HANDSHAKE_ADAPTER_H +#define BRPC_HANDSHAKE_HANDSHAKE_ADAPTER_H + +#include "butil/macros.h" +#include "brpc/parse_result.h" +#include "brpc/transport_handshake.h" + +namespace butil { +class IOBuf; +} + +namespace brpc { + +class Socket; + +namespace handshake { + +// The minimal seam between an upgrade protocol and InputMessenger. Protocols +// that cannot use the standard parser lifecycle implement this interface +// directly. +class HandshakeAdapter { +public: + virtual ~HandshakeAdapter() = default; + + virtual ParseResult ExecuteServerHandshake( + butil::IOBuf* source, Socket* socket) = 0; + +protected: + HandshakeAdapter() = default; + +private: + DISALLOW_COPY_AND_ASSIGN(HandshakeAdapter); +}; + +// Reusable InputMessenger implementation. Protocol adapters provide only the +// protocol-specific server step; the common session owns all phases. +class StandardHandshakeAdapter : public HandshakeAdapter { +public: + ParseResult ExecuteServerHandshake( + butil::IOBuf* source, Socket* socket) override; + +protected: + StandardHandshakeAdapter() = default; + + virtual StepResult RunServerStep( + butil::IOBuf* source, Socket* socket) = 0; + virtual HandshakeSession* GetSession(Socket* socket) const = 0; + +private: + DISALLOW_COPY_AND_ASSIGN(StandardHandshakeAdapter); +}; + +} // namespace handshake +} // namespace brpc + +#endif // BRPC_HANDSHAKE_HANDSHAKE_ADAPTER_H diff --git a/src/brpc/handshake/handshake_frame.cpp b/src/brpc/handshake/handshake_frame.cpp new file mode 100644 index 0000000000..f25e50c15c --- /dev/null +++ b/src/brpc/handshake/handshake_frame.cpp @@ -0,0 +1,235 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/handshake/handshake_frame.h" + +#include +#include +#include + +#include "butil/sys_byteorder.h" + +namespace brpc { +namespace handshake { + +size_t FrameCodec::LengthFieldSize(const FrameSpec& spec) { + switch (spec.length_encoding) { + case FrameSpec::FIXED: return 0; + case FrameSpec::U16_TOTAL_LENGTH: return sizeof(uint16_t); + case FrameSpec::U32_BODY_LENGTH: return sizeof(uint32_t); + } + return 0; +} + +FrameResult FrameCodec::DecodeLength(const FrameSpec& spec, + const void* header, + size_t* frame_len) { + const size_t length_size = LengthFieldSize(spec); + const size_t header_len = spec.magic_len + length_size; + if (spec.min_frame_len < header_len || + spec.max_frame_len < spec.min_frame_len) { + return FRAME_PROTOCOL_ERROR; + } + + if (spec.length_encoding == FrameSpec::FIXED) { + if (spec.min_frame_len != spec.max_frame_len) { + return FRAME_PROTOCOL_ERROR; + } + *frame_len = spec.min_frame_len; + } else if (spec.length_encoding == FrameSpec::U16_TOTAL_LENGTH) { + uint16_t total_be = 0; + memcpy(&total_be, static_cast(header) + spec.magic_len, + sizeof(total_be)); + *frame_len = butil::NetToHost16(total_be); + } else { + uint32_t body_be = 0; + memcpy(&body_be, static_cast(header) + spec.magic_len, + sizeof(body_be)); + const size_t body_len = butil::NetToHost32(body_be); + if (body_len > std::numeric_limits::max() - header_len) { + return FRAME_PROTOCOL_ERROR; + } + *frame_len = header_len + body_len; + } + + if (*frame_len < spec.min_frame_len || + *frame_len > spec.max_frame_len) { + return FRAME_PROTOCOL_ERROR; + } + return FRAME_OK; +} + +FrameResult FrameCodec::Encode(const FrameSpec& spec, + const std::string& payload, + std::string* frame) { + if (frame == NULL || (spec.magic_len != 0 && spec.magic == NULL)) { + return FRAME_PROTOCOL_ERROR; + } + const size_t length_size = LengthFieldSize(spec); + const size_t header_len = spec.magic_len + length_size; + if (payload.size() > std::numeric_limits::max() - header_len) { + return FRAME_PROTOCOL_ERROR; + } + const size_t total_len = header_len + payload.size(); + if (total_len < spec.min_frame_len || total_len > spec.max_frame_len) { + return FRAME_PROTOCOL_ERROR; + } + if (spec.length_encoding == FrameSpec::FIXED && + spec.min_frame_len != spec.max_frame_len) { + return FRAME_PROTOCOL_ERROR; + } + if (spec.length_encoding == FrameSpec::U16_TOTAL_LENGTH && + total_len > std::numeric_limits::max()) { + return FRAME_PROTOCOL_ERROR; + } + if (spec.length_encoding == FrameSpec::U32_BODY_LENGTH && + payload.size() > std::numeric_limits::max()) { + return FRAME_PROTOCOL_ERROR; + } + + frame->clear(); + frame->reserve(total_len); + if (spec.magic_len != 0) { + frame->append(spec.magic, spec.magic_len); + } + if (spec.length_encoding == FrameSpec::U16_TOTAL_LENGTH) { + const uint16_t total_be = + butil::HostToNet16(static_cast(total_len)); + frame->append(reinterpret_cast(&total_be), + sizeof(total_be)); + } else if (spec.length_encoding == FrameSpec::U32_BODY_LENGTH) { + const uint32_t body_be = + butil::HostToNet32(static_cast(payload.size())); + frame->append(reinterpret_cast(&body_be), + sizeof(body_be)); + } + frame->append(payload); + return FRAME_OK; +} + +FrameResult FrameCodec::ReadFrame(HandshakeIO* io, const FrameSpec& spec, + bool push_back_on_not_mine, + std::string* payload) { + if (io == NULL || payload == NULL || + (spec.magic_len != 0 && spec.magic == NULL)) { + return FRAME_PROTOCOL_ERROR; + } + + std::string header(spec.magic_len + LengthFieldSize(spec), '\0'); + if (spec.magic_len != 0 && + io->ReadExact(&header[0], spec.magic_len) < 0) { + return FRAME_IO_ERROR; + } + if (spec.magic_len != 0 && + memcmp(header.data(), spec.magic, spec.magic_len) != 0) { + if (push_back_on_not_mine && + io->PushBack(header.data(), spec.magic_len) < 0) { + return FRAME_IO_ERROR; + } + return FRAME_NOT_MINE; + } + + const size_t length_size = LengthFieldSize(spec); + if (length_size != 0 && + io->ReadExact(&header[spec.magic_len], length_size) < 0) { + return FRAME_IO_ERROR; + } + size_t frame_len = 0; + FrameResult result = DecodeLength(spec, header.data(), &frame_len); + if (result != FRAME_OK) { + return result; + } + const size_t body_len = frame_len - header.size(); + payload->assign(body_len, '\0'); + if (body_len != 0 && io->ReadExact(&(*payload)[0], body_len) < 0) { + return FRAME_IO_ERROR; + } + return FRAME_OK; +} + +FrameResult FrameCodec::ParseBufferedFrame(HandshakeInput* input, + const FrameSpec& spec, + std::string* payload, + bool* magic_matched) { + if (magic_matched != NULL) { + *magic_matched = false; + } + if (input == NULL || payload == NULL || + (spec.magic_len != 0 && spec.magic == NULL)) { + return FRAME_PROTOCOL_ERROR; + } + const size_t header_len = spec.magic_len + LengthFieldSize(spec); + if (input->Size() < spec.magic_len) { + return FRAME_NEED_MORE; + } + std::string header(header_len, '\0'); + if (spec.magic_len != 0 && + !input->CopyTo(&header[0], spec.magic_len)) { + return FRAME_NEED_MORE; + } + if (spec.magic_len != 0 && + memcmp(header.data(), spec.magic, spec.magic_len) != 0) { + return FRAME_NOT_MINE; + } + if (magic_matched != NULL) { + *magic_matched = true; + } + if (input->Size() < header_len || + (header_len != 0 && !input->CopyTo(&header[0], header_len))) { + return FRAME_NEED_MORE; + } + size_t frame_len = 0; + FrameResult result = DecodeLength(spec, header.data(), &frame_len); + if (result != FRAME_OK) { + return result; + } + if (input->Size() < frame_len) { + return FRAME_NEED_MORE; + } + + std::string frame(frame_len, '\0'); + if (!input->CopyTo(&frame[0], frame_len)) { + return FRAME_NEED_MORE; + } + if (!input->Consume(frame_len)) { + return FRAME_PROTOCOL_ERROR; + } + payload->assign(frame.data() + header_len, frame_len - header_len); + return FRAME_OK; +} + +FrameResult FrameCodec::WriteFrame(HandshakeIO* io, const FrameSpec& spec, + const std::string& payload) { + if (io == NULL) { + return FRAME_PROTOCOL_ERROR; + } + std::string frame; + const FrameResult result = Encode(spec, payload, &frame); + if (result != FRAME_OK) { + return result; + } + return io->WriteAll(frame.data(), frame.size()) == 0 + ? FRAME_OK : FRAME_IO_ERROR; +} + +FrameResult FrameCodec::DrainFrame(HandshakeIO* io, const FrameSpec& spec) { + std::string ignored; + return ReadFrame(io, spec, false, &ignored); +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/handshake/handshake_frame.h b/src/brpc/handshake/handshake_frame.h new file mode 100644 index 0000000000..dbe399f738 --- /dev/null +++ b/src/brpc/handshake/handshake_frame.h @@ -0,0 +1,92 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_HANDSHAKE_HANDSHAKE_FRAME_H +#define BRPC_HANDSHAKE_HANDSHAKE_FRAME_H + +#include +#include + +#include "brpc/handshake/handshake_io.h" + +namespace brpc { +namespace handshake { + +enum FrameResult { + FRAME_OK = 0, + FRAME_NOT_MINE, + FRAME_NEED_MORE, + FRAME_IO_ERROR, + FRAME_PROTOCOL_ERROR, +}; + +struct FrameSpec { + enum LengthEncoding { + FIXED, + U16_TOTAL_LENGTH, + U32_BODY_LENGTH, + }; + + FrameSpec() + : magic(NULL), magic_len(0), min_frame_len(0), max_frame_len(0), + length_encoding(FIXED) {} + + FrameSpec(const char* magic_in, size_t magic_len_in, + size_t min_frame_len_in, size_t max_frame_len_in, + LengthEncoding length_encoding_in) + : magic(magic_in), magic_len(magic_len_in), + min_frame_len(min_frame_len_in), + max_frame_len(max_frame_len_in), + length_encoding(length_encoding_in) {} + + const char* magic; + size_t magic_len; + size_t min_frame_len; + size_t max_frame_len; + LengthEncoding length_encoding; +}; + +// Handles only framing. Protocol implementations receive and produce payloads +// after magic/length fields and remain responsible for their own business +// fields and version semantics. +class FrameCodec { +public: + static FrameResult Encode(const FrameSpec& spec, + const std::string& payload, + std::string* frame); + static FrameResult ReadFrame(HandshakeIO* io, const FrameSpec& spec, + bool push_back_on_not_mine, + std::string* payload); + static FrameResult ParseBufferedFrame(HandshakeInput* input, + const FrameSpec& spec, + std::string* payload, + bool* magic_matched = NULL); + static FrameResult WriteFrame(HandshakeIO* io, const FrameSpec& spec, + const std::string& payload); + static FrameResult DrainFrame(HandshakeIO* io, const FrameSpec& spec); + +private: + static size_t LengthFieldSize(const FrameSpec& spec); + static FrameResult DecodeLength(const FrameSpec& spec, + const void* header, + size_t* frame_len); +}; + +} // namespace handshake +} // namespace brpc + +#endif // BRPC_HANDSHAKE_HANDSHAKE_FRAME_H diff --git a/src/brpc/handshake/handshake_io.cpp b/src/brpc/handshake/handshake_io.cpp new file mode 100644 index 0000000000..bf592d78ea --- /dev/null +++ b/src/brpc/handshake/handshake_io.cpp @@ -0,0 +1,145 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/handshake/handshake_io.h" + +#include +#include +#include + +#include "bthread/butex.h" +#include "butil/time.h" +#include "brpc/errno.pb.h" +#include "brpc/socket.h" + +namespace brpc { +namespace handshake { + +size_t IOBufHandshakeInput::Size() const { + return _source != NULL ? _source->size() : 0; +} + +bool IOBufHandshakeInput::CopyTo(void* data, size_t len) const { + return _source != NULL && _source->copy_to(data, len) == len; +} + +bool IOBufHandshakeInput::Consume(size_t len) { + return _source != NULL && _source->pop_front(len) == len; +} + +static const int WAIT_TIMEOUT_MS = 50; + +SocketHandshakeIO::SocketHandshakeIO(Socket* socket) + : _socket(socket) + , _read_butex(bthread::butex_create_checked >()) { +} + +SocketHandshakeIO::~SocketHandshakeIO() { + bthread::butex_destroy(_read_butex); +} + +void SocketHandshakeIO::Reset(Socket* socket) { + _socket = socket; +} + +void SocketHandshakeIO::NotifyReadable() { + _read_butex->fetch_add(1, butil::memory_order_release); + bthread::butex_wake(_read_butex); +} + +template +static int ReadExactLoop(butil::atomic* read_butex, + size_t len, ReadOnce read_once) { + size_t received = 0; + while (received < len) { + const int expected = read_butex->load(butil::memory_order_acquire); + const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); + const ssize_t nr = read_once(received, len - received); + if (nr < 0) { + if (errno != EAGAIN) { + return -1; + } + if (bthread::butex_wait(read_butex, expected, &duetime) < 0 && + errno != EWOULDBLOCK && errno != ETIMEDOUT) { + return -1; + } + } else if (nr == 0) { + errno = EEOF; + return -1; + } else { + received += nr; + } + } + return 0; +} + +int SocketHandshakeIO::ReadExact(void* data, size_t len) { + CHECK(data != NULL); + CHECK(_socket != NULL); + const int fd = _socket->fd(); + return ReadExactLoop(_read_butex, len, + [data, fd](size_t offset, size_t remaining) { + return read(fd, static_cast(data) + offset, remaining); + }); +} + +template +static int WriteAllLoop(Socket* socket, size_t len, WriteOnce write_once) { + size_t written = 0; + while (written < len) { + const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); + const ssize_t nw = write_once(written, len - written); + if (nw > 0) { + written += nw; + continue; + } + if (nw == 0) { + errno = EPIPE; + return -1; + } + if (errno != EAGAIN) { + return -1; + } + if (socket->WaitEpollOut(socket->fd(), true, &duetime) < 0 && + errno != ETIMEDOUT) { + return -1; + } + } + return 0; +} + +int SocketHandshakeIO::WriteAll(const void* data, size_t len) { + CHECK(data != NULL); + CHECK(_socket != NULL); + const int fd = _socket->fd(); + return WriteAllLoop(_socket, len, + [data, fd](size_t offset, size_t remaining) { + return write(fd, static_cast(data) + offset, + remaining); + }); +} + +int SocketHandshakeIO::PushBack(const void* data, size_t len) { + CHECK(_socket != NULL); + if (len != 0) { + return _socket->_read_buf.append(data, len) == 0 ? 0 : -1; + } + return 0; +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/handshake/handshake_io.h b/src/brpc/handshake/handshake_io.h new file mode 100644 index 0000000000..82f83ab5cd --- /dev/null +++ b/src/brpc/handshake/handshake_io.h @@ -0,0 +1,89 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_HANDSHAKE_HANDSHAKE_IO_H +#define BRPC_HANDSHAKE_HANDSHAKE_IO_H + +#include + +#include "butil/atomicops.h" +#include "butil/iobuf.h" +#include "butil/macros.h" + +namespace brpc { + +class Socket; + +namespace handshake { + +// Blocking byte-stream interface used by client handshakes and by protocols +// whose server handshake still runs in a dedicated bthread. +class HandshakeIO { +public: + virtual ~HandshakeIO() = default; + + virtual int ReadExact(void* data, size_t len) = 0; + virtual int WriteAll(const void* data, size_t len) = 0; + virtual int PushBack(const void* data, size_t len) = 0; +}; + +// Non-blocking input used by the standard InputMessenger parser path. +// Consume is called only after a complete frame has been validated. +class HandshakeInput { +public: + virtual ~HandshakeInput() = default; + + virtual size_t Size() const = 0; + virtual bool CopyTo(void* data, size_t len) const = 0; + virtual bool Consume(size_t len) = 0; +}; + +class IOBufHandshakeInput : public HandshakeInput { +public: + explicit IOBufHandshakeInput(butil::IOBuf* source) : _source(source) {} + + size_t Size() const override; + bool CopyTo(void* data, size_t len) const override; + bool Consume(size_t len) override; + +private: + butil::IOBuf* _source; +}; + +class SocketHandshakeIO : public HandshakeIO { +public: + explicit SocketHandshakeIO(Socket* socket = NULL); + ~SocketHandshakeIO() override; + + void Reset(Socket* socket); + void NotifyReadable(); + + int ReadExact(void* data, size_t len) override; + int WriteAll(const void* data, size_t len) override; + int PushBack(const void* data, size_t len) override; + +private: + Socket* _socket; + butil::atomic* _read_butex; + + DISALLOW_COPY_AND_ASSIGN(SocketHandshakeIO); +}; + +} // namespace handshake +} // namespace brpc + +#endif // BRPC_HANDSHAKE_HANDSHAKE_IO_H diff --git a/src/brpc/handshake/rdma_handshake.cpp b/src/brpc/handshake/rdma_handshake.cpp new file mode 100644 index 0000000000..292bfde55d --- /dev/null +++ b/src/brpc/handshake/rdma_handshake.cpp @@ -0,0 +1,576 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/handshake/rdma_handshake.h" + +#include +#include +#include + +#include "butil/logging.h" +#include "butil/raw_pack.h" +#include "butil/sys_byteorder.h" +#include "brpc/adapter_transport.h" +#include "brpc/handshake/rdma_handshake_constants.h" +#include "brpc/rdma_handshake.pb.h" +#include "brpc/socket.h" + +#if BRPC_WITH_RDMA + +#include + +#include + +#include "brpc/rdma_transport.h" + +namespace brpc { +namespace rdma { + +DEFINE_int32(rdma_client_handshake_version, 2, + "RDMA handshake protocol version used by client. " + "2 = legacy 'RDMA' magic (default, compatible with all servers); " + "3 = new 'RDM3' protobuf-based handshake " + "(MUST only be enabled after target servers support v3)."); +DECLARE_bool(rdma_trace_verbose); + +extern const uint16_t MIN_QP_SIZE; +extern const uint16_t MIN_BLOCK_SIZE; +extern bool g_skip_rdma_init; + +DEFINE_bool(rdma_ece, false, + "Enable end-to-end ECE negotiation in the RDMA v3 handshake"); + +void RdmaHandshakeAdapter::FillLocalHello(ParsedHello* local) const { + _ep->GetLocalConnectionInfo(local); +} + +void RdmaHandshakeAdapter::PrepareClientEce() { + if (!FLAGS_rdma_ece) { + return; + } + ibv_ece ece; + const int rc = _ep->QueryLocalEce(&ece); + if (rc == 0) { + _ep->SetOutgoingEce(ece); + } else if (rc < 0) { + LOG_IF(WARNING, FLAGS_rdma_trace_verbose) + << "Fail to IbvQueryEce on client, ECE not advertised"; + } +} + +handshake::HandshakeCodec RdmaHandshakeAdapter::MakeCodec( + ParsedHello* remote) { + handshake::HandshakeCodec codec{}; + codec.protocol_version = ProtocolVersion(); + codec.hello_frame = HelloFrameSpec(); + codec.ack_frame = RdmaAckFrameSpec(); + codec.build_hello = [this](bool enabled, std::string* payload) { + return BuildLocalHello(enabled, payload); + }; + codec.parse_hello = [this, remote](const std::string& payload) { + return ParseRemoteHello(payload, remote); + }; + codec.build_ack = [](bool enabled, std::string* payload) { + const uint32_t flags_be = butil::HostToNet32( + enabled ? HELLO_ACK_RDMA_OK : 0); + payload->assign(reinterpret_cast(&flags_be), + sizeof(flags_be)); + return handshake::STEP_OK; + }; + codec.parse_ack = [](const std::string& payload, bool* enabled) { + if (payload.size() != HELLO_ACK_LEN) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + uint32_t flags_be = 0; + memcpy(&flags_be, payload.data(), sizeof(flags_be)); + *enabled = (butil::NetToHost32(flags_be) & HELLO_ACK_RDMA_OK) != 0; + return handshake::STEP_OK; + }; + return codec; +} + +namespace v2_wire { + +void HelloMessage::Serialize(void* data) const { + butil::RawPacker(data) + .pack16(msg_len) + .pack16(hello_ver) + .pack16(impl_ver) + .pack32(block_size) + .pack16(sq_size) + .pack16(rq_size) + .pack16(lid) + .pack_bytes(gid.raw, sizeof(gid.raw)) + .pack32(qp_num); +} + +void HelloMessage::Deserialize(const void* data) { + butil::RawUnpacker(data) + .unpack16(msg_len) + .unpack16(hello_ver) + .unpack16(impl_ver) + .unpack32(block_size) + .unpack16(sq_size) + .unpack16(rq_size) + .unpack16(lid) + .unpack_bytes(gid.raw, sizeof(gid.raw)) + .unpack32(qp_num); +} + +static bool ValidHelloMessage(const HelloMessage& msg) { + return msg.hello_ver == HELLO_V2_VERSION && + msg.impl_ver == IMPL_V2_VERSION && + msg.block_size >= MIN_BLOCK_SIZE && + msg.sq_size >= MIN_QP_SIZE && + msg.rq_size >= MIN_QP_SIZE; +} + +static void TranslateHello(const HelloMessage& msg, ParsedHello* out) { + out->block_size = msg.block_size; + out->sq_size = msg.sq_size; + out->rq_size = msg.rq_size; + out->lid = msg.lid; + out->gid = msg.gid; + out->qp_num = msg.qp_num; +} + +static void FillMessage(const ParsedHello& local, HelloMessage* msg) { + msg->msg_len = HELLO_V2_MSG_LEN_MIN; + msg->hello_ver = HELLO_V2_VERSION; + msg->impl_ver = IMPL_V2_VERSION; + msg->block_size = local.block_size; + msg->sq_size = local.sq_size; + msg->rq_size = local.rq_size; + msg->lid = local.lid; + msg->gid = local.gid; + msg->qp_num = local.qp_num; +} + +static handshake::StepResult SerializePayload( + const HelloMessage& msg, std::string* payload) { + uint8_t body[HELLO_V2_MSG_LEN_MIN - HELLO_MAGIC_LEN]; + msg.Serialize(body); + // FrameCodec owns msg_len, so the protocol payload starts after it. + payload->assign(reinterpret_cast(body + sizeof(uint16_t)), + sizeof(body) - sizeof(uint16_t)); + return handshake::STEP_OK; +} + +static handshake::StepResult ParsePayload( + const std::string& payload, ParsedHello* remote) { + const size_t base_payload_len = + HELLO_V2_MSG_LEN_MIN - HELLO_MAGIC_LEN - sizeof(uint16_t); + if (payload.size() < base_payload_len) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + uint8_t body[HELLO_V2_MSG_LEN_MIN - HELLO_MAGIC_LEN]; + const uint16_t total_be = butil::HostToNet16( + static_cast(HELLO_MAGIC_LEN + sizeof(uint16_t) + + payload.size())); + memcpy(body, &total_be, sizeof(total_be)); + memcpy(body + sizeof(total_be), payload.data(), base_payload_len); + + HelloMessage msg{}; + msg.Deserialize(body); + if (!ValidHelloMessage(msg)) { + return handshake::STEP_FALLBACK; + } + TranslateHello(msg, remote); + return handshake::STEP_OK; +} + +} // namespace v2_wire + +const handshake::FrameSpec& +RdmaClientHandshakeAdapterV2::HelloFrameSpec() const { + return RdmaHelloFrameSpec(2); +} + +handshake::StepResult RdmaClientHandshakeAdapterV2::BuildLocalHello( + bool enabled, std::string* payload) { + CHECK(enabled); + ParsedHello local{}; + FillLocalHello(&local); + v2_wire::HelloMessage msg{}; + v2_wire::FillMessage(local, &msg); + return v2_wire::SerializePayload(msg, payload); +} + +handshake::StepResult RdmaClientHandshakeAdapterV2::ParseRemoteHello( + const std::string& payload, ParsedHello* remote) { + return v2_wire::ParsePayload(payload, remote); +} + +const handshake::FrameSpec& +RdmaServerHandshakeAdapterV2::HelloFrameSpec() const { + return RdmaHelloFrameSpec(2); +} + +handshake::StepResult RdmaServerHandshakeAdapterV2::BuildLocalHello( + bool enabled, std::string* payload) { + v2_wire::HelloMessage msg{}; + msg.msg_len = HELLO_V2_MSG_LEN_MIN; + if (enabled) { + ParsedHello local{}; + FillLocalHello(&local); + v2_wire::FillMessage(local, &msg); + } + return v2_wire::SerializePayload(msg, payload); +} + +handshake::StepResult RdmaServerHandshakeAdapterV2::ParseRemoteHello( + const std::string& payload, ParsedHello* remote) { + return v2_wire::ParsePayload(payload, remote); +} + +namespace v3_wire { + +static bool ValidRdmaHello(const RdmaHello& msg) { + if (msg.gid().size() != sizeof(ibv_gid)) { + return false; + } + const uint16_t max_uint16 = std::numeric_limits::max(); + if (msg.sq_size() > max_uint16 || msg.rq_size() > max_uint16 || + msg.lid() > max_uint16) { + return false; + } + if (msg.block_size() < MIN_BLOCK_SIZE || msg.sq_size() < MIN_QP_SIZE || + msg.rq_size() < MIN_QP_SIZE) { + return false; + } + return msg.qp_num() != 0 || g_skip_rdma_init; +} + +static void FillLocalRdmaHello(const ParsedHello& local, RdmaHello* msg) { + msg->set_block_size(local.block_size); + msg->set_sq_size(local.sq_size); + msg->set_rq_size(local.rq_size); + msg->set_lid(local.lid); + msg->set_gid(reinterpret_cast(local.gid.raw), + sizeof(local.gid.raw)); + msg->set_qp_num(local.qp_num); + if (FLAGS_rdma_ece && local.ece.has_value()) { + RdmaEce* ece = msg->mutable_ece(); + ece->set_vendor_id(local.ece->vendor_id); + ece->set_options(local.ece->options); + ece->set_comp_mask(local.ece->comp_mask); + } +} + +static void TranslateHello(const RdmaHello& msg, ParsedHello* out) { + out->block_size = msg.block_size(); + out->sq_size = static_cast(msg.sq_size()); + out->rq_size = static_cast(msg.rq_size()); + out->lid = static_cast(msg.lid()); + fast_memcpy(out->gid.raw, msg.gid().data(), sizeof(out->gid.raw)); + out->qp_num = msg.qp_num(); + if (FLAGS_rdma_ece && msg.has_ece()) { + ibv_ece ece; + ece.vendor_id = msg.ece().vendor_id(); + ece.options = msg.ece().options(); + ece.comp_mask = msg.ece().comp_mask(); + out->ece = ece; + } +} + +static handshake::StepResult SerializePayload( + const RdmaHello& msg, std::string* payload) { + if (!msg.SerializeToString(payload) || + payload->size() > HELLO_V3_MAX_PB_SIZE) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + return handshake::STEP_OK; +} + +static handshake::StepResult ParsePayload( + const std::string& payload, ParsedHello* remote) { + RdmaHello msg; + if (!msg.ParseFromArray(payload.data(), static_cast(payload.size()))) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + if (!ValidRdmaHello(msg)) { + return handshake::STEP_FALLBACK; + } + TranslateHello(msg, remote); + return handshake::STEP_OK; +} + +static void FillDisabledHello(RdmaHello* msg) { + msg->set_block_size(0); + msg->set_sq_size(0); + msg->set_rq_size(0); + msg->set_lid(0); + msg->set_gid(std::string(sizeof(ibv_gid), '\0')); + msg->set_qp_num(0); +} + +} // namespace v3_wire + +const handshake::FrameSpec& +RdmaClientHandshakeAdapterV3::HelloFrameSpec() const { + return RdmaHelloFrameSpec(3); +} + +handshake::StepResult RdmaClientHandshakeAdapterV3::BuildLocalHello( + bool enabled, std::string* payload) { + CHECK(enabled); + PrepareClientEce(); + ParsedHello local{}; + FillLocalHello(&local); + RdmaHello msg; + v3_wire::FillLocalRdmaHello(local, &msg); + return v3_wire::SerializePayload(msg, payload); +} + +handshake::StepResult RdmaClientHandshakeAdapterV3::ParseRemoteHello( + const std::string& payload, ParsedHello* remote) { + return v3_wire::ParsePayload(payload, remote); +} + +const handshake::FrameSpec& +RdmaServerHandshakeAdapterV3::HelloFrameSpec() const { + return RdmaHelloFrameSpec(3); +} + +handshake::StepResult RdmaServerHandshakeAdapterV3::BuildLocalHello( + bool enabled, std::string* payload) { + RdmaHello msg; + if (enabled) { + ParsedHello local{}; + FillLocalHello(&local); + v3_wire::FillLocalRdmaHello(local, &msg); + } else { + v3_wire::FillDisabledHello(&msg); + } + return v3_wire::SerializePayload(msg, payload); +} + +handshake::StepResult RdmaServerHandshakeAdapterV3::ParseRemoteHello( + const std::string& payload, ParsedHello* remote) { + return v3_wire::ParsePayload(payload, remote); +} + +std::unique_ptr CreateClientHandshakeAdapter( + RdmaEndpoint* ep) { + if (FLAGS_rdma_client_handshake_version == 3) { + return std::unique_ptr( + new RdmaClientHandshakeAdapterV3(ep)); + } + return std::unique_ptr( + new RdmaClientHandshakeAdapterV2(ep)); +} + +std::vector > +CreateServerHandshakeAdapters(RdmaEndpoint* ep) { + std::vector > adapters; + adapters.emplace_back(new RdmaServerHandshakeAdapterV2(ep)); + adapters.emplace_back(new RdmaServerHandshakeAdapterV3(ep)); + return adapters; +} + +} // namespace rdma +} // namespace brpc + +#endif // BRPC_WITH_RDMA + +namespace brpc { +namespace handshake { + +class RdmaServerHandshakeAdapter : public StandardHandshakeAdapter { +public: + RdmaServerHandshakeAdapter() = default; + +protected: + StepResult RunServerStep( + butil::IOBuf* source, Socket* socket) override; + HandshakeSession* GetSession(Socket* socket) const override; + +private: + StepResult RunFallbackServerHandshake( + butil::IOBuf* source, Socket* socket); +#if BRPC_WITH_RDMA + StepResult RunRdmaServerHandshake( + butil::IOBuf* source, Socket* socket); +#endif + + DISALLOW_COPY_AND_ASSIGN(RdmaServerHandshakeAdapter); +}; + +static const int FALLBACK_PREPARE = 1; +static const int FALLBACK_HELLO_SEND = 2; +static const int FALLBACK_HELLO_WAIT = 3; +static const int FALLBACK_NEGOTIATE = 4; +static const int FALLBACK_ACK_SEND = 5; +static const int FALLBACK_ACK_WAIT = 6; +static constexpr uint16_t V2_HELLO_VERSION_INVALID = + std::numeric_limits::max(); +static constexpr size_t V3_GID_LEN = 16; + +static HandshakeCodec MakeRdmaFallbackCodec(int version) { + HandshakeCodec codec{}; + codec.protocol_version = version; + codec.hello_frame = rdma::RdmaHelloFrameSpec(version); + codec.ack_frame = rdma::RdmaAckFrameSpec(); + codec.parse_hello = [](const std::string&) { + return STEP_FALLBACK; + }; + codec.build_hello = [version](bool enabled, std::string* payload) { + if (enabled) { + errno = EPROTO; + return STEP_ERROR; + } + if (version == 2) { + payload->assign( + rdma::HELLO_V2_MSG_LEN_MIN - rdma::HELLO_MAGIC_LEN - + sizeof(uint16_t), + '\0'); + butil::RawPacker(&(*payload)[0]) + .pack16(V2_HELLO_VERSION_INVALID); + return STEP_OK; + } + + rdma::RdmaHello reply; + reply.set_block_size(0); + reply.set_sq_size(0); + reply.set_rq_size(0); + reply.set_lid(0); + reply.set_gid(std::string(V3_GID_LEN, '\0')); + reply.set_qp_num(0); + if (!reply.SerializeToString(payload)) { + errno = EPROTO; + return STEP_ERROR; + } + return STEP_OK; + }; + codec.build_ack = [](bool enabled, std::string* payload) { + const uint32_t flags_be = butil::HostToNet32( + enabled ? rdma::HELLO_ACK_RDMA_OK : 0); + payload->assign(reinterpret_cast(&flags_be), + sizeof(flags_be)); + return STEP_OK; + }; + codec.parse_ack = [](const std::string& payload, bool* enabled) { + if (payload.size() != rdma::HELLO_ACK_LEN) { + errno = EPROTO; + return STEP_ERROR; + } + *enabled = false; + return STEP_OK; + }; + return codec; +} + +HandshakeAdapter* GetRdmaServerHandshakeAdapter() { + static RdmaServerHandshakeAdapter adapter; + return &adapter; +} + +HandshakeSession* RdmaServerHandshakeAdapter::GetSession( + Socket* socket) const { + return AdapterTransport::Get(socket)->handshake_session(); +} + +StepResult RdmaServerHandshakeAdapter::RunFallbackServerHandshake( + butil::IOBuf* source, Socket* socket) { + IOBufHandshakeInput input(source); + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.codecs.push_back(MakeRdmaFallbackCodec(2)); + callbacks.codecs.push_back(MakeRdmaFallbackCodec(3)); + callbacks.input = &input; + callbacks.transport.prepare_resources = []() { return STEP_OK; }; + callbacks.transport.negotiate_resources = []() { return STEP_OK; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = []() {}; + callbacks.transport.on_failed = []() {}; + return GetSession(socket)->RunServer(callbacks); +} + +#if BRPC_WITH_RDMA +StepResult RdmaServerHandshakeAdapter::RunRdmaServerHandshake( + butil::IOBuf* source, Socket* socket) { + RdmaTransport* transport = RdmaTransport::Get(socket); + CHECK(transport->GetRdmaEp() != NULL); + + rdma::ParsedHello remote{}; + std::vector > protocols = + transport->CreateServerHandshakeAdapters(); + IOBufHandshakeInput input(source); + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.input = &input; + for (size_t i = 0; i < protocols.size(); ++i) { + HandshakeCodec codec = protocols[i]->MakeCodec(&remote); + const std::function parse_hello = + codec.parse_hello; + codec.parse_hello = [transport, parse_hello]( + const std::string& payload) { + const StepResult result = parse_hello(payload); + if (result == STEP_FALLBACK) { + transport->DeactivateUpgrade(); + } + return result; + }; + callbacks.codecs.push_back(codec); + } + callbacks.transport.prepare_resources = [&]() { + if (transport->NegotiateUpgradeResources(remote, true) < 0) { + PLOG(WARNING) + << "Fail to allocate rdma resources, fallback to tcp:" + << socket->description(); + transport->DeactivateUpgrade(); + return STEP_FALLBACK; + } + return STEP_OK; + }; + callbacks.transport.negotiate_resources = [&]() { + return STEP_OK; + }; + callbacks.validate_established = [&]() { + if (!source->empty() || + !transport->UpgradeActive()) { + return STEP_ERROR; + } + return STEP_OK; + }; + callbacks.transport.set_high_speed_active = [transport]() { + transport->ActivateUpgrade(); + }; + callbacks.transport.set_tcp_active = [transport]() { + transport->DeactivateUpgrade(); + }; + callbacks.transport.on_failed = []() {}; + return GetSession(socket)->RunServer(callbacks); +} +#endif + +StepResult RdmaServerHandshakeAdapter::RunServerStep( + butil::IOBuf* source, Socket* socket) { +#if BRPC_WITH_RDMA + if (AdapterTransport::Get(socket)->upgrade_capable()) { + return RunRdmaServerHandshake(source, socket); + } +#endif + return RunFallbackServerHandshake(source, socket); +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/handshake/rdma_handshake.h b/src/brpc/handshake/rdma_handshake.h new file mode 100644 index 0000000000..7552454c34 --- /dev/null +++ b/src/brpc/handshake/rdma_handshake.h @@ -0,0 +1,154 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_HANDSHAKE_RDMA_HANDSHAKE_H +#define BRPC_HANDSHAKE_RDMA_HANDSHAKE_H + +#include "brpc/handshake/handshake_adapter.h" + +namespace brpc { +namespace handshake { + +// Returns the RDMA adapter used by policy::ParseTransportHandshake. The +// concrete type is private to the implementation; callers only learn the +// common HandshakeAdapter interface. +HandshakeAdapter* GetRdmaServerHandshakeAdapter(); + +} // namespace handshake +} // namespace brpc + +#if BRPC_WITH_RDMA + +#include +#include +#include + +#include + +#include "butil/containers/optional.h" +#include "butil/macros.h" +#include "brpc/rdma/rdma_endpoint.h" +#include "brpc/handshake/rdma_handshake_constants.h" +#include "brpc/transport_handshake.h" + +namespace brpc { +namespace rdma { + +using ParsedHello = RdmaConnectionInfo; + +namespace v2_wire { + +struct HelloMessage { + void Serialize(void* data) const; + void Deserialize(const void* data); + + uint16_t msg_len; + uint16_t hello_ver; + uint16_t impl_ver; + uint32_t block_size; + uint16_t sq_size; + uint16_t rq_size; + uint16_t lid; + ibv_gid gid; + uint32_t qp_num; +}; + +} // namespace v2_wire + +// RDMA adapters implement only protocol fields. HandshakeSession owns frame +// I/O, length validation, ACK exchange and resource callback ordering. +class RdmaHandshakeAdapter { +public: + RdmaHandshakeAdapter(RdmaEndpoint* ep, int version) + : _ep(ep), _version(version) {} + virtual ~RdmaHandshakeAdapter() = default; + + int ProtocolVersion() const { return _version; } + handshake::HandshakeCodec MakeCodec(ParsedHello* remote); + + virtual const handshake::FrameSpec& HelloFrameSpec() const = 0; + virtual handshake::StepResult BuildLocalHello( + bool enabled, std::string* payload) = 0; + virtual handshake::StepResult ParseRemoteHello( + const std::string& payload, ParsedHello* remote) = 0; + +protected: + void FillLocalHello(ParsedHello* local) const; + void PrepareClientEce(); + + RdmaEndpoint* _ep; + int _version; + +private: + DISALLOW_COPY_AND_ASSIGN(RdmaHandshakeAdapter); +}; + +class RdmaClientHandshakeAdapterV2 : public RdmaHandshakeAdapter { +public: + explicit RdmaClientHandshakeAdapterV2(RdmaEndpoint* ep) + : RdmaHandshakeAdapter(ep, 2) {} + const handshake::FrameSpec& HelloFrameSpec() const override; + handshake::StepResult BuildLocalHello( + bool enabled, std::string* payload) override; + handshake::StepResult ParseRemoteHello( + const std::string& payload, ParsedHello* remote) override; +}; + +class RdmaServerHandshakeAdapterV2 : public RdmaHandshakeAdapter { +public: + explicit RdmaServerHandshakeAdapterV2(RdmaEndpoint* ep) + : RdmaHandshakeAdapter(ep, 2) {} + const handshake::FrameSpec& HelloFrameSpec() const override; + handshake::StepResult BuildLocalHello( + bool enabled, std::string* payload) override; + handshake::StepResult ParseRemoteHello( + const std::string& payload, ParsedHello* remote) override; +}; + +class RdmaClientHandshakeAdapterV3 : public RdmaHandshakeAdapter { +public: + explicit RdmaClientHandshakeAdapterV3(RdmaEndpoint* ep) + : RdmaHandshakeAdapter(ep, 3) {} + const handshake::FrameSpec& HelloFrameSpec() const override; + handshake::StepResult BuildLocalHello( + bool enabled, std::string* payload) override; + handshake::StepResult ParseRemoteHello( + const std::string& payload, ParsedHello* remote) override; +}; + +class RdmaServerHandshakeAdapterV3 : public RdmaHandshakeAdapter { +public: + explicit RdmaServerHandshakeAdapterV3(RdmaEndpoint* ep) + : RdmaHandshakeAdapter(ep, 3) {} + const handshake::FrameSpec& HelloFrameSpec() const override; + handshake::StepResult BuildLocalHello( + bool enabled, std::string* payload) override; + handshake::StepResult ParseRemoteHello( + const std::string& payload, ParsedHello* remote) override; +}; + +std::unique_ptr CreateClientHandshakeAdapter( + RdmaEndpoint* ep); + +std::vector > +CreateServerHandshakeAdapters(RdmaEndpoint* ep); + +} // namespace rdma +} // namespace brpc + +#endif // BRPC_WITH_RDMA +#endif // BRPC_HANDSHAKE_RDMA_HANDSHAKE_H diff --git a/src/brpc/rdma/rdma_handshake_constants.h b/src/brpc/handshake/rdma_handshake_constants.h similarity index 69% rename from src/brpc/rdma/rdma_handshake_constants.h rename to src/brpc/handshake/rdma_handshake_constants.h index aa9811b98e..af60d2e9d3 100644 --- a/src/brpc/rdma/rdma_handshake_constants.h +++ b/src/brpc/handshake/rdma_handshake_constants.h @@ -15,8 +15,13 @@ // specific language governing permissions and limitations // under the License. -#ifndef BRPC_RDMA_RDMA_HANDSHAKE_CONSTANTS_H -#define BRPC_RDMA_RDMA_HANDSHAKE_CONSTANTS_H +#ifndef BRPC_HANDSHAKE_RDMA_HANDSHAKE_CONSTANTS_H +#define BRPC_HANDSHAKE_RDMA_HANDSHAKE_CONSTANTS_H + +#include +#include + +#include "brpc/handshake/handshake_frame.h" namespace brpc { namespace rdma { @@ -50,7 +55,27 @@ constexpr size_t HELLO_V3_MAX_PB_SIZE = 8192; constexpr size_t HELLO_ACK_LEN = 4; constexpr uint32_t HELLO_ACK_RDMA_OK = 0x1; +inline const handshake::FrameSpec& RdmaHelloFrameSpec(int version) { + static const handshake::FrameSpec v2( + HELLO_MAGIC, HELLO_MAGIC_LEN, + HELLO_V2_MSG_LEN_MIN, HELLO_V2_MSG_LEN_MAX, + handshake::FrameSpec::U16_TOTAL_LENGTH); + static const handshake::FrameSpec v3( + HELLO_MAGIC_V3, HELLO_MAGIC_LEN, + HELLO_MAGIC_LEN + HELLO_V3_PB_SIZE_LEN + 1, + HELLO_MAGIC_LEN + HELLO_V3_PB_SIZE_LEN + HELLO_V3_MAX_PB_SIZE, + handshake::FrameSpec::U32_BODY_LENGTH); + return version == 2 ? v2 : v3; +} + +inline const handshake::FrameSpec& RdmaAckFrameSpec() { + static const handshake::FrameSpec spec( + NULL, 0, HELLO_ACK_LEN, HELLO_ACK_LEN, + handshake::FrameSpec::FIXED); + return spec; +} + } // namespace rdma } // namespace brpc -#endif // BRPC_RDMA_RDMA_HANDSHAKE_CONSTANTS_H +#endif // BRPC_HANDSHAKE_RDMA_HANDSHAKE_CONSTANTS_H diff --git a/src/brpc/handshake/ubshm_handshake.cpp b/src/brpc/handshake/ubshm_handshake.cpp new file mode 100644 index 0000000000..6e514edd8d --- /dev/null +++ b/src/brpc/handshake/ubshm_handshake.cpp @@ -0,0 +1,411 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/handshake/ubshm_handshake.h" + +#include +#include + +#include "butil/raw_pack.h" +#include "butil/sys_byteorder.h" +#include "brpc/adapter_transport.h" +#include "brpc/socket.h" + +#if BRPC_WITH_UBRING + +#include +#include + +#include "butil/logging.h" +#include "brpc/reloadable_flags.h" +#include "brpc/ubshm/common/common.h" +#include "brpc/ubshm/ub_endpoint.h" +#include "brpc/ubshm/ub_helper.h" +#include "brpc/ubshm/ubr_trx.h" +#include "brpc/ubshm_transport.h" + +#endif + +namespace brpc { +namespace handshake { +namespace ubshm_wire { + +static const char* const MAGIC = "UB"; +static const size_t MAGIC_LEN = 2; +static const size_t HELLO_LEN = 64; +static const size_t ACK_LEN = 4; +static const uint16_t HELLO_VERSION = 2; +static const uint16_t IMPL_VERSION = 1; +static const uint32_t ACK_OK = 0x1; + +static const FrameSpec& HelloFrameSpec() { + static const FrameSpec spec( + MAGIC, MAGIC_LEN, HELLO_LEN, HELLO_LEN, FrameSpec::FIXED); + return spec; +} + +static const FrameSpec& AckFrameSpec() { + static const FrameSpec spec( + NULL, 0, ACK_LEN, ACK_LEN, FrameSpec::FIXED); + return spec; +} + +} // namespace ubshm_wire +} // namespace handshake +} // namespace brpc + +#if BRPC_WITH_UBRING + +namespace brpc { +namespace ubring { + +DEFINE_int32(data_queue_size, 4, "data queue size for UB"); +DEFINE_bool(ub_trace_verbose, false, "Print log message verbosely"); +BRPC_VALIDATE_GFLAG(ub_trace_verbose, brpc::PassValidate); + +void HelloMessage::Serialize(void* data) const { + char* current_pos = static_cast(data); + const uint16_t net_msg_len = butil::HostToNet16(msg_len); + memcpy(current_pos, &net_msg_len, sizeof(net_msg_len)); + current_pos += sizeof(net_msg_len); + const uint16_t net_hello_ver = butil::HostToNet16(hello_ver); + memcpy(current_pos, &net_hello_ver, sizeof(net_hello_ver)); + current_pos += sizeof(net_hello_ver); + const uint16_t net_impl_ver = butil::HostToNet16(impl_ver); + memcpy(current_pos, &net_impl_ver, sizeof(net_impl_ver)); + current_pos += sizeof(net_impl_ver); + const uint64_t net_len = butil::HostToNet64(len); + memcpy(current_pos, &net_len, sizeof(net_len)); + current_pos += sizeof(net_len); + memcpy(current_pos, shm_name, SHM_MAX_NAME_BUFF_LEN); +} + +void HelloMessage::Deserialize(const void* data) { + const char* current_pos = static_cast(data); + uint16_t net_msg_len; + memcpy(&net_msg_len, current_pos, sizeof(net_msg_len)); + msg_len = butil::NetToHost16(net_msg_len); + current_pos += sizeof(net_msg_len); + uint16_t net_hello_ver; + memcpy(&net_hello_ver, current_pos, sizeof(net_hello_ver)); + hello_ver = butil::NetToHost16(net_hello_ver); + current_pos += sizeof(net_hello_ver); + uint16_t net_impl_ver; + memcpy(&net_impl_ver, current_pos, sizeof(net_impl_ver)); + impl_ver = butil::NetToHost16(net_impl_ver); + current_pos += sizeof(net_impl_ver); + uint64_t net_len; + memcpy(&net_len, current_pos, sizeof(net_len)); + len = butil::NetToHost64(net_len); + current_pos += sizeof(net_len); + memcpy(shm_name, current_pos, SHM_MAX_NAME_BUFF_LEN); +} + +std::string HelloMessage::toString() const { + constexpr size_t MAX_LEN = + 16 + 6 + 16 + 6 + 16 + 6 + 20 + 6 + SHM_MAX_NAME_BUFF_LEN + 32; + std::array buf; + const int n = snprintf( + buf.data(), buf.size(), + "msg_len=%u, hello_ver=%u, impl_ver=%u, len=%lu, shm_name=%.*s", + msg_len, hello_ver, impl_ver, + static_cast(len), + static_cast(SHM_MAX_NAME_BUFF_LEN), shm_name); + return std::string(buf.data(), static_cast(n)); +} + +handshake::HandshakeCodec UBShmHandshakeAdapter::MakeCodec() const { + handshake::HandshakeCodec codec{}; + codec.protocol_version = 2; + codec.hello_frame = handshake::ubshm_wire::HelloFrameSpec(); + codec.ack_frame = handshake::ubshm_wire::AckFrameSpec(); + codec.build_ack = [](bool enabled, std::string* payload) { + const uint32_t flags_be = butil::HostToNet32( + enabled ? handshake::ubshm_wire::ACK_OK : 0); + payload->assign(reinterpret_cast(&flags_be), + sizeof(flags_be)); + return handshake::STEP_OK; + }; + codec.parse_ack = [](const std::string& payload, bool* enabled) { + if (payload.size() != handshake::ubshm_wire::ACK_LEN) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + uint32_t flags_be = 0; + memcpy(&flags_be, payload.data(), sizeof(flags_be)); + *enabled = (butil::NetToHost32(flags_be) & + handshake::ubshm_wire::ACK_OK) != 0; + return handshake::STEP_OK; + }; + return codec; +} + +handshake::StepResult UBShmHandshakeAdapter::BuildHello( + bool enabled, uint64_t len, const char* shm_name, + std::string* payload) const { + HelloMessage message{}; + message.msg_len = static_cast( + handshake::ubshm_wire::HELLO_LEN); + if (enabled) { + message.hello_ver = handshake::ubshm_wire::HELLO_VERSION; + message.impl_ver = handshake::ubshm_wire::IMPL_VERSION; + message.len = len; + memcpy(message.shm_name, shm_name, SHM_MAX_NAME_BUFF_LEN); + } + payload->assign( + handshake::ubshm_wire::HELLO_LEN - + handshake::ubshm_wire::MAGIC_LEN, + '\0'); + message.Serialize(&(*payload)[0]); + return handshake::STEP_OK; +} + +handshake::StepResult UBShmHandshakeAdapter::ParseHello( + const std::string& payload, HelloMessage* message) const { + if (payload.size() != handshake::ubshm_wire::HELLO_LEN - + handshake::ubshm_wire::MAGIC_LEN) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + message->Deserialize(payload.data()); + if (message->msg_len < handshake::ubshm_wire::HELLO_LEN) { + errno = EPROTO; + return handshake::STEP_ERROR; + } + return NegotiationValid(*message) ? + handshake::STEP_OK : handshake::STEP_FALLBACK; +} + +bool UBShmHandshakeAdapter::NegotiationValid( + const HelloMessage& message) const { + return message.hello_ver == handshake::ubshm_wire::HELLO_VERSION && + message.impl_ver == handshake::ubshm_wire::IMPL_VERSION; +} + +} // namespace ubring +} // namespace brpc + +#endif // BRPC_WITH_UBRING + +namespace brpc { +namespace handshake { + +class UBShmServerHandshakeAdapter : public StandardHandshakeAdapter { +public: + UBShmServerHandshakeAdapter() = default; + +protected: + StepResult RunServerStep( + butil::IOBuf* source, Socket* socket) override; + HandshakeSession* GetSession(Socket* socket) const override; + +private: + StepResult RunFallbackServerHandshake( + butil::IOBuf* source, Socket* socket); +#if BRPC_WITH_UBRING + StepResult RunUBShmServerHandshake( + butil::IOBuf* source, Socket* socket); +#endif + + DISALLOW_COPY_AND_ASSIGN(UBShmServerHandshakeAdapter); +}; + +static const int FALLBACK_PREPARE = 1; +static const int FALLBACK_HELLO_SEND = 2; +static const int FALLBACK_HELLO_WAIT = 3; +static const int FALLBACK_NEGOTIATE = 4; +static const int FALLBACK_ACK_SEND = 5; +static const int FALLBACK_ACK_WAIT = 6; + +static HandshakeCodec MakeUBShmFallbackCodec() { + HandshakeCodec codec{}; + codec.protocol_version = 2; + codec.hello_frame = ubshm_wire::HelloFrameSpec(); + codec.ack_frame = ubshm_wire::AckFrameSpec(); + codec.parse_hello = [](const std::string&) { + return STEP_FALLBACK; + }; + codec.build_hello = [](bool enabled, std::string* payload) { + if (enabled) { + errno = EPROTO; + return STEP_ERROR; + } + payload->assign( + ubshm_wire::HELLO_LEN - ubshm_wire::MAGIC_LEN, '\0'); + butil::RawPacker(&(*payload)[0]) + .pack16(static_cast(ubshm_wire::HELLO_LEN)); + return STEP_OK; + }; + codec.build_ack = [](bool enabled, std::string* payload) { + const uint32_t flags_be = butil::HostToNet32( + enabled ? ubshm_wire::ACK_OK : 0); + payload->assign(reinterpret_cast(&flags_be), + sizeof(flags_be)); + return STEP_OK; + }; + codec.parse_ack = [](const std::string& payload, bool* enabled) { + if (payload.size() != ubshm_wire::ACK_LEN) { + errno = EPROTO; + return STEP_ERROR; + } + *enabled = false; + return STEP_OK; + }; + return codec; +} + +HandshakeAdapter* GetUBShmServerHandshakeAdapter() { + static UBShmServerHandshakeAdapter adapter; + return &adapter; +} + +HandshakeSession* UBShmServerHandshakeAdapter::GetSession( + Socket* socket) const { + return AdapterTransport::Get(socket)->handshake_session(); +} + +StepResult UBShmServerHandshakeAdapter::RunFallbackServerHandshake( + butil::IOBuf* source, Socket* socket) { + IOBufHandshakeInput input(source); + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.codecs.push_back(MakeUBShmFallbackCodec()); + callbacks.input = &input; + callbacks.transport.prepare_resources = []() { return STEP_OK; }; + callbacks.transport.negotiate_resources = []() { return STEP_OK; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = []() {}; + callbacks.transport.on_failed = []() {}; + return GetSession(socket)->RunServer(callbacks); +} + +#if BRPC_WITH_UBRING +StepResult UBShmServerHandshakeAdapter::RunUBShmServerHandshake( + butil::IOBuf* source, Socket* socket) { + UBShmTransport* transport = UBShmTransport::Get(socket); + CHECK(transport->GetUBShmEp() != NULL); + + ubring::HelloMessage remote{}; + ubring::UBShmHandshakeAdapter wire; + IOBufHandshakeInput input(source); + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.input = &input; + HandshakeCodec codec = wire.MakeCodec(); + codec.parse_hello = [&](const std::string& payload) { + const StepResult result = wire.ParseHello(payload, &remote); + if (result == STEP_OK || result == STEP_FALLBACK) { + LOG_IF(INFO, ubring::FLAGS_ub_trace_verbose) + << "server receive handshake message : " + << remote.toString(); + } + if (result == STEP_FALLBACK) { + transport->DeactivateUpgrade(); + } + return result; + }; + codec.build_hello = [&](bool enabled, std::string* payload) { + const uint64_t len = enabled + ? static_cast(ubring::FLAGS_data_queue_size) * + MB_TO_BYTE + : 0; + return wire.BuildHello( + enabled, len, enabled ? remote.shm_name : NULL, payload); + }; + callbacks.codecs.push_back(codec); + callbacks.transport.prepare_resources = [&]() { + if (!ubring::IsUBAvailable()) { + transport->DeactivateUpgrade(); + return STEP_FALLBACK; + } + ubring::SHM remote_trx_shm = { + NULL, remote.len, 0, {0}, + static_cast(socket->fd())}; + strncpy(remote_trx_shm.name, remote.shm_name, + SHM_MAX_NAME_BUFF_LEN); + + const size_t local_shm_len = + static_cast(ubring::FLAGS_data_queue_size) * MB_TO_BYTE; + ubring::SHM local_trx_shm = { + NULL, local_shm_len, 0, {0}, + static_cast(socket->fd())}; + char client_name[SHM_MAX_NAME_BUFF_LEN + 1]; + memcpy(client_name, remote.shm_name, SHM_MAX_NAME_BUFF_LEN); + client_name[SHM_MAX_NAME_BUFF_LEN] = '\0'; + char* client_ip_port = strrchr(client_name, '_'); + if (client_ip_port != NULL) { + *client_ip_port = '\0'; + } + const int result = snprintf( + local_trx_shm.name, SHM_MAX_NAME_BUFF_LEN, "%s_%s", + client_name, SERVER_SHM_NAME_SUFFIX); + if (UNLIKELY(result < 0)) { + transport->DeactivateUpgrade(); + return STEP_FALLBACK; + } + if (transport->PrepareServerUpgradeResources( + &remote_trx_shm, &local_trx_shm) < 0) { + LOG(WARNING) + << "Fail to allocate ub resources, fallback to tcp:" + << socket->description(); + transport->DeactivateUpgrade(); + return STEP_FALLBACK; + } + return STEP_OK; + }; + callbacks.transport.negotiate_resources = []() { return STEP_OK; }; + callbacks.validate_established = [&]() { + if (!source->empty() || + !transport->UpgradeActive()) { + return STEP_ERROR; + } + return STEP_OK; + }; + callbacks.transport.set_high_speed_active = [transport]() { + transport->ActivateUpgrade(); + }; + callbacks.transport.set_tcp_active = [transport]() { + transport->DeactivateUpgrade(); + }; + callbacks.transport.on_failed = []() {}; + const StepResult result = GetSession(socket)->RunServer(callbacks); + if (result == STEP_OK) { + transport->FinishUpgrade(); + LOG_IF(INFO, ubring::FLAGS_ub_trace_verbose) + << "Server handshake ends (use ubring) on " + << socket->description(); + } else if (result == STEP_FALLBACK) { + LOG_IF(INFO, ubring::FLAGS_ub_trace_verbose) + << "Server handshake ends (use tcp) on " + << socket->description(); + } + return result; +} +#endif + +StepResult UBShmServerHandshakeAdapter::RunServerStep( + butil::IOBuf* source, Socket* socket) { +#if BRPC_WITH_UBRING + if (AdapterTransport::Get(socket)->upgrade_capable()) { + return RunUBShmServerHandshake(source, socket); + } +#endif + return RunFallbackServerHandshake(source, socket); +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/handshake/ubshm_handshake.h b/src/brpc/handshake/ubshm_handshake.h new file mode 100644 index 0000000000..1bf1bb9d9b --- /dev/null +++ b/src/brpc/handshake/ubshm_handshake.h @@ -0,0 +1,84 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_HANDSHAKE_UBSHM_HANDSHAKE_H +#define BRPC_HANDSHAKE_UBSHM_HANDSHAKE_H + +#include "brpc/handshake/handshake_adapter.h" + +namespace brpc { +namespace handshake { + +// Returns the adapter used by the common transport-handshake policy parser. +// The concrete server executor is private to the implementation. +HandshakeAdapter* GetUBShmServerHandshakeAdapter(); + +} // namespace handshake +} // namespace brpc + +#if BRPC_WITH_UBRING + +#include +#include + +#include + +#include "butil/macros.h" +#include "brpc/transport_handshake.h" +#include "brpc/ubshm/shm/shm_def.h" + +namespace brpc { +namespace ubring { + +DECLARE_int32(data_queue_size); +DECLARE_bool(ub_trace_verbose); + +// UBSHM v2 wire payload. HandshakeSession owns framing and ACK exchange; +// this type and UBShmHandshakeAdapter only handle protocol fields. +struct HelloMessage { + void Serialize(void* data) const; + void Deserialize(const void* data); + std::string toString() const; + + uint16_t msg_len; + uint16_t hello_ver; + uint16_t impl_ver; + uint64_t len; + char shm_name[SHM_MAX_NAME_BUFF_LEN]; +}; + +class UBShmHandshakeAdapter { +public: + UBShmHandshakeAdapter() = default; + + handshake::HandshakeCodec MakeCodec() const; + handshake::StepResult BuildHello( + bool enabled, uint64_t len, const char* shm_name, + std::string* payload) const; + handshake::StepResult ParseHello( + const std::string& payload, HelloMessage* message) const; + +private: + bool NegotiationValid(const HelloMessage& message) const; + DISALLOW_COPY_AND_ASSIGN(UBShmHandshakeAdapter); +}; + +} // namespace ubring +} // namespace brpc + +#endif // BRPC_WITH_UBRING +#endif // BRPC_HANDSHAKE_UBSHM_HANDSHAKE_H diff --git a/src/brpc/input_messenger.h b/src/brpc/input_messenger.h index d056263e2e..424b15f734 100644 --- a/src/brpc/input_messenger.h +++ b/src/brpc/input_messenger.h @@ -34,6 +34,7 @@ class UBShmEndpoint; } class TcpTransport; class RdmaTransport; +class AdapterTransport; struct InputMessageHandler { // The callback to cut a message from `source'. // Returned message will be passed to process_request or process_response @@ -97,6 +98,7 @@ class InputMessenger : public SocketUser { friend class Socket; friend class TcpTransport; friend class RdmaTransport; +friend class AdapterTransport; friend class rdma::RdmaEndpoint; friend class ubring::UBShmEndpoint; public: diff --git a/src/brpc/policy/rdma_handshake_protocol.cpp b/src/brpc/policy/rdma_handshake_protocol.cpp index 580abdda5d..fb1e183f1e 100644 --- a/src/brpc/policy/rdma_handshake_protocol.cpp +++ b/src/brpc/policy/rdma_handshake_protocol.cpp @@ -17,24 +17,16 @@ #include "brpc/policy/rdma_handshake_protocol.h" -#include "butil/logging.h" -#include "brpc/destroyable.h" -#include "brpc/rdma/rdma_handshake_server.h" - namespace brpc { namespace policy { ParseResult ParseRdmaHandshake(butil::IOBuf* source, Socket* socket, - bool /*read_eof*/, const void* /*arg*/) { - return rdma::ExecuteServerHandshake(source, socket); + bool read_eof, const void* arg) { + return ParseTransportHandshake(source, socket, read_eof, arg); } void ProcessRdmaHandshake(InputMessageBase* msg) { - // ParseRdmaHandshake replies inline and only ever returns - // NOT_ENOUGH_DATA / TRY_OTHERS / hard errors, never a real message, so this - // must never run. Keep a placeholder (required for server registration). - DestroyingPtr destroying_msg(msg); - CHECK(false) << "ProcessRdmaHandshake should never be called"; + ProcessTransportHandshake(msg); } } // namespace policy diff --git a/src/brpc/policy/rdma_handshake_protocol.h b/src/brpc/policy/rdma_handshake_protocol.h index e569a4c333..51416e2eee 100644 --- a/src/brpc/policy/rdma_handshake_protocol.h +++ b/src/brpc/policy/rdma_handshake_protocol.h @@ -18,36 +18,15 @@ #ifndef BRPC_POLICY_RDMA_HANDSHAKE_PROTOCOL_H #define BRPC_POLICY_RDMA_HANDSHAKE_PROTOCOL_H -// NOTE: This file is intentionally INDEPENDENT of BRPC_WITH_RDMA. A server may -// run in TCP mode either because it was built without RDMA, or because RDMA was -// not enabled at runtime. In both cases an RDMA client that connects to it will -// send an RDMA handshake magic ("RDMA" for v2, "RDM3" for v3) first. Without -// special handling the server treats those bytes as an unknown protocol and -// closes the connection, so the client (blocked reading the server hello) only -// sees EOF and cannot fall back to TCP. -// -// To let the client fall back on the SAME connection, the server recognizes the -// RDMA handshake as a "first-class" protocol (magic in the first 4 bytes, -// PROTOCOL_RDMA_HANDSHAKE is ordered before PROTOCOL_HTTP), replies a hello with -// an incompatible version so the client rejects it and downgrades to TCP, then -// drains the client's subsequent ACK and lets normal RPC parsing continue. - -#include "butil/iobuf.h" -#include "brpc/input_message_base.h" -#include "brpc/parse_result.h" -#include "brpc/socket.h" +// Compatibility facade. New code should include +// transport_handshake_protocol.h and use ParseTransportHandshake. +#include "brpc/policy/transport_handshake_protocol.h" namespace brpc { namespace policy { -// Parse binary format of rdma handshake. ParseResult ParseRdmaHandshake(butil::IOBuf* source, Socket* socket, bool read_eof, const void* arg); - -// Actions to a rdma handshake request, which is left unimplemented. -// All requests are processed in the parsing process. This function -// must be declared since server only enables rdma handshake as a -// server-side protocol when this function is declared. void ProcessRdmaHandshake(InputMessageBase* msg); } // namespace policy diff --git a/src/brpc/policy/transport_handshake_protocol.cpp b/src/brpc/policy/transport_handshake_protocol.cpp new file mode 100644 index 0000000000..5d343e0da7 --- /dev/null +++ b/src/brpc/policy/transport_handshake_protocol.cpp @@ -0,0 +1,37 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/policy/transport_handshake_protocol.h" + +#include "butil/logging.h" +#include "brpc/adapter_transport.h" + +namespace brpc { +namespace policy { + +ParseResult ParseTransportHandshake(butil::IOBuf* source, Socket* socket, + bool /*read_eof*/, const void* /*arg*/) { + return AdapterTransport::Get(socket)->ProcessUpgradeReadable(source); +} + +void ProcessTransportHandshake(InputMessageBase* msg) { + DestroyingPtr destroying_msg(msg); + CHECK(false) << "ProcessTransportHandshake should never be called"; +} + +} // namespace policy +} // namespace brpc diff --git a/src/brpc/policy/transport_handshake_protocol.h b/src/brpc/policy/transport_handshake_protocol.h new file mode 100644 index 0000000000..f4a1fe9acc --- /dev/null +++ b/src/brpc/policy/transport_handshake_protocol.h @@ -0,0 +1,44 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_POLICY_TRANSPORT_HANDSHAKE_PROTOCOL_H +#define BRPC_POLICY_TRANSPORT_HANDSHAKE_PROTOCOL_H + +// This policy is intentionally independent of BRPC_WITH_RDMA and +// BRPC_WITH_UBRING. A plain TCP server must recognize an upgrade hello and +// return a disabled hello so the client can continue with TCP on the same +// connection. + +#include "butil/iobuf.h" +#include "brpc/input_message_base.h" +#include "brpc/parse_result.h" +#include "brpc/socket.h" + +namespace brpc { +namespace policy { + +ParseResult ParseTransportHandshake(butil::IOBuf* source, Socket* socket, + bool read_eof, const void* arg); + +// Upgrade handshakes are completed inline by the parser. This placeholder is +// required for server-side protocol registration and must never be invoked. +void ProcessTransportHandshake(InputMessageBase* msg); + +} // namespace policy +} // namespace brpc + +#endif // BRPC_POLICY_TRANSPORT_HANDSHAKE_PROTOCOL_H diff --git a/src/brpc/rdma/rdma_endpoint.cpp b/src/brpc/rdma/rdma_endpoint.cpp index fd70fb5c2b..99a4b85289 100644 --- a/src/brpc/rdma/rdma_endpoint.cpp +++ b/src/brpc/rdma/rdma_endpoint.cpp @@ -17,50 +17,51 @@ #if BRPC_WITH_RDMA -#include -#include "butil/fd_utility.h" -#include "butil/logging.h" // CHECK, LOG -#include "butil/sys_byteorder.h" // HostToNet,NetToHost -#include "bthread/bthread.h" +#include "brpc/rdma/rdma_endpoint.h" #include "brpc/errno.pb.h" #include "brpc/event_dispatcher.h" #include "brpc/input_messenger.h" -#include "brpc/socket.h" -#include "brpc/reloadable_flags.h" #include "brpc/rdma/block_pool.h" #include "brpc/rdma/rdma_helper.h" -#include "brpc/rdma/rdma_endpoint.h" #include "brpc/rdma_transport.h" -#include "brpc/rdma/rdma_handshake.h" -#include "brpc/rdma/rdma_handshake_constants.h" +#include "brpc/reloadable_flags.h" +#include "brpc/socket.h" +#include "bthread/bthread.h" +#include "butil/fd_utility.h" +#include "butil/logging.h" // CHECK, LOG +#include "butil/sys_byteorder.h" // HostToNet,NetToHost +#include + DECLARE_int32(task_group_ntags); namespace brpc { namespace rdma { -extern ibv_cq* (*IbvCreateCq)(ibv_context*, int, void*, ibv_comp_channel*, int); -extern int (*IbvDestroyCq)(ibv_cq*); -extern ibv_comp_channel* (*IbvCreateCompChannel)(ibv_context*); -extern int (*IbvDestroyCompChannel)(ibv_comp_channel*); -extern int (*IbvGetCqEvent)(ibv_comp_channel*, ibv_cq**, void**); -extern void (*IbvAckCqEvents)(ibv_cq*, unsigned int); -extern ibv_qp* (*IbvCreateQp)(ibv_pd*, ibv_qp_init_attr*); -extern int (*IbvModifyQp)(ibv_qp*, ibv_qp_attr*, ibv_qp_attr_mask); -extern int (*IbvQueryQp)(ibv_qp*, ibv_qp_attr*, ibv_qp_attr_mask, ibv_qp_init_attr*); -extern int (*IbvDestroyQp)(ibv_qp*); -extern int (*IbvQueryEce)(ibv_qp*, ibv_ece*); -extern int (*IbvSetEce)(ibv_qp*, ibv_ece*); +extern ibv_cq *(*IbvCreateCq)(ibv_context *, int, void *, ibv_comp_channel *, + int); +extern int (*IbvDestroyCq)(ibv_cq *); +extern ibv_comp_channel *(*IbvCreateCompChannel)(ibv_context *); +extern int (*IbvDestroyCompChannel)(ibv_comp_channel *); +extern int (*IbvGetCqEvent)(ibv_comp_channel *, ibv_cq **, void **); +extern void (*IbvAckCqEvents)(ibv_cq *, unsigned int); +extern ibv_qp *(*IbvCreateQp)(ibv_pd *, ibv_qp_init_attr *); +extern int (*IbvModifyQp)(ibv_qp *, ibv_qp_attr *, ibv_qp_attr_mask); +extern int (*IbvQueryQp)(ibv_qp *, ibv_qp_attr *, ibv_qp_attr_mask, + ibv_qp_init_attr *); +extern int (*IbvDestroyQp)(ibv_qp *); +extern int (*IbvQueryEce)(ibv_qp *, ibv_ece *); +extern int (*IbvSetEce)(ibv_qp *, ibv_ece *); extern bool g_skip_rdma_init; -// Only for UT: force AllocateResources() to fail, so that the "fallback to TCP" path -// of the handshake can be tested without a real RDMA device. +// Only for UT: force AllocateResources() to fail without a real RDMA device. bool g_fail_resource_alloc_for_test = false; DEFINE_int32(rdma_sq_size, 128, "SQ size for RDMA"); DEFINE_int32(rdma_rq_size, 128, "RQ size for RDMA"); DEFINE_bool(rdma_recv_zerocopy, true, "Enable zerocopy for receive side"); -DEFINE_int32(rdma_zerocopy_min_size, 512, "The minimal size for receive zerocopy"); +DEFINE_int32(rdma_zerocopy_min_size, 512, + "The minimal size for receive zerocopy"); DEFINE_int32(rdma_cqe_poll_once, 32, "The maximum of cqe number polled once."); DEFINE_int32(rdma_prepared_qp_size, 128, "SQ and RQ size for prepared QP."); DEFINE_int32(rdma_prepared_qp_cnt, 1024, "Initial count of prepared QP."); @@ -88,1602 +89,1138 @@ extern const uint16_t MIN_QP_SIZE = 16; static const uint16_t MAX_QP_SIZE = 4096; extern const uint16_t MIN_BLOCK_SIZE = 1024; -static butil::Mutex* g_rdma_resource_mutex = nullptr; -static RdmaResource* g_rdma_resource_list = nullptr; +static butil::Mutex *g_rdma_resource_mutex = nullptr; +static RdmaResource *g_rdma_resource_list = nullptr; RdmaResource::~RdmaResource() { - if (nullptr != qp) { - IbvDestroyQp(qp); - } - if (nullptr != polling_cq) { - IbvDestroyCq(polling_cq); - } - if (nullptr != send_cq) { - IbvDestroyCq(send_cq); - } - if (nullptr != recv_cq) { - IbvDestroyCq(recv_cq); - } - if (nullptr != comp_channel) { - IbvDestroyCompChannel(comp_channel); - } + if (nullptr != qp) { + IbvDestroyQp(qp); + } + if (nullptr != polling_cq) { + IbvDestroyCq(polling_cq); + } + if (nullptr != send_cq) { + IbvDestroyCq(send_cq); + } + if (nullptr != recv_cq) { + IbvDestroyCq(recv_cq); + } + if (nullptr != comp_channel) { + IbvDestroyCompChannel(comp_channel); + } } -RdmaEndpoint::RdmaEndpoint(Socket* s) - : _socket(s) - , _state(UNINIT) - , _handshake_version(0) - , _resource(nullptr) - , _send_cq_events(0) - , _recv_cq_events(0) - , _cq_sid(INVALID_SOCKET_ID) - , _sq_size(FLAGS_rdma_sq_size) - , _rq_size(FLAGS_rdma_rq_size) - , _remote_recv_block_size(0) - , _accumulated_ack(0) - , _unsolicited(0) - , _unsolicited_bytes(0) - , _sq_current(0) - , _sq_unsignaled(0) - , _sq_sent(0) - , _rq_received(0) - , _local_window_capacity(0) - , _remote_window_capacity(0) - , _sq_imm_window_size(0) - , _remote_rq_window_size(0) - , _sq_window_size(0) - , _new_rq_wrs(0) -{ - if (_sq_size < MIN_QP_SIZE) { - _sq_size = MIN_QP_SIZE; - } - if (_sq_size > MAX_QP_SIZE) { - _sq_size = MAX_QP_SIZE; - } - if (_rq_size < MIN_QP_SIZE) { - _rq_size = MIN_QP_SIZE; - } - if (_rq_size > MAX_QP_SIZE) { - _rq_size = MAX_QP_SIZE; - } - _read_butex = bthread::butex_create_checked >(); +RdmaEndpoint::RdmaEndpoint(Socket *s) + : _socket(s), _state(UNINIT), _handshake_version(0), _resource(nullptr), + _send_cq_events(0), _recv_cq_events(0), _cq_sid(INVALID_SOCKET_ID), + _sq_size(FLAGS_rdma_sq_size), _rq_size(FLAGS_rdma_rq_size), + _remote_recv_block_size(0), _accumulated_ack(0), _unsolicited(0), + _unsolicited_bytes(0), _sq_current(0), _sq_unsignaled(0), _sq_sent(0), + _rq_received(0), _local_window_capacity(0), _remote_window_capacity(0), + _sq_imm_window_size(0), _remote_rq_window_size(0), _sq_window_size(0), + _new_rq_wrs(0) { + if (_sq_size < MIN_QP_SIZE) { + _sq_size = MIN_QP_SIZE; + } + if (_sq_size > MAX_QP_SIZE) { + _sq_size = MAX_QP_SIZE; + } + if (_rq_size < MIN_QP_SIZE) { + _rq_size = MIN_QP_SIZE; + } + if (_rq_size > MAX_QP_SIZE) { + _rq_size = MAX_QP_SIZE; + } } -RdmaEndpoint::~RdmaEndpoint() { - Reset(); - bthread::butex_destroy(_read_butex); -} +RdmaEndpoint::~RdmaEndpoint() { Reset(); } void RdmaEndpoint::Reset() { - DeallocateResources(); - - _state.store(UNINIT, butil::memory_order_relaxed); - _handshake_version = 0; - _outgoing_ece.reset(); - _resource = nullptr; - _send_cq_events = 0; - _recv_cq_events = 0; - _cq_sid = INVALID_SOCKET_ID; - _sbuf.clear(); - _rbuf.clear(); - _rbuf_data.clear(); - _remote_recv_block_size = 0; - _accumulated_ack = 0; - _unsolicited = 0; - _unsolicited_bytes = 0; - _sq_current = 0; - _sq_unsignaled = 0; - _sq_sent = 0; - _rq_received = 0; - _local_window_capacity = 0; - _remote_window_capacity = 0; - _sq_imm_window_size = 0; - _remote_rq_window_size.store(0, butil::memory_order_relaxed); - _sq_window_size.store(0, butil::memory_order_relaxed); - _new_rq_wrs.store(0, butil::memory_order_relaxed); + DeallocateResources(); + + _outgoing_ece.reset(); + _resource = nullptr; + _send_cq_events = 0; + _recv_cq_events = 0; + _cq_sid = INVALID_SOCKET_ID; + _sbuf.clear(); + _rbuf.clear(); + _rbuf_data.clear(); + _remote_recv_block_size = 0; + _accumulated_ack = 0; + _unsolicited = 0; + _unsolicited_bytes = 0; + _sq_current = 0; + _sq_unsignaled = 0; + _sq_sent = 0; + _rq_received = 0; + _local_window_capacity = 0; + _remote_window_capacity = 0; + _sq_imm_window_size = 0; + _remote_rq_window_size.store(0, butil::memory_order_relaxed); + _sq_window_size.store(0, butil::memory_order_relaxed); + _new_rq_wrs.store(0, butil::memory_order_relaxed); } -void RdmaConnect::StartConnect(const Socket* socket, - void (*done)(int err, void* data), - void* data) { - auto* rdma_transport = static_cast(socket->_transport.get()); - CHECK(rdma_transport->_rdma_ep != nullptr); - SocketUniquePtr s; - if (Socket::Address(socket->id(), &s) != 0) { - return; - } - if (!IsRdmaAvailable()) { - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - rdma_transport->_rdma_ep->_state.store( - RdmaEndpoint::FALLBACK_TCP, butil::memory_order_release); - done(0, data); - return; - } - _done = done; - _data = data; - bthread_t tid; - bthread_attr_t attr = BTHREAD_ATTR_NORMAL; - bthread_attr_set_name(&attr, "RdmaProcessHandshakeAtClient"); - if (bthread_start_background(&tid, &attr, - RdmaEndpoint::ProcessHandshakeAtClient, - rdma_transport->_rdma_ep) < 0) { - LOG(FATAL) << "Fail to start handshake bthread"; - Run(); - } else { - s.release(); - } +void RdmaEndpoint::ApplyRemoteInfo(const RdmaConnectionInfo &remote) { + _remote_recv_block_size = remote.block_size; + _local_window_capacity = std::min(_sq_size, remote.rq_size) - RESERVED_WR_NUM; + _remote_window_capacity = + std::min(_rq_size, remote.sq_size) - RESERVED_WR_NUM; + _sq_imm_window_size = RESERVED_WR_NUM; + _remote_rq_window_size.store(_local_window_capacity, + butil::memory_order_relaxed); + _sq_window_size.store(_local_window_capacity, butil::memory_order_relaxed); } -void RdmaConnect::StopConnect(Socket* socket) { } - -void RdmaConnect::Run() { - _done(errno, _data); +void RdmaEndpoint::GetLocalConnectionInfo(RdmaConnectionInfo *local) const { + CHECK(local != NULL); + local->block_size = g_rdma_recv_block_size; + local->sq_size = _sq_size; + local->rq_size = _rq_size; + local->lid = GetRdmaLid(); + local->gid = GetRdmaGid(); + local->qp_num = BAIDU_LIKELY(_resource) ? _resource->qp->qp_num : 0; + local->ece.reset(); + if (_outgoing_ece.has_value()) { + local->ece = _outgoing_ece; + } } -void RdmaEndpoint::OnNewDataFromTcp(Socket* m) { - auto* rdma_transport = static_cast(m->_transport.get()); - RdmaEndpoint* ep = rdma_transport->GetRdmaEp(); - CHECK(ep != nullptr); - - int progress = Socket::PROGRESS_INIT; - while (true) { - // Pair with release stores of FALLBACK_TCP so RDMA_OFF is visible - // before normal TCP message processing starts. - const State state = ep->_state.load(butil::memory_order_acquire); - if (state == UNINIT) { - // The connection may be closed or reset before the client starts - // handshake. This will be handled by client handshake. Ignore here. - } else if (state < ESTABLISHED) { // during handshake - ep->_read_butex->fetch_add(1, butil::memory_order_release); - bthread::butex_wake(ep->_read_butex); - } else if (state == FALLBACK_TCP){ // handshake finishes - InputMessenger::OnNewMessages(m); - return; - } else if (state == ESTABLISHED) { - uint8_t tmp; - ssize_t nr = read(ep->_socket->fd(), &tmp, 1); - if (nr == 0) { - ep->_socket->SetEOF(); - return; - } - if (nr > 0) { - LOG(WARNING) << "Read unexpected data from " << ep->_socket; - ep->_socket->SetFailed(EPROTO, "Read unexpected data from %s", - ep->_socket->description().c_str()); - return; - } - - if (errno != EAGAIN) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read from " << ep->_socket; - ep->_socket->SetFailed(saved_errno, "Fail to read from %s: %s", - ep->_socket->description().c_str(), - berror(saved_errno)); - } - } - if (!m->MoreReadEvents(&progress)) { - break; - } - } +int RdmaEndpoint::QueryLocalEce(ibv_ece *ece) const { + if (ece == NULL || IbvQueryEce == NULL || _resource == NULL || + _resource->qp == NULL) { + return 1; + } + return IbvQueryEce(_resource->qp, ece) == 0 ? 0 : -1; } -static const int WAIT_TIMEOUT_MS = 50; - -// Drive an EAGAIN-aware read loop to completion (exactly `len` bytes). -// `read_once(offset, remaining)` performs ONE underlying read attempt: -// returns > 0 : number of bytes consumed (added to running total); -// returns = 0 : end-of-stream (the loop fails with EEOF); -// returns < 0 : errno set; EAGAIN is handled here via butex_wait, -// any other errno bubbles up. -// `offset` is bytes already received in THIS call (initially 0); the -// callable uses it to choose the next write target (e.g. `(char*)buf -// + offset`). Callables that don't need offset (e.g. IOPortal append) -// can ignore it. -// -// Centralizes the EAGAIN/butex/EOF loop so the two ReadFromFd -// overloads below stay one-liners; any future read source (memory- -// mapped, scatter-vector, etc.) can plug in by passing its own -// `read_once`. -template -static int ReadFromFdLoop(butil::atomic* read_butex, - size_t len, ReadOnce&& read_once) { - size_t received = 0; - while (received < len) { - const int expected_val = read_butex->load(butil::memory_order_acquire); - const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); - ssize_t nr = read_once(received, len - received); - if (nr < 0) { - if (errno == EAGAIN) { - if (bthread::butex_wait(read_butex, expected_val, &duetime) < 0) { - if (errno != EWOULDBLOCK && errno != ETIMEDOUT) { - return -1; - } - } - } else { - return -1; - } - } else if (nr == 0) { // Got EOF - errno = EEOF; - return -1; - } else { - received += nr; - } - } - return 0; -} - -int RdmaEndpoint::ReadFromFd(void* data, size_t len) { - CHECK(data != nullptr); - const int fd = _socket->fd(); - return ReadFromFdLoop(_read_butex, len, - [data, fd](size_t offset, size_t remaining) { - return read(fd, (uint8_t*)data + offset, remaining); - }); -} - -int RdmaEndpoint::ReadFromFd(butil::IOPortal* data, size_t len) { - CHECK(data != nullptr); - const int fd = _socket->fd(); - return ReadFromFdLoop(_read_butex, len, - [data, fd](size_t /*offset*/, size_t remaining) { - return data->append_from_file_descriptor(fd, remaining); - }); -} - -// Drive an EAGAIN-aware write loop to completion (exactly `len` bytes). -// -// `write_once(offset, remaining)` performs ONE underlying write attempt: -// - returns >= 0 : number of bytes consumed (added to running total); -// - returns < 0 : errno set; EAGAIN triggers `wait_writable(duetime)`, -// any other errno bubbles up. -// `offset` is bytes already written in THIS call (initially 0); the -// callable uses it to choose the next read source (e.g. `(char*)buf -// + offset`). Callables that drain a self-tracking sink (e.g. -// IOBuf::cut_into_file_descriptor) can ignore both args. -// -// `wait_writable(duetime)` is invoked on EAGAIN to park until the fd -// becomes writable again. It returns 0 on wake-up (or ETIMEDOUT), -// non-zero on hard failure. -template -static int WriteToFdLoop(size_t len, WriteOnce&& write_once, WaitWritable&& wait_writable) { - size_t written = 0; - while (written < len) { - const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); - ssize_t nw = write_once(written, len - written); - if (nw >= 0) { - written += nw; - continue; - } - - if (errno != EAGAIN) { - return -1; - } - if (!wait_writable(&duetime)) { - return -1; - } - } - return 0; -} - -int RdmaEndpoint::WriteToFd(void* data, size_t len) { - CHECK(data != nullptr); - Socket* s = _socket; - const int fd = s->fd(); - return WriteToFdLoop(len, - [data, fd](size_t offset, size_t remaining) { - return write(fd, (uint8_t*)data + offset, remaining); - }, - [s, fd](const timespec* duetime) { - return s->WaitEpollOut(fd, true, duetime) == 0 || errno == ETIMEDOUT; - }); -} - -int RdmaEndpoint::WriteToFd(butil::IOBuf* data) { - CHECK(data != nullptr); - Socket* s = _socket; - const int fd = s->fd(); - return WriteToFdLoop(data->size(), - [data, fd](size_t /*offset*/, size_t /*remaining*/) { - return data->cut_into_file_descriptor(fd); - }, - [s, fd](const timespec* duetime) { - return s->WaitEpollOut(fd, true, duetime) == 0 || errno == ETIMEDOUT; - }); -} - -void RdmaEndpoint::ApplyRemoteHello(const ParsedHello& remote) { - _remote_recv_block_size = remote.block_size; - _local_window_capacity = std::min(_sq_size, remote.rq_size) - RESERVED_WR_NUM; - _remote_window_capacity = std::min(_rq_size, remote.sq_size) - RESERVED_WR_NUM; - _sq_imm_window_size = RESERVED_WR_NUM; - _remote_rq_window_size.store(_local_window_capacity, butil::memory_order_relaxed); - _sq_window_size.store(_local_window_capacity, butil::memory_order_relaxed); -} - -// Client-side handshake entry: the state machine. -// -// C_ALLOC_QPCQ -// | -// v -// C_HELLO_SEND (hs->SendLocalHello) -// | -// v -// C_HELLO_WAIT (hs->ReceiveAndParseRemoteHello) -// | -// v -// [negotiation: ApplyRemoteHello + C_BRINGUP_QP] -// | -// v -// C_ACK_SEND -// | -// v -// ESTABLISHED / FALLBACK_TCP -void* RdmaEndpoint::ProcessHandshakeAtClient(void* arg) { - auto ep = static_cast(arg); - SocketUniquePtr s(ep->_socket); - RdmaConnect::RunGuard rg((RdmaConnect*)s->_app_connect.get()); - auto rdma_transport = static_cast(s->_transport.get()); - - LOG_IF(INFO, FLAGS_rdma_trace_verbose) - << "Start handshake on " << s->description(); - - std::unique_ptr handshake = CreateClientHandshake(ep); - CHECK(handshake != nullptr); - ep->_handshake_version = handshake->ProtocolVersion(); - - // First initialize CQ and QP resources. - ep->_state.store(C_ALLOC_QPCQ, butil::memory_order_relaxed); - if (ep->AllocateResources() < 0) { - PLOG(WARNING) << "Fail to allocate rdma resources, fallback to tcp:" - << s->description(); - errno = 0; - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - ep->_state.store(FALLBACK_TCP, butil::memory_order_release); - return nullptr; - } - - // Send hello message to server - ep->_state.store(C_HELLO_SEND, butil::memory_order_relaxed); - if (handshake->SendLocalHello() < 0) { - int saved_errno = errno; - PLOG(WARNING) << "Fail to send hello message to server:" - << s->description(); - s->SetFailed(saved_errno, "Fail to complete rdma handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state.store(FAILED, butil::memory_order_relaxed); - return nullptr; - } - - // Receive and parse remote hello. - ep->_state.store(C_HELLO_WAIT, butil::memory_order_relaxed); - ParsedHello remote{}; - const RemoteHelloResult r = handshake->ReceiveAndParseRemoteHello(&remote); - if (r == RemoteHelloResult::ERROR) { - int saved_errno = errno; - PLOG(WARNING) << "Fail to receive hello from server:" - << s->description(); - s->SetFailed(saved_errno, "Fail to complete rdma handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state.store(FAILED, butil::memory_order_relaxed); - return nullptr; - } - - if (r != RemoteHelloResult::NEGOTIATED) { - LOG(WARNING) << "Fail to negotiate with server, fallback to tcp:" - << s->description(); - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - } else { - ep->ApplyRemoteHello(remote); - ep->_state.store(C_BRINGUP_QP, butil::memory_order_relaxed); - if (ep->BringUpQp(remote, /*is_server=*/false) < 0) { - LOG(WARNING) << "Fail to bringup QP, fallback to tcp:" - << s->description(); - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - } else { - rdma_transport->_rdma_state = RdmaTransport::RDMA_ON; - } - } - - // Send ACK message to server - ep->_state.store(C_ACK_SEND, butil::memory_order_relaxed); - bool rdma_on = rdma_transport->_rdma_state == RdmaTransport::RDMA_ON; - uint32_t flags = rdma_on ? HELLO_ACK_RDMA_OK : 0; - uint32_t flags_be = butil::HostToNet32(flags); - if (ep->WriteToFd(&flags_be, HELLO_ACK_LEN) < 0) { - int saved_errno = errno; - PLOG(WARNING) << "Fail to send Ack Message to server:" - << s->description(); - s->SetFailed(saved_errno, "Fail to complete rdma handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state.store(FAILED, butil::memory_order_relaxed); - return nullptr; - } - - if (rdma_transport->_rdma_state == RdmaTransport::RDMA_ON) { - ep->_state.store(ESTABLISHED, butil::memory_order_relaxed); - LOG_IF(INFO, FLAGS_rdma_trace_verbose) - << "Client handshake ends (use rdma v" << ep->_handshake_version - << ") on " << s->description(); - } else { - ep->_state.store(FALLBACK_TCP, butil::memory_order_release); - LOG_IF(INFO, FLAGS_rdma_trace_verbose) - << "Client handshake ends (use tcp) on " << s->description(); - } - - errno = 0; - - return nullptr; -} - -// Server-side handshake entry: the state machine. -// -// S_HELLO_WAIT (read magic + dispatch + hs->ReceiveAndParseRemoteHello) -// | -// v -// [negotiation: ApplyRemoteHello + S_ALLOC_QPCQ + S_BRINGUP_QP] -// | -// v -// S_HELLO_SEND (hs->SendLocalHello) -// | -// v -// S_ACK_WAIT -// | -// v -// ESTABLISHED / FALLBACK_TCP -ParseResult RdmaEndpoint::ExecuteServerHandshake(butil::IOBuf* source, Socket* s) { - RdmaTransport* rdma_transport = static_cast(s->_transport.get()); - RdmaEndpoint* ep = rdma_transport->_rdma_ep; - CHECK(ep != nullptr); - - if (s->parsing_context() == nullptr) { - // Phase 1: read the client hello, negotiate, reply server hello. - if (source->size() < HELLO_MAGIC_LEN) { - return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); - } - uint8_t magic[HELLO_MAGIC_LEN]; - CHECK_EQ(source->copy_to(magic, HELLO_MAGIC_LEN), HELLO_MAGIC_LEN); - - // Pick the version-specific server handshake from the peeked magic (the - // magic is NOT consumed; ReceiveAndParseRemoteHello() reads it again - // from `source`). - std::unique_ptr hs = CreateServerHandshakeByMagic(ep, source, magic); - if (hs == nullptr) { - return MakeParseError(PARSE_ERROR_TRY_OTHERS); - } - ep->_handshake_version = hs->ProtocolVersion(); - ep->_state.store(S_HELLO_WAIT, butil::memory_order_relaxed); - - ParsedHello remote{}; - const RemoteHelloResult r = hs->ReceiveAndParseRemoteHello(&remote); - if (r == RemoteHelloResult::NEED_MORE) { - return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); - } - if (r == RemoteHelloResult::ERROR) { - ep->_state.store(FAILED, butil::memory_order_relaxed); - return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); - } - - // Negotiate + allocate resources. - bool negotiated = r == RemoteHelloResult::NEGOTIATED; - if (negotiated) { - ep->ApplyRemoteHello(remote); - ep->_state.store(S_ALLOC_QPCQ, butil::memory_order_relaxed); - if (ep->AllocateResources() < 0) { - PLOG(WARNING) << "Fail to allocate rdma resources, fallback to tcp:" - << s->description(); - negotiated = false; - } else { - ep->_state.store(S_BRINGUP_QP, butil::memory_order_relaxed); - if (ep->BringUpQp(remote, /*is_server=*/true) < 0) { - LOG(WARNING) << "Fail to bringup QP, fallback to tcp:" - << s->description(); - negotiated = false; - } - } - } - if (!negotiated) { - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - } - - // Reply the server hello. - // Emits a real hello when _rdma_state != RDMA_OFF; - // an un-negotiable one otherwise. - ep->_state.store(S_HELLO_SEND, butil::memory_order_relaxed); - if (hs->SendLocalHello() < 0) { - PLOG(WARNING) << "Fail to send server hello to " << s->description(); - ep->_state.store(FAILED, butil::memory_order_relaxed); - return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); - } - - // Enter the wait-ACK phase. Whether negotiation succeeded is already - // recorded in rdma_transport->_rdma_state (RDMA_OFF iff negotiation - // failed), so the context itself needs no extra flag. - s->reset_parsing_context(ServerHandshakeContext::Create()); - ep->_state.store(S_ACK_WAIT, butil::memory_order_relaxed); - return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); - } - - // Phase 2: drain the 4B ACK and finalize. - if (source->size() < HELLO_ACK_LEN) { - return MakeParseError(PARSE_ERROR_NOT_ENOUGH_DATA); - } - if (source->size() > HELLO_ACK_LEN) { - LOG(WARNING) << "Too many bytes in handshake ACK, drop connection: " - << s->description(); - ep->_state.store(FAILED, butil::memory_order_relaxed); - s->reset_parsing_context(nullptr); - return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); - } - - uint32_t flags_be = 0; - CHECK_EQ(source->cutn(&flags_be, HELLO_ACK_LEN), HELLO_ACK_LEN); - uint32_t flags = butil::NetToHost32(flags_be); - bool client_ack_ok = (flags & HELLO_ACK_RDMA_OK) != 0; - if (!client_ack_ok) { - LOG_IF(INFO, FLAGS_rdma_trace_verbose) - << "Server handshake ends (use tcp) on " << s->description(); - rdma_transport->_rdma_state = RdmaTransport::RDMA_OFF; - ep->_state.store(FALLBACK_TCP, butil::memory_order_release); - s->reset_parsing_context(nullptr); - return MakeParseError(PARSE_ERROR_TRY_OTHERS); - } - - if (rdma_transport->_rdma_state == RdmaTransport::RDMA_OFF) { - LOG(WARNING) << "Client wants RDMA in ACK but server fell back: " - << s->description(); - ep->_state.store(FAILED, butil::memory_order_relaxed); - s->reset_parsing_context(nullptr); - return MakeParseError(PARSE_ERROR_ABSOLUTELY_WRONG); - } - - LOG_IF(INFO, FLAGS_rdma_trace_verbose) - << "Server handshake ends (use rdma v" << ep->_handshake_version - << ") on " << s->description(); - rdma_transport->_rdma_state = RdmaTransport::RDMA_ON; - ep->_state.store(ESTABLISHED, butil::memory_order_relaxed); - s->reset_parsing_context(nullptr); - return MakeParseError(PARSE_ERROR_TRY_OTHERS); -} +void RdmaEndpoint::SetOutgoingEce(const ibv_ece &ece) { _outgoing_ece = ece; } bool RdmaEndpoint::IsWritable() const { - if (BAIDU_UNLIKELY(g_skip_rdma_init)) { - // Just for UT - return false; - } + if (BAIDU_UNLIKELY(g_skip_rdma_init)) { + // Just for UT + return false; + } - return _remote_rq_window_size.load(butil::memory_order_relaxed) > 0 && - _sq_window_size.load(butil::memory_order_relaxed) > 0; + return _remote_rq_window_size.load(butil::memory_order_relaxed) > 0 && + _sq_window_size.load(butil::memory_order_relaxed) > 0; } // RdmaIOBuf inherits from IOBuf to provide a new function. // The reason is that we need to use some protected member function of IOBuf. class RdmaIOBuf : public butil::IOBuf { -friend class RdmaEndpoint; + friend class RdmaEndpoint; + private: - // Cut the current IOBuf to ibv_sge list and `to' for at most first max_sge - // blocks or first max_len bytes. - // Return: the bytes included in the sglist, or -1 if failed - ssize_t cut_into_sglist_and_iobuf(ibv_sge* sglist, size_t* sge_index, - butil::IOBuf* to, size_t max_sge, - size_t max_len) { - size_t len = 0; - while (*sge_index < max_sge) { - if (len == max_len || _ref_num() == 0) { - break; - } - butil::IOBuf::BlockRef const& r = _ref_at(0); - CHECK(r.length > 0); - const void* start = fetch1(); - uint32_t lkey = GetRegionId(start); - if (lkey == 0) { // get lkey for user registered memory - uint64_t meta = get_first_data_meta(); - if (meta <= UINT_MAX) { - lkey = (uint32_t)meta; - } - } - if (BAIDU_UNLIKELY(lkey == 0)) { // only happens when meta is not specified - lkey = GetLKey((char*)start - r.offset); - } - if (lkey == 0) { - LOG(WARNING) << "Memory not registered for rdma. " - << "Is this iobuf allocated before calling " - << "GlobalRdmaInitializeOrDie? Or just forget to " - << "call RegisterMemoryForRdma for your own buffer?"; - errno = ERDMAMEM; - return -1; - } - size_t i = *sge_index; - if (len + r.length > max_len) { - // Split the block to comply with size for receiving - sglist[i].length = max_len - len; - len = max_len; - } else { - sglist[i].length = r.length; - len += r.length; - } - sglist[i].addr = (uint64_t)start; - sglist[i].lkey = lkey; - cutn(to, sglist[i].length); - (*sge_index)++; - } - return len; - } + // Cut the current IOBuf to ibv_sge list and `to' for at most first max_sge + // blocks or first max_len bytes. + // Return: the bytes included in the sglist, or -1 if failed + ssize_t cut_into_sglist_and_iobuf(ibv_sge *sglist, size_t *sge_index, + butil::IOBuf *to, size_t max_sge, + size_t max_len) { + size_t len = 0; + while (*sge_index < max_sge) { + if (len == max_len || _ref_num() == 0) { + break; + } + butil::IOBuf::BlockRef const &r = _ref_at(0); + CHECK(r.length > 0); + const void *start = fetch1(); + uint32_t lkey = GetRegionId(start); + if (lkey == 0) { // get lkey for user registered memory + uint64_t meta = get_first_data_meta(); + if (meta <= UINT_MAX) { + lkey = (uint32_t)meta; + } + } + if (BAIDU_UNLIKELY(lkey == + 0)) { // only happens when meta is not specified + lkey = GetLKey((char *)start - r.offset); + } + if (lkey == 0) { + LOG(WARNING) << "Memory not registered for rdma. " + << "Is this iobuf allocated before calling " + << "GlobalRdmaInitializeOrDie? Or just forget to " + << "call RegisterMemoryForRdma for your own buffer?"; + errno = ERDMAMEM; + return -1; + } + size_t i = *sge_index; + if (len + r.length > max_len) { + // Split the block to comply with size for receiving + sglist[i].length = max_len - len; + len = max_len; + } else { + sglist[i].length = r.length; + len += r.length; + } + sglist[i].addr = (uint64_t)start; + sglist[i].lkey = lkey; + cutn(to, sglist[i].length); + (*sge_index)++; + } + return len; + } }; // Note this function is coupled with the implementation of IOBuf -ssize_t RdmaEndpoint::CutFromIOBufList(butil::IOBuf** from, size_t ndata) { - if (BAIDU_UNLIKELY(g_skip_rdma_init)) { - // Just for UT +ssize_t RdmaEndpoint::CutFromIOBufList(butil::IOBuf **from, size_t ndata) { + if (BAIDU_UNLIKELY(g_skip_rdma_init)) { + // Just for UT + errno = EAGAIN; + return -1; + } + + CHECK(from != nullptr); + CHECK(ndata > 0); + + size_t total_len = 0; + size_t current = 0; + uint32_t remote_rq_window_size = + _remote_rq_window_size.load(butil::memory_order_relaxed); + uint32_t sq_window_size = _sq_window_size.load(butil::memory_order_relaxed); + ibv_send_wr wr; + int max_sge = GetRdmaMaxSge(); + ibv_sge sglist[max_sge]; + while (current < ndata) { + if (remote_rq_window_size == 0 || sq_window_size == 0) { + // There is no space left in SQ or remote RQ. + if (total_len > 0) { + break; + } else { errno = EAGAIN; return -1; + } } + butil::IOBuf *to = &_sbuf[_sq_current]; + size_t this_len = 0; - CHECK(from != nullptr); - CHECK(ndata > 0); - - size_t total_len = 0; - size_t current = 0; - uint32_t remote_rq_window_size = - _remote_rq_window_size.load(butil::memory_order_relaxed); - uint32_t sq_window_size = - _sq_window_size.load(butil::memory_order_relaxed); - ibv_send_wr wr; - int max_sge = GetRdmaMaxSge(); - ibv_sge sglist[max_sge]; - while (current < ndata) { - if (remote_rq_window_size == 0 || sq_window_size == 0) { - // There is no space left in SQ or remote RQ. - if (total_len > 0) { - break; - } else { - errno = EAGAIN; - return -1; - } - } - butil::IOBuf* to = &_sbuf[_sq_current]; - size_t this_len = 0; - - memset(&wr, 0, sizeof(wr)); - wr.sg_list = sglist; - wr.opcode = IBV_WR_SEND_WITH_IMM; - - RdmaIOBuf* data = (RdmaIOBuf*)from[current]; - size_t sge_index = 0; - while (sge_index < (uint32_t)max_sge && - this_len < _remote_recv_block_size) { - if (data->empty()) { - // The current IOBuf is empty, find next one - ++current; - if (current == ndata) { - break; - } - data = (RdmaIOBuf*)from[current]; - continue; - } - - ssize_t len = data->cut_into_sglist_and_iobuf( - sglist, &sge_index, to, max_sge, _remote_recv_block_size - this_len); - if (len < 0) { - return -1; - } - CHECK(len > 0); - this_len += len; - total_len += len; - } - if (this_len == 0) { - continue; - } - - wr.num_sge = sge_index; - - uint32_t imm = _new_rq_wrs.exchange(0, butil::memory_order_relaxed); - wr.imm_data = butil::HostToNet32(imm); - // Avoid too much recv completion event to reduce the cpu overhead - bool solicited = false; - if (remote_rq_window_size == 1 || sq_window_size == 1 || current + 1 >= ndata) { - // Only last message in the write queue or last message in the - // current window will be flagged as solicited. - solicited = true; - } else { - if (_unsolicited > _local_window_capacity / 4) { - // Make sure the recv side can be signaled to return ack - solicited = true; - } else if (_accumulated_ack > _remote_window_capacity / 4) { - // Make sure the recv side can be signaled to handle ack - solicited = true; - } else if (_unsolicited_bytes > 1048576) { - // Make sure the recv side can be signaled when it receives enough data - solicited = true; - } else { - ++_unsolicited; - _unsolicited_bytes += this_len; - _accumulated_ack += imm; - } - } - if (solicited) { - wr.send_flags |= IBV_SEND_SOLICITED; - _unsolicited = 0; - _unsolicited_bytes = 0; - _accumulated_ack = 0; - } - - // Avoid too much send completion event to reduce the CPU overhead - ++_sq_unsignaled; - if (_sq_unsignaled >= _local_window_capacity / 4) { - // Refer to: - // http::www.rdmamojo.com/2014/06/30/working-unsignaled-completions/ - wr.send_flags |= IBV_SEND_SIGNALED; - wr.wr_id = _sq_unsignaled; - _sq_unsignaled = 0; - } - - ibv_send_wr* bad = nullptr; - int err = ibv_post_send(_resource->qp, &wr, &bad); - if (err != 0) { - // We use other way to guarantee the Send Queue is not full. - // So we just consider this error as an unrecoverable error. - std::ostringstream oss; - DebugInfo(oss, ", "); - LOG(WARNING) << "Fail to ibv_post_send: " << berror(err) << " " << oss.str(); - errno = err; - return -1; - } - - ++_sq_current; - if (_sq_current == _sq_size - RESERVED_WR_NUM) { - _sq_current = 0; - } + memset(&wr, 0, sizeof(wr)); + wr.sg_list = sglist; + wr.opcode = IBV_WR_SEND_WITH_IMM; - // Update `_remote_rq_window_size' and `_sq_window_size'. Note that - // `_remote_rq_window_size' and `_sq_window_size' will never be negative. - // Because there is at most one thread can enter this function for each - // Socket, and the other thread of HandleCompletion can only add these - // counters. - remote_rq_window_size = - _remote_rq_window_size.fetch_sub(1, butil::memory_order_relaxed) - 1; - sq_window_size = _sq_window_size.fetch_sub(1, butil::memory_order_relaxed) - 1; + RdmaIOBuf *data = (RdmaIOBuf *)from[current]; + size_t sge_index = 0; + while (sge_index < (uint32_t)max_sge && + this_len < _remote_recv_block_size) { + if (data->empty()) { + // The current IOBuf is empty, find next one + ++current; + if (current == ndata) { + break; + } + data = (RdmaIOBuf *)from[current]; + continue; + } + + ssize_t len = data->cut_into_sglist_and_iobuf( + sglist, &sge_index, to, max_sge, _remote_recv_block_size - this_len); + if (len < 0) { + return -1; + } + CHECK(len > 0); + this_len += len; + total_len += len; } - - return total_len; -} - -int RdmaEndpoint::SendAck(int num) { - if (_new_rq_wrs.fetch_add(num, butil::memory_order_relaxed) > _remote_window_capacity / 2 && - _sq_imm_window_size > 0) { - return SendImm(_new_rq_wrs.exchange(0, butil::memory_order_relaxed)); + if (this_len == 0) { + continue; } - return 0; -} -int RdmaEndpoint::SendImm(uint32_t imm) { - if (imm == 0) { - return 0; - } + wr.num_sge = sge_index; - ibv_send_wr wr; - memset(&wr, 0, sizeof(wr)); - wr.opcode = IBV_WR_SEND_WITH_IMM; + uint32_t imm = _new_rq_wrs.exchange(0, butil::memory_order_relaxed); wr.imm_data = butil::HostToNet32(imm); - wr.send_flags |= IBV_SEND_SOLICITED | IBV_SEND_SIGNALED; - wr.wr_id = 0; - - ibv_send_wr* bad = nullptr; + // Avoid too much recv completion event to reduce the cpu overhead + bool solicited = false; + if (remote_rq_window_size == 1 || sq_window_size == 1 || + current + 1 >= ndata) { + // Only last message in the write queue or last message in the + // current window will be flagged as solicited. + solicited = true; + } else { + if (_unsolicited > _local_window_capacity / 4) { + // Make sure the recv side can be signaled to return ack + solicited = true; + } else if (_accumulated_ack > _remote_window_capacity / 4) { + // Make sure the recv side can be signaled to handle ack + solicited = true; + } else if (_unsolicited_bytes > 1048576) { + // Make sure the recv side can be signaled when it receives enough data + solicited = true; + } else { + ++_unsolicited; + _unsolicited_bytes += this_len; + _accumulated_ack += imm; + } + } + if (solicited) { + wr.send_flags |= IBV_SEND_SOLICITED; + _unsolicited = 0; + _unsolicited_bytes = 0; + _accumulated_ack = 0; + } + + // Avoid too much send completion event to reduce the CPU overhead + ++_sq_unsignaled; + if (_sq_unsignaled >= _local_window_capacity / 4) { + // Refer to: + // http::www.rdmamojo.com/2014/06/30/working-unsignaled-completions/ + wr.send_flags |= IBV_SEND_SIGNALED; + wr.wr_id = _sq_unsignaled; + _sq_unsignaled = 0; + } + + ibv_send_wr *bad = nullptr; int err = ibv_post_send(_resource->qp, &wr, &bad); if (err != 0) { - std::ostringstream oss; - DebugInfo(oss, ", "); - // We use other way to guarantee the Send Queue is not full. - // So we just consider this error as an unrecoverable error. - LOG(WARNING) << "Fail to ibv_post_send: " << berror(err) << " " << oss.str(); - return -1; - } - - // `_sq_imm_window_size' will never be negative. - // Because IMM can only be sent if - // `_sq_imm_window_size` is greater than 0. - _sq_imm_window_size -= 1; - return 0; + // We use other way to guarantee the Send Queue is not full. + // So we just consider this error as an unrecoverable error. + std::ostringstream oss; + DebugInfo(oss, ", "); + LOG(WARNING) << "Fail to ibv_post_send: " << berror(err) << " " + << oss.str(); + errno = err; + return -1; + } + + ++_sq_current; + if (_sq_current == _sq_size - RESERVED_WR_NUM) { + _sq_current = 0; + } + + // Update `_remote_rq_window_size' and `_sq_window_size'. Note that + // `_remote_rq_window_size' and `_sq_window_size' will never be negative. + // Because there is at most one thread can enter this function for each + // Socket, and the other thread of HandleCompletion can only add these + // counters. + remote_rq_window_size = + _remote_rq_window_size.fetch_sub(1, butil::memory_order_relaxed) - 1; + sq_window_size = + _sq_window_size.fetch_sub(1, butil::memory_order_relaxed) - 1; + } + + return total_len; } -ssize_t RdmaEndpoint::HandleCompletion(ibv_wc& wc) { - bool zerocopy = FLAGS_rdma_recv_zerocopy; - switch (wc.opcode) { - case IBV_WC_SEND: { // send completion - if (0 == wc.wr_id) { - _sq_imm_window_size += 1; - // If there are any unacknowledged recvs, send an ack. - SendAck(0); - return 0; - } - // Update SQ window. - uint16_t wnd_to_update = wc.wr_id; - for (uint16_t i = 0; i < wnd_to_update; ++i) { - _sbuf[_sq_sent++].clear(); - if (_sq_sent == _sq_size - RESERVED_WR_NUM) { - _sq_sent = 0; - } - } - butil::subtle::MemoryBarrier(); - - _sq_window_size.fetch_add(wnd_to_update, butil::memory_order_relaxed); - if (_remote_rq_window_size.load(butil::memory_order_relaxed) >= - _local_window_capacity / 8) { - // Do not wake up writing thread right after polling IBV_WC_SEND. - // Otherwise the writing thread may switch to background too quickly. - _socket->WakeAsEpollOut(); - } - return 0; - } - case IBV_WC_RECV: { // recv completion - // Please note that only the first wc.byte_len bytes is valid - if (wc.byte_len > 0) { - if (wc.byte_len < (uint32_t)FLAGS_rdma_zerocopy_min_size) { - zerocopy = false; - } - CHECK_NE(_state.load(butil::memory_order_relaxed), FALLBACK_TCP); - if (zerocopy) { - _rbuf[_rq_received].cutn(&_socket->_read_buf, wc.byte_len); - } else { - // Copy data when the receive data is really small - _socket->_read_buf.append(_rbuf_data[_rq_received], wc.byte_len); - } - } - if (0 != (wc.wc_flags & IBV_WC_WITH_IMM) && wc.imm_data > 0) { - // Update window - uint32_t acks = butil::NetToHost32(wc.imm_data); - uint32_t wnd_thresh = _local_window_capacity / 8; - uint32_t remote_rq_window_size = - _remote_rq_window_size.fetch_add(acks, butil::memory_order_relaxed); - if (_sq_window_size.load(butil::memory_order_relaxed) > 0 && - (remote_rq_window_size >= wnd_thresh || acks >= wnd_thresh)) { - // Do not wake up writing thread right after _remote_rq_window_size > 0. - // Otherwise the writing thread may switch to background too quickly. - _socket->WakeAsEpollOut(); - } - } - // We must re-post recv WR - if (PostRecv(1, zerocopy) < 0) { - return -1; - } - if (wc.byte_len > 0) { - SendAck(1); - } - return wc.byte_len; - } - default: - // Some driver bugs may lead to unexpected completion opcode. - // If this happens, please update your driver. - CHECK(false) << "This should not happen. Got a completion with opcode=" - << wc.opcode; - return -1; - } - return 0; +int RdmaEndpoint::SendAck(int num) { + if (_new_rq_wrs.fetch_add(num, butil::memory_order_relaxed) > + _remote_window_capacity / 2 && + _sq_imm_window_size > 0) { + return SendImm(_new_rq_wrs.exchange(0, butil::memory_order_relaxed)); + } + return 0; } -int RdmaEndpoint::DoPostRecv(void* block, size_t block_size) { - ibv_recv_wr wr; - memset(&wr, 0, sizeof(wr)); - ibv_sge sge; - sge.addr = (uint64_t)block; - sge.length = block_size; - sge.lkey = GetRegionId(block); - wr.num_sge = 1; - wr.sg_list = &sge; - - ibv_recv_wr* bad = nullptr; - int err = ibv_post_recv(_resource->qp, &wr, &bad); - if (err != 0) { - LOG(WARNING) << "Fail to ibv_post_recv: " << berror(err); - return -1; - } +int RdmaEndpoint::SendImm(uint32_t imm) { + if (imm == 0) { return 0; + } + + ibv_send_wr wr; + memset(&wr, 0, sizeof(wr)); + wr.opcode = IBV_WR_SEND_WITH_IMM; + wr.imm_data = butil::HostToNet32(imm); + wr.send_flags |= IBV_SEND_SOLICITED | IBV_SEND_SIGNALED; + wr.wr_id = 0; + + ibv_send_wr *bad = nullptr; + int err = ibv_post_send(_resource->qp, &wr, &bad); + if (err != 0) { + std::ostringstream oss; + DebugInfo(oss, ", "); + // We use other way to guarantee the Send Queue is not full. + // So we just consider this error as an unrecoverable error. + LOG(WARNING) << "Fail to ibv_post_send: " << berror(err) << " " + << oss.str(); + return -1; + } + + // `_sq_imm_window_size' will never be negative. + // Because IMM can only be sent if + // `_sq_imm_window_size` is greater than 0. + _sq_imm_window_size -= 1; + return 0; } -int RdmaEndpoint::PostRecv(uint32_t num, bool zerocopy) { - // We do the post repeatedly from the _rbuf[_rq_received]. - while (num > 0) { - if (zerocopy) { - _rbuf[_rq_received].clear(); - butil::IOBufAsZeroCopyOutputStream os(&_rbuf[_rq_received], - g_rdma_recv_block_size + IOBUF_BLOCK_HEADER_LEN); - int size = 0; - if (!os.Next(&_rbuf_data[_rq_received], &size)) { - // Memory is not enough for preparing a block - PLOG(WARNING) << "Fail to allocate rbuf"; - return -1; - } else { - CHECK_EQ(static_cast(size), g_rdma_recv_block_size); - } - } - if (DoPostRecv(_rbuf_data[_rq_received], g_rdma_recv_block_size) < 0) { - _rbuf[_rq_received].clear(); - return -1; - } - --num; - ++_rq_received; - if (_rq_received == _rq_size) { - _rq_received = 0; - } - }; +ssize_t RdmaEndpoint::HandleCompletion(ibv_wc &wc) { + bool zerocopy = FLAGS_rdma_recv_zerocopy; + switch (wc.opcode) { + case IBV_WC_SEND: { // send completion + if (0 == wc.wr_id) { + _sq_imm_window_size += 1; + // If there are any unacknowledged recvs, send an ack. + SendAck(0); + return 0; + } + // Update SQ window. + uint16_t wnd_to_update = wc.wr_id; + for (uint16_t i = 0; i < wnd_to_update; ++i) { + _sbuf[_sq_sent++].clear(); + if (_sq_sent == _sq_size - RESERVED_WR_NUM) { + _sq_sent = 0; + } + } + butil::subtle::MemoryBarrier(); + + _sq_window_size.fetch_add(wnd_to_update, butil::memory_order_relaxed); + if (_remote_rq_window_size.load(butil::memory_order_relaxed) >= + _local_window_capacity / 8) { + // Do not wake up writing thread right after polling IBV_WC_SEND. + // Otherwise the writing thread may switch to background too quickly. + _socket->WakeAsEpollOut(); + } return 0; + } + case IBV_WC_RECV: { // recv completion + // Please note that only the first wc.byte_len bytes is valid + if (wc.byte_len > 0) { + if (wc.byte_len < (uint32_t)FLAGS_rdma_zerocopy_min_size) { + zerocopy = false; + } + if (zerocopy) { + _rbuf[_rq_received].cutn(&_socket->_read_buf, wc.byte_len); + } else { + // Copy data when the receive data is really small + _socket->_read_buf.append(_rbuf_data[_rq_received], wc.byte_len); + } + } + if (0 != (wc.wc_flags & IBV_WC_WITH_IMM) && wc.imm_data > 0) { + // Update window + uint32_t acks = butil::NetToHost32(wc.imm_data); + uint32_t wnd_thresh = _local_window_capacity / 8; + uint32_t remote_rq_window_size = + _remote_rq_window_size.fetch_add(acks, butil::memory_order_relaxed); + if (_sq_window_size.load(butil::memory_order_relaxed) > 0 && + (remote_rq_window_size >= wnd_thresh || acks >= wnd_thresh)) { + // Do not wake up writing thread right after _remote_rq_window_size > 0. + // Otherwise the writing thread may switch to background too quickly. + _socket->WakeAsEpollOut(); + } + } + // We must re-post recv WR + if (PostRecv(1, zerocopy) < 0) { + return -1; + } + if (wc.byte_len > 0) { + SendAck(1); + } + return wc.byte_len; + } + default: + // Some driver bugs may lead to unexpected completion opcode. + // If this happens, please update your driver. + CHECK(false) << "This should not happen. Got a completion with opcode=" + << wc.opcode; + return -1; + } + return 0; } -static ibv_qp* AllocateQp(ibv_cq* send_cq, ibv_cq* recv_cq, uint32_t sq_size, uint32_t rq_size) { - ibv_qp_init_attr attr; - memset(&attr, 0, sizeof(attr)); - attr.send_cq = send_cq; - attr.recv_cq = recv_cq; - attr.cap.max_send_wr = sq_size; - attr.cap.max_recv_wr = rq_size; - attr.cap.max_send_sge = GetRdmaMaxSge(); - attr.cap.max_recv_sge = 1; - attr.qp_type = IBV_QPT_RC; - return IbvCreateQp(GetRdmaPd(), &attr); +int RdmaEndpoint::DoPostRecv(void *block, size_t block_size) { + ibv_recv_wr wr; + memset(&wr, 0, sizeof(wr)); + ibv_sge sge; + sge.addr = (uint64_t)block; + sge.length = block_size; + sge.lkey = GetRegionId(block); + wr.num_sge = 1; + wr.sg_list = &sge; + + ibv_recv_wr *bad = nullptr; + int err = ibv_post_recv(_resource->qp, &wr, &bad); + if (err != 0) { + LOG(WARNING) << "Fail to ibv_post_recv: " << berror(err); + return -1; + } + return 0; } -static RdmaResource* AllocateQpCq(uint16_t sq_size, uint16_t rq_size) { - std::unique_ptr resource(new RdmaResource); - if (!FLAGS_rdma_use_polling) { - resource->comp_channel = IbvCreateCompChannel(GetRdmaContext()); - if (nullptr == resource->comp_channel) { - PLOG(WARNING) << "Fail to create comp channel for CQ"; - return nullptr; - } - - if (butil::make_close_on_exec(resource->comp_channel->fd) < 0) { - PLOG(WARNING) << "Fail to set comp channel close-on-exec"; - return nullptr; - } - if (butil::make_non_blocking(resource->comp_channel->fd) < 0) { - PLOG(WARNING) << "Fail to set comp channel nonblocking"; - return nullptr; - } - - resource->send_cq = IbvCreateCq(GetRdmaContext(), FLAGS_rdma_prepared_qp_size, - nullptr, resource->comp_channel, GetRdmaCompVector()); - if (nullptr == resource->send_cq) { - PLOG(WARNING) << "Fail to create send CQ"; - return nullptr; - } - - resource->recv_cq = IbvCreateCq(GetRdmaContext(), FLAGS_rdma_prepared_qp_size, - nullptr, resource->comp_channel, GetRdmaCompVector()); - if (nullptr == resource->recv_cq) { - PLOG(WARNING) << "Fail to create recv CQ"; - return nullptr; - } - - resource->qp = AllocateQp(resource->send_cq, resource->recv_cq, sq_size, rq_size); - if (nullptr == resource->qp) { - PLOG(WARNING) << "Fail to create QP"; - return nullptr; - } - } else { - resource->polling_cq = - IbvCreateCq(GetRdmaContext(), 2 * FLAGS_rdma_prepared_qp_size, nullptr, nullptr, 0); - if (nullptr == resource->polling_cq) { - PLOG(WARNING) << "Fail to create polling CQ"; - return nullptr; - } - resource->qp = AllocateQp(resource->polling_cq, - resource->polling_cq, - sq_size, rq_size); - if (nullptr == resource->qp) { - PLOG(WARNING) << "Fail to create QP"; - return nullptr; - } +int RdmaEndpoint::PostRecv(uint32_t num, bool zerocopy) { + // We do the post repeatedly from the _rbuf[_rq_received]. + while (num > 0) { + if (zerocopy) { + _rbuf[_rq_received].clear(); + butil::IOBufAsZeroCopyOutputStream os(&_rbuf[_rq_received], + g_rdma_recv_block_size + + IOBUF_BLOCK_HEADER_LEN); + int size = 0; + if (!os.Next(&_rbuf_data[_rq_received], &size)) { + // Memory is not enough for preparing a block + PLOG(WARNING) << "Fail to allocate rbuf"; + return -1; + } else { + CHECK_EQ(static_cast(size), g_rdma_recv_block_size); + } } - - return resource.release(); -} - -int RdmaEndpoint::AllocateResources() { - if (DoAllocateResources() == 0) { - return 0; + if (DoPostRecv(_rbuf_data[_rq_received], g_rdma_recv_block_size) < 0) { + _rbuf[_rq_received].clear(); + return -1; + } + --num; + ++_rq_received; + if (_rq_received == _rq_size) { + _rq_received = 0; } + }; + return 0; +} - const int saved_errno = errno; - DeallocateResources(); - _sbuf.clear(); - _rbuf.clear(); - _rbuf_data.clear(); - errno = saved_errno; - return -1; +static ibv_qp *AllocateQp(ibv_cq *send_cq, ibv_cq *recv_cq, uint32_t sq_size, + uint32_t rq_size) { + ibv_qp_init_attr attr; + memset(&attr, 0, sizeof(attr)); + attr.send_cq = send_cq; + attr.recv_cq = recv_cq; + attr.cap.max_send_wr = sq_size; + attr.cap.max_recv_wr = rq_size; + attr.cap.max_send_sge = GetRdmaMaxSge(); + attr.cap.max_recv_sge = 1; + attr.qp_type = IBV_QPT_RC; + return IbvCreateQp(GetRdmaPd(), &attr); } -int RdmaEndpoint::DoAllocateResources() { - if (BAIDU_UNLIKELY(g_skip_rdma_init)) { - // For UT - if (BAIDU_UNLIKELY(g_fail_resource_alloc_for_test)) { - errno = EINVAL; - return -1; - } - return 0; +static RdmaResource *AllocateQpCq(uint16_t sq_size, uint16_t rq_size) { + std::unique_ptr resource(new RdmaResource); + if (!FLAGS_rdma_use_polling) { + resource->comp_channel = IbvCreateCompChannel(GetRdmaContext()); + if (nullptr == resource->comp_channel) { + PLOG(WARNING) << "Fail to create comp channel for CQ"; + return nullptr; } - CHECK(_resource == nullptr); - - if (_sq_size <= FLAGS_rdma_prepared_qp_size && - _rq_size <= FLAGS_rdma_prepared_qp_size) { - BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); - if (g_rdma_resource_list) { - _resource = g_rdma_resource_list; - g_rdma_resource_list = g_rdma_resource_list->next; - } + if (butil::make_close_on_exec(resource->comp_channel->fd) < 0) { + PLOG(WARNING) << "Fail to set comp channel close-on-exec"; + return nullptr; } - if (!_resource) { - _resource = AllocateQpCq(_sq_size, _rq_size); - } else { - _resource->next = nullptr; - } - if (!_resource) { - return -1; + if (butil::make_non_blocking(resource->comp_channel->fd) < 0) { + PLOG(WARNING) << "Fail to set comp channel nonblocking"; + return nullptr; } - if (!FLAGS_rdma_use_polling) { - if (0 != ReqNotifyCq(true, false)) { - return -1; - } - if (0 != ReqNotifyCq(false, false)) { - return -1; - } + resource->send_cq = + IbvCreateCq(GetRdmaContext(), FLAGS_rdma_prepared_qp_size, nullptr, + resource->comp_channel, GetRdmaCompVector()); + if (nullptr == resource->send_cq) { + PLOG(WARNING) << "Fail to create send CQ"; + return nullptr; + } - SocketOptions options; - options.user = this; - options.keytable_pool = _socket->_keytable_pool; - options.fd = _resource->comp_channel->fd; - options.on_edge_triggered_events = PollCq; - if (Socket::Create(options, &_cq_sid) < 0) { - PLOG(WARNING) << "Fail to create socket for cq"; - return -1; - } - } else { - SocketOptions options; - options.user = this; - options.keytable_pool = _socket->_keytable_pool; - if (Socket::Create(options, &_cq_sid) < 0) { - PLOG(WARNING) << "Fail to create socket for cq"; - return -1; - } - PollerAddCqSid(); + resource->recv_cq = + IbvCreateCq(GetRdmaContext(), FLAGS_rdma_prepared_qp_size, nullptr, + resource->comp_channel, GetRdmaCompVector()); + if (nullptr == resource->recv_cq) { + PLOG(WARNING) << "Fail to create recv CQ"; + return nullptr; } - _sbuf.resize(_sq_size - RESERVED_WR_NUM); - if (_sbuf.size() != _sq_size - RESERVED_WR_NUM) { - return -1; + resource->qp = + AllocateQp(resource->send_cq, resource->recv_cq, sq_size, rq_size); + if (nullptr == resource->qp) { + PLOG(WARNING) << "Fail to create QP"; + return nullptr; } - _rbuf.resize(_rq_size); - if (_rbuf.size() != _rq_size) { - return -1; + } else { + resource->polling_cq = IbvCreateCq( + GetRdmaContext(), 2 * FLAGS_rdma_prepared_qp_size, nullptr, nullptr, 0); + if (nullptr == resource->polling_cq) { + PLOG(WARNING) << "Fail to create polling CQ"; + return nullptr; } - _rbuf_data.resize(_rq_size, nullptr); - if (_rbuf_data.size() != _rq_size) { - return -1; + resource->qp = AllocateQp(resource->polling_cq, resource->polling_cq, + sq_size, rq_size); + if (nullptr == resource->qp) { + PLOG(WARNING) << "Fail to create QP"; + return nullptr; } + } - return 0; + return resource.release(); } -int RdmaEndpoint::BringUpQp(const ParsedHello& remote, bool is_server) { - if (BAIDU_UNLIKELY(g_skip_rdma_init)) { - // For UT - return 0; - } - - ibv_qp_attr attr; - - attr.qp_state = IBV_QPS_INIT; - attr.pkey_index = 0; // TODO: support more pkey use in future - attr.port_num = GetRdmaPortNum(); - attr.qp_access_flags = IBV_ACCESS_REMOTE_WRITE; - int err = IbvModifyQp(_resource->qp, &attr, (ibv_qp_attr_mask)( - IBV_QP_STATE | - IBV_QP_PKEY_INDEX | - IBV_QP_PORT | - IBV_QP_ACCESS_FLAGS)); - if (err != 0) { - LOG(WARNING) << "Fail to modify QP from RESET to INIT: " << berror(err); - return -1; - } - - // ECE negotiation, done while the QP is in INIT state (must be set - // before the RTR transition). - // - // End-to-end model: - // Server: `remote->ece' is the client's queried ECE; set it here, - // then after RTS we query the reduced/negotiated ECE and - // send it back in the server hello. - // Client: `remote->ece' is the server's reduced ECE; - // just set it here. - bool use_ece = true; - if (IbvSetEce != nullptr && remote.ece.has_value()) { - ibv_ece ece = *remote.ece; - int err = IbvSetEce(_resource->qp, &ece); - if (err != 0) { - use_ece = false; - LOG(WARNING) << "Fail to IbvSetEce, continue without ECE: " - << berror(err); - } - } +int RdmaEndpoint::AllocateResources() { + if (DoAllocateResources() == 0) { + return 0; + } + + const int saved_errno = errno; + DeallocateResources(); + _sbuf.clear(); + _rbuf.clear(); + _rbuf_data.clear(); + errno = saved_errno; + return -1; +} - if (PostRecv(_rq_size, true) < 0) { - PLOG(WARNING) << "Fail to post recv wr"; - return -1; +int RdmaEndpoint::DoAllocateResources() { + if (BAIDU_UNLIKELY(g_skip_rdma_init)) { + // For UT + if (BAIDU_UNLIKELY(g_fail_resource_alloc_for_test)) { + errno = EINVAL; + return -1; } + return 0; + } + + CHECK(_resource == nullptr); + + if (_sq_size <= FLAGS_rdma_prepared_qp_size && + _rq_size <= FLAGS_rdma_prepared_qp_size) { + BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); + if (g_rdma_resource_list) { + _resource = g_rdma_resource_list; + g_rdma_resource_list = g_rdma_resource_list->next; + } + } + if (!_resource) { + _resource = AllocateQpCq(_sq_size, _rq_size); + } else { + _resource->next = nullptr; + } + if (!_resource) { + return -1; + } + + if (!FLAGS_rdma_use_polling) { + if (0 != ReqNotifyCq(true, false)) { + return -1; + } + if (0 != ReqNotifyCq(false, false)) { + return -1; + } + + SocketOptions options; + options.user = this; + options.keytable_pool = _socket->_keytable_pool; + options.fd = _resource->comp_channel->fd; + options.on_edge_triggered_events = PollCq; + if (Socket::Create(options, &_cq_sid) < 0) { + PLOG(WARNING) << "Fail to create socket for cq"; + return -1; + } + } else { + SocketOptions options; + options.user = this; + options.keytable_pool = _socket->_keytable_pool; + if (Socket::Create(options, &_cq_sid) < 0) { + PLOG(WARNING) << "Fail to create socket for cq"; + return -1; + } + PollerAddCqSid(); + } + + _sbuf.resize(_sq_size - RESERVED_WR_NUM); + if (_sbuf.size() != _sq_size - RESERVED_WR_NUM) { + return -1; + } + _rbuf.resize(_rq_size); + if (_rbuf.size() != _rq_size) { + return -1; + } + _rbuf_data.resize(_rq_size, nullptr); + if (_rbuf_data.size() != _rq_size) { + return -1; + } - attr.qp_state = IBV_QPS_RTR; - attr.path_mtu = IBV_MTU_1024; // TODO: support more mtu in future - attr.ah_attr.grh.dgid = remote.gid; - attr.ah_attr.grh.flow_label = 0; - attr.ah_attr.grh.sgid_index = GetRdmaGidIndex(); - attr.ah_attr.grh.hop_limit = MAX_HOP_LIMIT; - attr.ah_attr.grh.traffic_class = 0; - attr.ah_attr.dlid = remote.lid; - attr.ah_attr.sl = 0; - attr.ah_attr.src_path_bits = 0; - attr.ah_attr.static_rate = 0; - attr.ah_attr.is_global = 1; - attr.ah_attr.port_num = GetRdmaPortNum(); - attr.dest_qp_num = remote.qp_num; - attr.rq_psn = 0; - attr.max_dest_rd_atomic = 0; - attr.min_rnr_timer = 0; // We do not allow rnr error - err = IbvModifyQp(_resource->qp, &attr, (ibv_qp_attr_mask)( - IBV_QP_STATE | - IBV_QP_PATH_MTU | - IBV_QP_MIN_RNR_TIMER | - IBV_QP_AV | - IBV_QP_MAX_DEST_RD_ATOMIC | - IBV_QP_DEST_QPN | - IBV_QP_RQ_PSN)); - if (err != 0) { - LOG(WARNING) << "Fail to modify QP from INIT to RTR: " << berror(err); - return -1; - } + return 0; +} - attr.qp_state = IBV_QPS_RTS; - attr.timeout = TIMEOUT; - attr.retry_cnt = RETRY_CNT; - attr.rnr_retry = 0; // We do not allow rnr error - attr.sq_psn = 0; - attr.max_rd_atomic = 0; - err = IbvModifyQp(_resource->qp, &attr, (ibv_qp_attr_mask)( - IBV_QP_STATE | - IBV_QP_RNR_RETRY | - IBV_QP_RETRY_CNT | - IBV_QP_TIMEOUT | - IBV_QP_SQ_PSN | - IBV_QP_MAX_QP_RD_ATOMIC)); +int RdmaEndpoint::BringUpQp(const RdmaConnectionInfo &remote, bool is_server) { + if (BAIDU_UNLIKELY(g_skip_rdma_init)) { + // For UT + return 0; + } + + ibv_qp_attr attr; + + attr.qp_state = IBV_QPS_INIT; + attr.pkey_index = 0; // TODO: support more pkey use in future + attr.port_num = GetRdmaPortNum(); + attr.qp_access_flags = IBV_ACCESS_REMOTE_WRITE; + int err = IbvModifyQp(_resource->qp, &attr, + (ibv_qp_attr_mask)(IBV_QP_STATE | IBV_QP_PKEY_INDEX | + IBV_QP_PORT | IBV_QP_ACCESS_FLAGS)); + if (err != 0) { + LOG(WARNING) << "Fail to modify QP from RESET to INIT: " << berror(err); + return -1; + } + + // ECE negotiation, done while the QP is in INIT state (must be set + // before the RTR transition). + // + // End-to-end model: + // Server: `remote->ece' is the client's queried ECE; set it here, + // then after RTS we query the reduced/negotiated ECE and + // return it in the server negotiation response. + // Client: `remote->ece' is the server's reduced ECE; + // just set it here. + bool use_ece = true; + if (IbvSetEce != nullptr && remote.ece.has_value()) { + ibv_ece ece = *remote.ece; + int err = IbvSetEce(_resource->qp, &ece); if (err != 0) { - LOG(WARNING) << "Fail to modify QP from RTR to RTS: " << berror(err); - return -1; + use_ece = false; + LOG(WARNING) << "Fail to IbvSetEce, continue without ECE: " + << berror(err); } + } - // On the server side, now that the QP reached RTS, query the reduced/negotiated - // ECE (the subset of enhancements supported by both peers) so it can be returned - // to the client in the server hello. - if (is_server && use_ece && IbvQueryEce != nullptr && remote.ece.has_value()) { - ibv_ece ece; - int qerr = IbvQueryEce(_resource->qp, &ece); - if (qerr == 0) { - _outgoing_ece = ece; - } else { - LOG(WARNING) << "Fail to IbvQueryEce(negotiated), " - "continue without ECE: " << berror(qerr); - } + if (PostRecv(_rq_size, true) < 0) { + PLOG(WARNING) << "Fail to post recv wr"; + return -1; + } + + attr.qp_state = IBV_QPS_RTR; + attr.path_mtu = IBV_MTU_1024; // TODO: support more mtu in future + attr.ah_attr.grh.dgid = remote.gid; + attr.ah_attr.grh.flow_label = 0; + attr.ah_attr.grh.sgid_index = GetRdmaGidIndex(); + attr.ah_attr.grh.hop_limit = MAX_HOP_LIMIT; + attr.ah_attr.grh.traffic_class = 0; + attr.ah_attr.dlid = remote.lid; + attr.ah_attr.sl = 0; + attr.ah_attr.src_path_bits = 0; + attr.ah_attr.static_rate = 0; + attr.ah_attr.is_global = 1; + attr.ah_attr.port_num = GetRdmaPortNum(); + attr.dest_qp_num = remote.qp_num; + attr.rq_psn = 0; + attr.max_dest_rd_atomic = 0; + attr.min_rnr_timer = 0; // We do not allow rnr error + err = IbvModifyQp(_resource->qp, &attr, + (ibv_qp_attr_mask)(IBV_QP_STATE | IBV_QP_PATH_MTU | + IBV_QP_MIN_RNR_TIMER | IBV_QP_AV | + IBV_QP_MAX_DEST_RD_ATOMIC | + IBV_QP_DEST_QPN | IBV_QP_RQ_PSN)); + if (err != 0) { + LOG(WARNING) << "Fail to modify QP from INIT to RTR: " << berror(err); + return -1; + } + + attr.qp_state = IBV_QPS_RTS; + attr.timeout = TIMEOUT; + attr.retry_cnt = RETRY_CNT; + attr.rnr_retry = 0; // We do not allow rnr error + attr.sq_psn = 0; + attr.max_rd_atomic = 0; + err = + IbvModifyQp(_resource->qp, &attr, + (ibv_qp_attr_mask)(IBV_QP_STATE | IBV_QP_RNR_RETRY | + IBV_QP_RETRY_CNT | IBV_QP_TIMEOUT | + IBV_QP_SQ_PSN | IBV_QP_MAX_QP_RD_ATOMIC)); + if (err != 0) { + LOG(WARNING) << "Fail to modify QP from RTR to RTS: " << berror(err); + return -1; + } + + // On the server side, now that the QP reached RTS, query the + // reduced/negotiated ECE (the subset of enhancements supported by both peers) + // so it can be returned to the client in the server hello. + if (is_server && use_ece && IbvQueryEce != nullptr && + remote.ece.has_value()) { + ibv_ece ece; + int qerr = IbvQueryEce(_resource->qp, &ece); + if (qerr == 0) { + _outgoing_ece = ece; + } else { + LOG(WARNING) << "Fail to IbvQueryEce(negotiated), " + "continue without ECE: " + << berror(qerr); } + } - return 0; + return 0; } -static void DeallocateCq(ibv_cq* cq) { - if (nullptr == cq) { - return; - } +static void DeallocateCq(ibv_cq *cq) { + if (nullptr == cq) { + return; + } - int err = IbvDestroyCq(cq); - LOG_IF(WARNING, 0 != err) << "Fail to destroy CQ: " << berror(err); + int err = IbvDestroyCq(cq); + LOG_IF(WARNING, 0 != err) << "Fail to destroy CQ: " << berror(err); } -static int DrainCq(ibv_cq* cq) { - if (nullptr == cq) { - return 0; - } +static int DrainCq(ibv_cq *cq) { + if (nullptr == cq) { + return 0; + } - ibv_wc wc; - int ret; - do { - ret = ibv_poll_cq(cq, 1, &wc); - } while (ret > 0); + ibv_wc wc; + int ret; + do { + ret = ibv_poll_cq(cq, 1, &wc); + } while (ret > 0); - LOG_IF(ERROR, ret < 0) << "drain CQ failed: " << ret; - return ret; + LOG_IF(ERROR, ret < 0) << "drain CQ failed: " << ret; + return ret; } void RdmaEndpoint::DeallocateResources() { - if (!_resource) { - return; - } - if (FLAGS_rdma_use_polling) { - PollerRemoveCqSid(); - } - bool move_to_rdma_resource_list = false; - if (_sq_size <= FLAGS_rdma_prepared_qp_size && - _rq_size <= FLAGS_rdma_prepared_qp_size && - FLAGS_rdma_prepared_qp_cnt > 0) { - ibv_qp_attr attr; - attr.qp_state = IBV_QPS_RESET; - if (IbvModifyQp(_resource->qp, &attr, IBV_QP_STATE) == 0) { - move_to_rdma_resource_list = true; - } + if (!_resource) { + return; + } + if (FLAGS_rdma_use_polling) { + PollerRemoveCqSid(); + } + bool move_to_rdma_resource_list = false; + if (_sq_size <= FLAGS_rdma_prepared_qp_size && + _rq_size <= FLAGS_rdma_prepared_qp_size && + FLAGS_rdma_prepared_qp_cnt > 0) { + ibv_qp_attr attr; + attr.qp_state = IBV_QPS_RESET; + if (IbvModifyQp(_resource->qp, &attr, IBV_QP_STATE) == 0) { + move_to_rdma_resource_list = true; } + } - if (nullptr != _resource->send_cq) { - IbvAckCqEvents(_resource->send_cq, _send_cq_events); - } - if (nullptr != _resource->recv_cq) { - IbvAckCqEvents(_resource->recv_cq, _recv_cq_events); - } + if (nullptr != _resource->send_cq) { + IbvAckCqEvents(_resource->send_cq, _send_cq_events); + } + if (nullptr != _resource->recv_cq) { + IbvAckCqEvents(_resource->recv_cq, _recv_cq_events); + } - bool remove_consumer = true; + bool remove_consumer = true; _reclaim: - if (!move_to_rdma_resource_list) { - if (nullptr != _resource->qp) { - int err = IbvDestroyQp(_resource->qp); - LOG_IF(WARNING, 0 != err) << "Fail to destroy QP: " << berror(err); - _resource->qp = nullptr; - } - - DeallocateCq(_resource->polling_cq); - DeallocateCq(_resource->send_cq); - DeallocateCq(_resource->recv_cq); - - if (nullptr != _resource->comp_channel) { - // Destroy send_comp_channel will destroy this fd, - // so that we should remove it from epoll fd first - int fd = _resource->comp_channel->fd; - GetGlobalEventDispatcher(fd, _socket->_io_event.bthread_tag()).RemoveConsumer(fd); - remove_consumer = false; - int err = IbvDestroyCompChannel(_resource->comp_channel); - LOG_IF(WARNING, 0 != err) << "Fail to destroy CQ channel: " << berror(err); - - } - - _resource->polling_cq = nullptr; - _resource->send_cq = nullptr; - _resource->recv_cq = nullptr; - _resource->comp_channel = nullptr; - delete _resource; - _resource = nullptr; - } + if (!move_to_rdma_resource_list) { + if (nullptr != _resource->qp) { + int err = IbvDestroyQp(_resource->qp); + LOG_IF(WARNING, 0 != err) << "Fail to destroy QP: " << berror(err); + _resource->qp = nullptr; + } + + DeallocateCq(_resource->polling_cq); + DeallocateCq(_resource->send_cq); + DeallocateCq(_resource->recv_cq); + + if (nullptr != _resource->comp_channel) { + // Destroy send_comp_channel will destroy this fd, + // so that we should remove it from epoll fd first + int fd = _resource->comp_channel->fd; + GetGlobalEventDispatcher(fd, _socket->_io_event.bthread_tag()) + .RemoveConsumer(fd); + remove_consumer = false; + int err = IbvDestroyCompChannel(_resource->comp_channel); + LOG_IF(WARNING, 0 != err) + << "Fail to destroy CQ channel: " << berror(err); + } + + _resource->polling_cq = nullptr; + _resource->send_cq = nullptr; + _resource->recv_cq = nullptr; + _resource->comp_channel = nullptr; + delete _resource; + _resource = nullptr; + } - if (INVALID_SOCKET_ID != _cq_sid) { - SocketUniquePtr s; - if (Socket::Address(_cq_sid, &s) == 0) { - if (remove_consumer) { - s->_io_event.RemoveConsumer(s->_fd); - } - s->_user = nullptr; // Do not release user (this RdmaEndpoint). - s->_fd = -1; // Already remove fd from epoll fd. - s->SetFailed(); - } + if (INVALID_SOCKET_ID != _cq_sid) { + SocketUniquePtr s; + if (Socket::Address(_cq_sid, &s) == 0) { + if (remove_consumer) { + s->_io_event.RemoveConsumer(s->_fd); + } + s->_user = nullptr; // Do not release user (this RdmaEndpoint). + s->_fd = -1; // Already remove fd from epoll fd. + s->SetFailed(); + } + } + + if (move_to_rdma_resource_list) { + // When a QP is moved to the RESET state, all associated send and + // receive queues are flushed, meaning any outstanding WRs are effectively + // abandoned by the hardware. + // + // However, the CQ associated with that QP is *not* cleared automatically, + // meaning that it will still contain entries for WRs that completed before + // the reset. + // + // The application should finish polling the CQ to remove these obsolete + // entries before reusing the QP. + int ret = DrainCq(_resource->polling_cq); + ret += DrainCq(_resource->send_cq); + ret += DrainCq(_resource->recv_cq); + if (ret < 0) { + move_to_rdma_resource_list = false; + goto _reclaim; } - if (move_to_rdma_resource_list) { - // When a QP is moved to the RESET state, all associated send and - // receive queues are flushed, meaning any outstanding WRs are effectively - // abandoned by the hardware. - // - // However, the CQ associated with that QP is *not* cleared automatically, - // meaning that it will still contain entries for WRs that completed before - // the reset. - // - // The application should finish polling the CQ to remove these obsolete - // entries before reusing the QP. - int ret = DrainCq(_resource->polling_cq); - ret += DrainCq(_resource->send_cq); - ret += DrainCq(_resource->recv_cq); - if (ret < 0) { - move_to_rdma_resource_list = false; - goto _reclaim; - } - - { - BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); - _resource->next = g_rdma_resource_list; - g_rdma_resource_list = _resource; - } - _resource = nullptr; + { + BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); + _resource->next = g_rdma_resource_list; + g_rdma_resource_list = _resource; } - - // Detach everything from this endpoint so that the function is - // idempotent: it is called both when the endpoint is reset/destroyed - // and when AllocateResources() fails halfway. - _cq_sid = INVALID_SOCKET_ID; - _send_cq_events = 0; - _recv_cq_events = 0; + _resource = nullptr; + } + + // Detach everything from this endpoint so that the function is + // idempotent: it is called both when the endpoint is reset/destroyed + // and when AllocateResources() fails halfway. + _cq_sid = INVALID_SOCKET_ID; + _send_cq_events = 0; + _recv_cq_events = 0; } static const int MAX_CQ_EVENTS = 128; -int RdmaEndpoint::GetAndAckEvents(SocketUniquePtr& s) { - void* context = nullptr; - ibv_cq* cq = nullptr; - while (true) { - if (IbvGetCqEvent(_resource->comp_channel, &cq, &context) != 0) { - if (errno != EAGAIN) { - const int saved_errno = errno; - PLOG(ERROR) << "Fail to get cq event from " << s->description(); - s->SetFailed(saved_errno, "Fail to get cq event from %s: %s", - s->description().c_str(), berror(saved_errno)); - return -1; - } - break; - } - if (cq == _resource->send_cq) { - ++_send_cq_events; - } else if (cq == _resource->recv_cq) { - ++_recv_cq_events; - } else { - // Unexpected CQ event that does not belong to - // this endpoint's send/recv CQs. - LOG(WARNING) << "Unexpected CQ event from cq=" << cq - << " of " << s->description(); - // Acknowledge this single event immediately - // to avoid leaking unacknowledged events. - IbvAckCqEvents(cq, 1); - } - } - if (_send_cq_events >= MAX_CQ_EVENTS) { - IbvAckCqEvents(_resource->send_cq, _send_cq_events); - _send_cq_events = 0; - } - if (_recv_cq_events >= MAX_CQ_EVENTS) { - IbvAckCqEvents(_resource->recv_cq, _recv_cq_events); - _recv_cq_events = 0; +int RdmaEndpoint::GetAndAckEvents(SocketUniquePtr &s) { + void *context = nullptr; + ibv_cq *cq = nullptr; + while (true) { + if (IbvGetCqEvent(_resource->comp_channel, &cq, &context) != 0) { + if (errno != EAGAIN) { + const int saved_errno = errno; + PLOG(ERROR) << "Fail to get cq event from " << s->description(); + s->SetFailed(saved_errno, "Fail to get cq event from %s: %s", + s->description().c_str(), berror(saved_errno)); + return -1; + } + break; } - return 0; + if (cq == _resource->send_cq) { + ++_send_cq_events; + } else if (cq == _resource->recv_cq) { + ++_recv_cq_events; + } else { + // Unexpected CQ event that does not belong to + // this endpoint's send/recv CQs. + LOG(WARNING) << "Unexpected CQ event from cq=" << cq << " of " + << s->description(); + // Acknowledge this single event immediately + // to avoid leaking unacknowledged events. + IbvAckCqEvents(cq, 1); + } + } + if (_send_cq_events >= MAX_CQ_EVENTS) { + IbvAckCqEvents(_resource->send_cq, _send_cq_events); + _send_cq_events = 0; + } + if (_recv_cq_events >= MAX_CQ_EVENTS) { + IbvAckCqEvents(_resource->recv_cq, _recv_cq_events); + _recv_cq_events = 0; + } + return 0; } int RdmaEndpoint::ReqNotifyCq(bool send_cq, bool fatal_on_error) { - const int err = ibv_req_notify_cq( - send_cq ? _resource->send_cq : _resource->recv_cq, - send_cq ? 0 : 1); - if (0 != err) { - errno = err; - PLOG(WARNING) << "Fail to arm " << (send_cq ? "send" : "recv") - << " CQ comp channel from " << _socket->description(); - if (fatal_on_error) { - _socket->SetFailed(err, "Fail to arm %s CQ channel from %s: %s", - send_cq ? "send" : "recv", _socket->description().c_str(), - berror(err)); - } - // The logging and SetFailed() above may clobber errno. - errno = err; - return -1; - } + const int err = ibv_req_notify_cq( + send_cq ? _resource->send_cq : _resource->recv_cq, send_cq ? 0 : 1); + if (0 != err) { + errno = err; + PLOG(WARNING) << "Fail to arm " << (send_cq ? "send" : "recv") + << " CQ comp channel from " << _socket->description(); + if (fatal_on_error) { + _socket->SetFailed(err, "Fail to arm %s CQ channel from %s: %s", + send_cq ? "send" : "recv", + _socket->description().c_str(), berror(err)); + } + // The logging and SetFailed() above may clobber errno. + errno = err; + return -1; + } - return 0; + return 0; } -void RdmaEndpoint::PollCq(Socket* m) { - RdmaEndpoint* ep = static_cast(m->user()); - if (!ep) { +void RdmaEndpoint::PollCq(Socket *m) { + RdmaEndpoint *ep = static_cast(m->user()); + if (!ep) { + return; + } + + SocketUniquePtr s; + if (Socket::Address(ep->_socket->id(), &s) < 0) { + return; + } + RdmaTransport *rdma_transport = RdmaTransport::Get(s.get()); + CHECK(ep == rdma_transport->_rdma_ep); + + bool send = false; + ibv_cq *cq = ep->_resource->recv_cq; + + if (!FLAGS_rdma_use_polling) { + if (ep->GetAndAckEvents(s) < 0) { + return; + } + } else { + // Polling is considered as non-send, so no need to change `send'. + // Only need to poll polling_cq. + cq = ep->_resource->polling_cq; + } + + int progress = Socket::PROGRESS_INIT; + bool notified = false; + InputMessageClosure last_msg; + ibv_wc wc[FLAGS_rdma_cqe_poll_once]; + while (true) { + int cnt = ibv_poll_cq(cq, FLAGS_rdma_cqe_poll_once, wc); + if (cnt < 0) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to poll cq: " << s->description(); + s->SetFailed(saved_errno, "Fail to poll cq from %s: %s", + s->description().c_str(), berror(saved_errno)); + return; + } + if (cnt == 0) { + if (FLAGS_rdma_use_polling) { return; - } - - SocketUniquePtr s; - if (Socket::Address(ep->_socket->id(), &s) < 0) { + } + + if (!send) { + // It's send cq's turn. + send = true; + cq = ep->_resource->send_cq; + continue; + } + // `recv_cq' and `send_cq' have been polled. + if (!notified) { + // Since RDMA only provides one shot event, we have to call the + // notify function every time. Because there is a possibility + // that the event arrives after the poll but before the notify, + // we should re-poll the CQ once after the notify to check if + // there is an available CQE. + // The connection is already working in RDMA mode here, a + // failed re-arm means no more CQ event will be reported, + // which is fatal for this connection. + if (0 != ep->ReqNotifyCq(true, true)) { + return; + } + if (0 != ep->ReqNotifyCq(false, true)) { + return; + } + notified = true; + // Both CQs have just been re-armed, thus both of them must be + // re-polled. Note that `cq' is `send_cq' here, so we have to + // switch back to `recv_cq' explicitly. Otherwise only + // `send_cq' would be re-polled, and a recv CQE arriving in + // the window between the poll and the notify of `recv_cq' + // would be left in the CQ without any following event + // (one shot notification is not triggered by the CQE which + // is already in the CQ before the arming), which stalls the + // connection until the next CQE happens to come. + send = false; + cq = ep->_resource->recv_cq; + continue; + } + if (!m->MoreReadEvents(&progress)) { + break; + } + + if (0 != ep->GetAndAckEvents(s)) { return; - } - auto* rdma_transport = static_cast(s->_transport.get()); - CHECK(ep == rdma_transport->_rdma_ep); + } - bool send = false; - ibv_cq* cq = ep->_resource->recv_cq; - - if (!FLAGS_rdma_use_polling) { - if (ep->GetAndAckEvents(s) < 0) { - return; - } - } else { - // Polling is considered as non-send, so no need to change `send'. - // Only need to poll polling_cq. - cq = ep->_resource->polling_cq; + // Restart polling from `recv_cq'. + send = false; + cq = ep->_resource->recv_cq; + notified = false; + continue; } + notified = false; - int progress = Socket::PROGRESS_INIT; - bool notified = false; - InputMessageClosure last_msg; - ibv_wc wc[FLAGS_rdma_cqe_poll_once]; - while (true) { - int cnt = ibv_poll_cq(cq, FLAGS_rdma_cqe_poll_once, wc); - if (cnt < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to poll cq: " << s->description(); - s->SetFailed(saved_errno, "Fail to poll cq from %s: %s", - s->description().c_str(), berror(saved_errno)); - return; - } - if (cnt == 0) { - if (FLAGS_rdma_use_polling) { - return; - } - - if (!send) { - // It's send cq's turn. - send = true; - cq = ep->_resource->send_cq; - continue; - } - // `recv_cq' and `send_cq' have been polled. - if (!notified) { - // Since RDMA only provides one shot event, we have to call the - // notify function every time. Because there is a possibility - // that the event arrives after the poll but before the notify, - // we should re-poll the CQ once after the notify to check if - // there is an available CQE. - // The connection is already working in RDMA mode here, a - // failed re-arm means no more CQ event will be reported, - // which is fatal for this connection. - if (0 != ep->ReqNotifyCq(true, true)) { - return; - } - if (0 != ep->ReqNotifyCq(false, true)) { - return; - } - notified = true; - // Both CQs have just been re-armed, thus both of them must be - // re-polled. Note that `cq' is `send_cq' here, so we have to - // switch back to `recv_cq' explicitly. Otherwise only - // `send_cq' would be re-polled, and a recv CQE arriving in - // the window between the poll and the notify of `recv_cq' - // would be left in the CQ without any following event - // (one shot notification is not triggered by the CQE which - // is already in the CQ before the arming), which stalls the - // connection until the next CQE happens to come. - send = false; - cq = ep->_resource->recv_cq; - continue; - } - if (!m->MoreReadEvents(&progress)) { - break; - } - - if (0 != ep->GetAndAckEvents(s)) { - return; - } - - // Restart polling from `recv_cq'. - send = false; - cq = ep->_resource->recv_cq; - notified = false; - continue; - } - notified = false; - - ssize_t bytes = 0; - for (int i = 0; i < cnt; ++i) { - if (s->Failed()) { - return; - } - - if (wc[i].status != IBV_WC_SUCCESS) { - PLOG(WARNING) << "Fail to handle RDMA completion, error status(" - << wc[i].status << "): " << s->description(); - s->SetFailed(ERDMA, "RDMA completion error(%d) from %s: %s", - wc[i].status, s->description().c_str(), berror(ERDMA)); - continue; - } - - ssize_t nr = ep->HandleCompletion(wc[i]); - if (nr < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to handle RDMA completion: " << s->description(); - s->SetFailed(saved_errno, "Fail to handle rdma completion from %s: %s", - s->description().c_str(), berror(saved_errno)); - } else if (nr > 0) { - bytes += nr; - } - } - // Send CQE has no messages to process. - if (send) { - continue; - } - - // Just call PrcessNewMessage once for all of these CQEs. - // Otherwise it may call too many bthread_flush to affect performance. - const int64_t received_us = butil::cpuwide_time_us(); - const int64_t base_realtime = butil::gettimeofday_us() - received_us; - InputMessenger* messenger = static_cast(s->user()); - if (messenger->ProcessNewMessage( - s.get(), bytes, false, received_us, base_realtime, last_msg) < 0) { - return; - } + ssize_t bytes = 0; + for (int i = 0; i < cnt; ++i) { + if (s->Failed()) { + return; + } + + if (wc[i].status != IBV_WC_SUCCESS) { + PLOG(WARNING) << "Fail to handle RDMA completion, error status(" + << wc[i].status << "): " << s->description(); + s->SetFailed(ERDMA, "RDMA completion error(%d) from %s: %s", + wc[i].status, s->description().c_str(), berror(ERDMA)); + continue; + } + + ssize_t nr = ep->HandleCompletion(wc[i]); + if (nr < 0) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to handle RDMA completion: " << s->description(); + s->SetFailed(saved_errno, "Fail to handle rdma completion from %s: %s", + s->description().c_str(), berror(saved_errno)); + } else if (nr > 0) { + bytes += nr; + } + } + // Send CQE has no messages to process. + if (send) { + continue; } -} -std::string RdmaEndpoint::GetStateStr() const { - switch (_state.load(butil::memory_order_relaxed)) { - case UNINIT: return "UNINIT"; - case C_ALLOC_QPCQ: return "C_ALLOC_QPCQ"; - case C_HELLO_SEND: return "C_HELLO_SEND"; - case C_HELLO_WAIT: return "C_HELLO_WAIT"; - case C_BRINGUP_QP: return "C_BRINGUP_QP"; - case C_ACK_SEND: return "C_ACK_SEND"; - case S_HELLO_WAIT: return "S_HELLO_WAIT"; - case S_ALLOC_QPCQ: return "S_ALLOC_QPCQ"; - case S_BRINGUP_QP: return "S_BRINGUP_QP"; - case S_HELLO_SEND: return "S_HELLO_SEND"; - case S_ACK_WAIT: return "S_ACK_WAIT"; - case ESTABLISHED: return "ESTABLISHED"; - case FALLBACK_TCP: return "FALLBACK_TCP"; - case FAILED: return "FAILED"; - default: return "UNKNOWN"; + // Just call PrcessNewMessage once for all of these CQEs. + // Otherwise it may call too many bthread_flush to affect performance. + const int64_t received_us = butil::cpuwide_time_us(); + const int64_t base_realtime = butil::gettimeofday_us() - received_us; + InputMessenger *messenger = static_cast(s->user()); + if (messenger->ProcessNewMessage(s.get(), bytes, false, received_us, + base_realtime, last_msg) < 0) { + return; } + } } -void RdmaEndpoint::DebugInfo(std::ostream& os, butil::StringPiece connector) const { - os << "rdma_state=ON" - << connector << "handshake_state=" << GetStateStr() - << connector << "handshake_version=" << static_cast(_handshake_version) - << connector << "rdma_sq_imm_window_size=" << _sq_imm_window_size - << connector << "rdma_remote_rq_window_size=" << _remote_rq_window_size.load(butil::memory_order_relaxed) - << connector << "rdma_sq_window_size=" << _sq_window_size.load(butil::memory_order_relaxed) - << connector << "rdma_local_window_capacity=" << _local_window_capacity - << connector << "rdma_remote_window_capacity=" << _remote_window_capacity - << connector << "rdma_sbuf_head=" << _sq_current - << connector << "rdma_sbuf_tail=" << _sq_sent - << connector << "rdma_rbuf_head=" << _rq_received - << connector << "rdma_unacked_rq_wr=" << _new_rq_wrs.load(butil::memory_order_relaxed) - << connector << "rdma_received_ack=" << _accumulated_ack - << connector << "rdma_unsolicited_sent=" << _unsolicited - << connector << "rdma_unsignaled_sq_wr=" << _sq_unsignaled; +void RdmaEndpoint::DebugInfo(std::ostream &os, + butil::StringPiece connector) const { + os << "rdma_state=ON" << connector + << "rdma_sq_imm_window_size=" << _sq_imm_window_size << connector + << "rdma_remote_rq_window_size=" + << _remote_rq_window_size.load(butil::memory_order_relaxed) << connector + << "rdma_sq_window_size=" + << _sq_window_size.load(butil::memory_order_relaxed) << connector + << "rdma_local_window_capacity=" << _local_window_capacity << connector + << "rdma_remote_window_capacity=" << _remote_window_capacity << connector + << "rdma_sbuf_head=" << _sq_current << connector + << "rdma_sbuf_tail=" << _sq_sent << connector + << "rdma_rbuf_head=" << _rq_received << connector + << "rdma_unacked_rq_wr=" << _new_rq_wrs.load(butil::memory_order_relaxed) + << connector << "rdma_received_ack=" << _accumulated_ack << connector + << "rdma_unsolicited_sent=" << _unsolicited << connector + << "rdma_unsignaled_sq_wr=" << _sq_unsignaled; } int RdmaEndpoint::GlobalInitialize() { - g_rdma_recv_block_size = GetRdmaBlockSize() - IOBUF_BLOCK_HEADER_LEN; - if (g_rdma_recv_block_size <= 0) { - LOG(ERROR) << "rdma_recv_block_type incorrect " - << "(valid value: default/large/huge)"; - errno = EINVAL; - return -1; - } + g_rdma_recv_block_size = GetRdmaBlockSize() - IOBUF_BLOCK_HEADER_LEN; + if (g_rdma_recv_block_size <= 0) { + LOG(ERROR) << "rdma_recv_block_type incorrect " + << "(valid value: default/large/huge)"; + errno = EINVAL; + return -1; + } - g_rdma_resource_mutex = new butil::Mutex; - for (int i = 0; i < FLAGS_rdma_prepared_qp_cnt; ++i) { - RdmaResource* res = AllocateQpCq(FLAGS_rdma_prepared_qp_size, - FLAGS_rdma_prepared_qp_size); - if (!res) { - return -1; - } - res->next = g_rdma_resource_list; - g_rdma_resource_list = res; + g_rdma_resource_mutex = new butil::Mutex; + for (int i = 0; i < FLAGS_rdma_prepared_qp_cnt; ++i) { + RdmaResource *res = + AllocateQpCq(FLAGS_rdma_prepared_qp_size, FLAGS_rdma_prepared_qp_size); + if (!res) { + return -1; } + res->next = g_rdma_resource_list; + g_rdma_resource_list = res; + } - if (FLAGS_rdma_use_polling) { - _poller_groups = std::vector(FLAGS_task_group_ntags); - } + if (FLAGS_rdma_use_polling) { + _poller_groups = std::vector(FLAGS_task_group_ntags); + } - return 0; + return 0; } void RdmaEndpoint::GlobalRelease() { - if (g_rdma_resource_mutex) { - BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); - while (g_rdma_resource_list) { - RdmaResource* res = g_rdma_resource_list; - g_rdma_resource_list = g_rdma_resource_list->next; - delete res; - } - } - // release polling mode at exit or call RdmaEndpoint::PollingModeRelease - // explicitly - if (FLAGS_rdma_use_polling) { - for (int i = 0; i < FLAGS_task_group_ntags; ++i) { - PollingModeRelease(i); - } - } + if (g_rdma_resource_mutex) { + BAIDU_SCOPED_LOCK(*g_rdma_resource_mutex); + while (g_rdma_resource_list) { + RdmaResource *res = g_rdma_resource_list; + g_rdma_resource_list = g_rdma_resource_list->next; + delete res; + } + } + // release polling mode at exit or call RdmaEndpoint::PollingModeRelease + // explicitly + if (FLAGS_rdma_use_polling) { + for (int i = 0; i < FLAGS_task_group_ntags; ++i) { + PollingModeRelease(i); + } + } } std::vector RdmaEndpoint::_poller_groups; @@ -1692,112 +1229,112 @@ int RdmaEndpoint::PollingModeInitialize(bthread_tag_t tag, std::function callback, std::function init_fn, std::function release_fn) { - if (!FLAGS_rdma_use_polling) { - return 0; - } - auto& group = _poller_groups[tag]; - auto& pollers = group.pollers; - auto& running = group.running; - bool expected = false; - if (!running.compare_exchange_strong(expected, true)) { - return 0; - } - struct FnArgs { - Poller* poller; - std::atomic* running; - }; - auto fn = [](void* p) -> void* { - std::unique_ptr args(static_cast(p)); - auto poller = args->poller; - auto running = args->running; - std::unordered_set cq_sids; - CqSidOp op; - - if (poller->init_fn) { - poller->init_fn(); - } - - while (running->load(std::memory_order_relaxed)) { - while (poller->op_queue.Dequeue(op)) { - if (op.type == CqSidOp::ADD) { - cq_sids.emplace(op.sid); - } else if (op.type == CqSidOp::REMOVE) { - cq_sids.erase(op.sid); - } - } - for (auto sid : cq_sids) { - SocketUniquePtr s; - if (Socket::Address(sid, &s) < 0) { - continue; - } - PollCq(s.get()); - } - if (poller->callback) { - poller->callback(); - } - if (FLAGS_rdma_poller_yield) { - bthread_yield(); - } - } - - if (poller->release_fn) { - poller->release_fn(); + if (!FLAGS_rdma_use_polling) { + return 0; + } + auto &group = _poller_groups[tag]; + auto &pollers = group.pollers; + auto &running = group.running; + bool expected = false; + if (!running.compare_exchange_strong(expected, true)) { + return 0; + } + struct FnArgs { + Poller *poller; + std::atomic *running; + }; + auto fn = [](void *p) -> void * { + std::unique_ptr args(static_cast(p)); + auto poller = args->poller; + auto running = args->running; + std::unordered_set cq_sids; + CqSidOp op; + + if (poller->init_fn) { + poller->init_fn(); + } + + while (running->load(std::memory_order_relaxed)) { + while (poller->op_queue.Dequeue(op)) { + if (op.type == CqSidOp::ADD) { + cq_sids.emplace(op.sid); + } else if (op.type == CqSidOp::REMOVE) { + cq_sids.erase(op.sid); + } + } + for (auto sid : cq_sids) { + SocketUniquePtr s; + if (Socket::Address(sid, &s) < 0) { + continue; } + PollCq(s.get()); + } + if (poller->callback) { + poller->callback(); + } + if (FLAGS_rdma_poller_yield) { + bthread_yield(); + } + } - return nullptr; - }; - for (int i = 0; i < FLAGS_rdma_poller_num; ++i) { - auto args = new FnArgs{&pollers[i], &running}; - auto attr = FLAGS_rdma_disable_bthread ? BTHREAD_ATTR_PTHREAD - : BTHREAD_ATTR_NORMAL; - attr.tag = tag; - bthread_attr_set_name(&attr, "RdmaPolling"); - pollers[i].callback = callback; - pollers[i].init_fn = init_fn; - pollers[i].release_fn = release_fn; - auto rc = bthread_start_background(&pollers[i].tid, &attr, fn, args); - if (rc != 0) { - LOG(ERROR) << "Fail to start rdma polling bthread"; - return -1; - } + if (poller->release_fn) { + poller->release_fn(); } - return 0; + + return nullptr; + }; + for (int i = 0; i < FLAGS_rdma_poller_num; ++i) { + auto args = new FnArgs{&pollers[i], &running}; + auto attr = + FLAGS_rdma_disable_bthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL; + attr.tag = tag; + bthread_attr_set_name(&attr, "RdmaPolling"); + pollers[i].callback = callback; + pollers[i].init_fn = init_fn; + pollers[i].release_fn = release_fn; + auto rc = bthread_start_background(&pollers[i].tid, &attr, fn, args); + if (rc != 0) { + LOG(ERROR) << "Fail to start rdma polling bthread"; + return -1; + } + } + return 0; } void RdmaEndpoint::PollingModeRelease(bthread_tag_t tag) { - if (!FLAGS_rdma_use_polling) { - return; - } - auto& group = _poller_groups[tag]; - auto& pollers = group.pollers; - auto& running = group.running; - running.store(false, std::memory_order_relaxed); - for (int i = 0; i < FLAGS_rdma_poller_num; ++i) { - bthread_join(pollers[i].tid, nullptr); - } + if (!FLAGS_rdma_use_polling) { + return; + } + auto &group = _poller_groups[tag]; + auto &pollers = group.pollers; + auto &running = group.running; + running.store(false, std::memory_order_relaxed); + for (int i = 0; i < FLAGS_rdma_poller_num; ++i) { + bthread_join(pollers[i].tid, nullptr); + } } void RdmaEndpoint::PollerAddCqSid() { - auto index = butil::fmix32(_cq_sid) % FLAGS_rdma_poller_num; - auto& group = _poller_groups[bthread_self_tag()]; - auto& pollers = group.pollers; - auto& poller = pollers[index]; - if (INVALID_SOCKET_ID != _cq_sid) { - poller.op_queue.Enqueue(CqSidOp{_cq_sid, CqSidOp::ADD}); - } + auto index = butil::fmix32(_cq_sid) % FLAGS_rdma_poller_num; + auto &group = _poller_groups[bthread_self_tag()]; + auto &pollers = group.pollers; + auto &poller = pollers[index]; + if (INVALID_SOCKET_ID != _cq_sid) { + poller.op_queue.Enqueue(CqSidOp{_cq_sid, CqSidOp::ADD}); + } } void RdmaEndpoint::PollerRemoveCqSid() { - auto index = butil::fmix32(_cq_sid) % FLAGS_rdma_poller_num; - auto& group = _poller_groups[bthread_self_tag()]; - auto& pollers = group.pollers; - auto& poller = pollers[index]; - if (INVALID_SOCKET_ID != _cq_sid) { - poller.op_queue.Enqueue(CqSidOp{_cq_sid, CqSidOp::REMOVE}); - } + auto index = butil::fmix32(_cq_sid) % FLAGS_rdma_poller_num; + auto &group = _poller_groups[bthread_self_tag()]; + auto &pollers = group.pollers; + auto &poller = pollers[index]; + if (INVALID_SOCKET_ID != _cq_sid) { + poller.op_queue.Enqueue(CqSidOp{_cq_sid, CqSidOp::REMOVE}); + } } -} // namespace rdma -} // namespace brpc +} // namespace rdma +} // namespace brpc -#endif // if BRPC_WITH_RDMA +#endif // if BRPC_WITH_RDMA diff --git a/src/brpc/rdma/rdma_endpoint.h b/src/brpc/rdma/rdma_endpoint.h index 388e31d78e..a3b97855ae 100644 --- a/src/brpc/rdma/rdma_endpoint.h +++ b/src/brpc/rdma/rdma_endpoint.h @@ -31,17 +31,29 @@ #include "butil/containers/mpsc_queue.h" #include "butil/containers/optional.h" #include "brpc/socket.h" -#include "brpc/rdma/rdma_handshake_server.h" namespace brpc { class Socket; +class RdmaTransport; namespace rdma { DECLARE_bool(rdma_use_polling); DECLARE_int32(rdma_poller_num); DECLARE_bool(rdma_disable_bthread); +<<<<<<< HEAD +// Wire-independent RDMA connection parameters consumed by resource setup. +// Transport adapters translate their protocol-specific payload into this DTO. +struct RdmaConnectionInfo { + uint32_t block_size; + uint16_t sq_size; + uint16_t rq_size; + uint16_t lid; + ibv_gid gid; + uint32_t qp_num; + butil::optional ece; +======= class RdmaHandshakeClientV2; class RdmaHandshakeServerV2; class RdmaHandshakeClientV3; @@ -76,6 +88,7 @@ class RdmaConnect : public AppConnect { void Run(); void (*_done)(int, void*){nullptr}; void* _data{nullptr}; +>>>>>>> apache/master }; struct RdmaResource { @@ -93,17 +106,8 @@ struct RdmaResource { }; class BAIDU_CACHELINE_ALIGNMENT RdmaEndpoint : public SocketUser { -friend class RdmaConnect; friend class Socket; -friend class RdmaHandshakeClientV2; -friend class RdmaHandshakeServerV2; -friend class RdmaHandshakeClientV3; -friend class RdmaHandshakeServerV3; -friend RemoteHelloResult v2_wire::ReadBodyAndNegotiate(RdmaEndpoint*, ParsedHello*); -friend int v2_wire::DrainBytes(RdmaEndpoint*, size_t); -friend void v3_wire::FillLocalRdmaHello(const RdmaEndpoint*, RdmaHello*); -friend int v3_wire::ReadAndParseV3Hello(RdmaEndpoint*, RdmaHello*); -friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); +friend class ::brpc::RdmaTransport; public: explicit RdmaEndpoint(Socket* s); ~RdmaEndpoint() override; @@ -124,17 +128,16 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); // Whether the endpoint can send more data bool IsWritable() const; + // Resource information consumed by the transport-level RDMA adapter. + void GetLocalConnectionInfo(RdmaConnectionInfo* local) const; + // Returns 0 on success, 1 when ECE query is unavailable, -1 on error. + int QueryLocalEce(ibv_ece* ece) const; + void SetOutgoingEce(const ibv_ece& ece); + // For debug void DebugInfo(std::ostream& os, butil::StringPiece connector = "\n") const; - // Callback when there is new epollin event on TCP fd. - // Only used by client-side RDMA sockets. - static void OnNewDataFromTcp(Socket* m); - - // Real handshake for RDMA-mode sockets. - static ParseResult ExecuteServerHandshake(butil::IOBuf* source, Socket* socket); - // Initialize polling mode static int PollingModeInitialize(bthread_tag_t tag, std::function callback, @@ -144,28 +147,8 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); static void PollingModeRelease(bthread_tag_t tag); private: - enum State { - UNINIT = 0x0, - C_ALLOC_QPCQ = 0x1, - C_HELLO_SEND = 0x2, - C_HELLO_WAIT = 0x3, - C_BRINGUP_QP = 0x4, - C_ACK_SEND = 0x5, - S_HELLO_WAIT = 0x11, - S_ALLOC_QPCQ = 0x12, - S_BRINGUP_QP = 0x13, - S_HELLO_SEND = 0x14, - S_ACK_WAIT = 0x15, - ESTABLISHED = 0x100, - FALLBACK_TCP = 0x200, - FAILED = 0x300 - }; - - // Process handshake at the client - static void* ProcessHandshakeAtClient(void* arg); - // Allocate resources. On failure the endpoint is left with no RDMA - // resource attached, so that the handshake can safely fall back to TCP. + // resource attached, so the caller can safely continue without RDMA. // Return 0 if success, -1 if failed and errno set int AllocateResources(); @@ -214,37 +197,18 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); // -1: failed, errno set int DoPostRecv(void* block, size_t block_size); - // Read at most len bytes from fd in _socket to data - // wait for _read_butex if encounter EAGAIN - // return -1 if encounter other errno (including EOF) - int ReadFromFd(void* data, size_t len); - int ReadFromFd(butil::IOPortal* data, size_t len); - - - // Write at most len bytes from data to fd in _socket - // wait for _epollout_butex if encounter EAGAIN - // return -1 if encounter other errno - int WriteToFd(void* data, size_t len); - - // Write data to fd in _socket. - // wait for _epollout_butex if encounter EAGAIN. - // return -1 if encounter other errno. - int WriteToFd(butil::IOBuf* data); - - // Copy negotiated remote parameters into the endpoint and compute - // the SQ/RQ window capacities. Called by both - // ProcessHandshakeAtClient and ProcessHandshakeAtServer after the - // peer's hello has been validated. - void ApplyRemoteHello(const ParsedHello& remote); + // Copy negotiated remote parameters into the endpoint and compute the + // SQ/RQ window capacities. + void ApplyRemoteInfo(const RdmaConnectionInfo& remote); // Bringup the QP from RESET state to RTS state. // Arguments: - // remote: parsed remote hello. Provides the remote LID/GID/QP + // remote: negotiated peer parameters. Provides the remote LID/GID/QP // number for the RTR transition, and (on v3) the peer's // ECE to set during the INIT->RTR transition. // is_server: true on the server side, false on the client side. // Returns 0 on success, -1 on failed and errno set. - int BringUpQp(const ParsedHello& remote, bool is_server); + int BringUpQp(const RdmaConnectionInfo& remote, bool is_server); // Get event from comp channel and ack the events int GetAndAckEvents(SocketUniquePtr& s); @@ -255,9 +219,6 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); // Poll CQ and get the work completion static void PollCq(Socket* m); - // Get the description of current handshake state - std::string GetStateStr() const; - // Add cq socket id to poller void PollerAddCqSid(); @@ -267,24 +228,7 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); // Not owner Socket* _socket; - // State of Handshake. FALLBACK_TCP publishes RdmaTransport::_rdma_state - // with release ordering and is consumed by OnNewDataFromTcp with acquire - // ordering. Other state accesses do not publish data and use relaxed - // ordering. - butil::atomic _state; - - // Wire-level handshake protocol version (set by dispatch in - // ProcessHandshakeAtClient/Server). Aligned with the protocol code: - // 0 = unnegotiated - // 2 = v2 "RDMA" - // 3 = v3 "RDM3" - int _handshake_version; - - // ECE payload to advertise in the next local hello: - // Client: the locally queried ECE capabilities (filled - // before C_HELLO_SEND); - // Server: the reduced/negotiated ECE queried after the - // QP reached RTS (filled in BringUpQp). + // ECE payload prepared by resource setup and consumed by the RDMA adapter. butil::optional _outgoing_ece; // rdma resource @@ -336,9 +280,6 @@ friend int v3_wire::WriteV3Hello(RdmaEndpoint*, const RdmaHello&); // The number of new WRs posted in the local Recv Queue butil::atomic _new_rq_wrs; - // butex for inform read events on TCP fd during handshake - butil::atomic *_read_butex; - DISALLOW_COPY_AND_ASSIGN(RdmaEndpoint); // Cq socket id operation type diff --git a/src/brpc/rdma/rdma_handshake_server.h b/src/brpc/rdma/rdma_handshake_server.h deleted file mode 100644 index 705aa893ef..0000000000 --- a/src/brpc/rdma/rdma_handshake_server.h +++ /dev/null @@ -1,48 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#ifndef BRPC_RDMA_RDMA_HANDSHAKE_SERVER_H -#define BRPC_RDMA_RDMA_HANDSHAKE_SERVER_H - -#include "brpc/destroyable.h" -#include "brpc/parse_result.h" - -namespace butil { -class IOBuf; -} - -namespace brpc { -class Socket; -namespace rdma { - -// State kept across multiple parse calls of the server handshake. -struct ServerHandshakeContext : public Destroyable { - static ServerHandshakeContext* Create(); - void Destroy() override; -}; - -// The single server-side RDMA handshake entry for policy::ParseRdmaHandshake. -// Returns a ParseResult ready to be handed back from the protocol parser: -// - not an RDMA magic / handshake finished -> PARSE_ERROR_TRY_OTHERS; -// - an RDMA magic but not enough bytes yet -> PARSE_ERROR_NOT_ENOUGH_DATA; -// - IO/protocol error -> PARSE_ERROR_ABSOLUTELY_WRONG. -ParseResult ExecuteServerHandshake(butil::IOBuf* source, Socket* socket); - -} // namespace rdma -} // namespace brpc - -#endif // BRPC_RDMA_RDMA_HANDSHAKE_SERVER_H diff --git a/src/brpc/rdma/rdma_handshake.proto b/src/brpc/rdma_handshake.proto similarity index 100% rename from src/brpc/rdma/rdma_handshake.proto rename to src/brpc/rdma_handshake.proto diff --git a/src/brpc/rdma_transport.cpp b/src/brpc/rdma_transport.cpp index ee5151c3a5..1110f2c53f 100644 --- a/src/brpc/rdma_transport.cpp +++ b/src/brpc/rdma_transport.cpp @@ -18,9 +18,8 @@ #if BRPC_WITH_RDMA #include "brpc/rdma_transport.h" +#include "brpc/adapter_transport.h" #include "brpc/event_dispatcher.h" -#include "brpc/tcp_transport.h" -#include "brpc/input_messenger.h" #include "brpc/rdma/rdma_endpoint.h" #include "brpc/rdma/rdma_helper.h" @@ -30,219 +29,227 @@ DECLARE_bool(usercode_in_pthread); extern SocketVarsCollector *g_vars; +RdmaTransport *RdmaTransport::Get(const Socket *socket) { + const AdapterTransport *adapter = AdapterTransport::Get(socket); + Transport *transport = adapter->high_speed_transport(); + CHECK(transport != NULL); + return static_cast(transport); +} + void RdmaTransport::Init(Socket *socket, const SocketOptions &options) { - CHECK(_rdma_ep == nullptr); - if (options.socket_mode == SOCKET_MODE_RDMA) { - _rdma_ep = new rdma::RdmaEndpoint(socket); - _rdma_state = RDMA_UNKNOWN; - } else { - _rdma_state = RDMA_OFF; - socket->_socket_mode = SOCKET_MODE_TCP; - } - _socket = socket; - _default_connect = options.app_connect; - _on_edge_trigger = options.on_edge_triggered_events; - if (options.need_on_edge_trigger && _on_edge_trigger == nullptr) { - // Server-side RDMA sockets drive the handshake through the standard - // InputMessenger path (ParseRdmaHandshake), so they use OnNewMessages - // just like TCP sockets. Only client-side sockets, whose handshake - // (ProcessHandshakeAtClient) is an active blocking bthread relying on - // _read_butex woken by OnNewDataFromTcp, still need OnNewDataFromTcp. - if (options.user == static_cast(get_client_side_messenger())) { - _on_edge_trigger = rdma::RdmaEndpoint::OnNewDataFromTcp; - } else { - _on_edge_trigger = InputMessenger::OnNewMessages; - } - } - _tcp_transport = std::make_shared(); - _tcp_transport->Init(socket, options); + CHECK(_rdma_ep == nullptr); + _socket = socket; + _default_connect = options.app_connect; + _on_edge_trigger = nullptr; + _rdma_ep = new (std::nothrow) rdma::RdmaEndpoint(socket); + if (!_rdma_ep) { + const int saved_errno = errno; + PLOG(ERROR) << "Fail to create RdmaEndpoint"; + socket->SetFailed(saved_errno, "Fail to create RdmaEndpoint: %s", + berror(saved_errno)); + } + _rdma_state = RDMA_UNKNOWN; } void RdmaTransport::Release() { - if (_rdma_ep) { - delete _rdma_ep; - _rdma_ep = nullptr; - _rdma_state = RDMA_UNKNOWN; - } + if (_rdma_ep) { + delete _rdma_ep; + _rdma_ep = nullptr; + _rdma_state = RDMA_UNKNOWN; + } } int RdmaTransport::Reset(int32_t expected_nref) { - if (_rdma_ep) { - _rdma_ep->Reset(); - _rdma_state = RDMA_UNKNOWN; - } - return 0; + if (_rdma_ep) { + _rdma_ep->Reset(); + _rdma_state = RDMA_UNKNOWN; + } + return 0; } std::shared_ptr RdmaTransport::Connect() { - if (_default_connect == nullptr) { - return std::make_shared(); - } - return _default_connect; + return _default_connect; } -int RdmaTransport::CutFromIOBuf(butil::IOBuf *buf) { - // Only send over the RDMA channel once the handshake has NEGOTIATED it - // (RDMA_ON). While the state is still RDMA_UNKNOWN (handshake in progress, - // or a server connection that turned out to be plain TCP and never - // handshook) or RDMA_OFF (fell back), the QP is not usable and everything - // must go over the TCP fd. Mirrors the RDMA_ON check in WaitEpollOut(). - if (_rdma_ep && _rdma_state == RDMA_ON) { - butil::IOBuf *data_arr[1] = {buf}; - return _rdma_ep->CutFromIOBufList(data_arr, 1); - } else { - return _tcp_transport->CutFromIOBuf(buf); - } +void RdmaTransport::SetHighSpeedAvailable(bool available) { + _rdma_state = available ? RDMA_ON : RDMA_OFF; } -ssize_t RdmaTransport::CutFromIOBufList(butil::IOBuf **buf, size_t ndata) { - if (_rdma_ep && _rdma_state == RDMA_ON) { - return _rdma_ep->CutFromIOBufList(buf, ndata); - } - return _tcp_transport->CutFromIOBufList(buf, ndata); +int RdmaTransport::PrepareUpgradeResources() { + return _rdma_ep->AllocateResources(); } -int RdmaTransport::WaitEpollOut(butil::atomic *_epollout_butex, - bool pollin, const timespec duetime) { - if (_rdma_state == RDMA_ON) { - const int expected_val = _epollout_butex->load(butil::memory_order_acquire); - CHECK(_rdma_ep != nullptr); - if (!_rdma_ep->IsWritable()) { - g_vars->nwaitepollout << 1; - if (bthread::butex_wait(_epollout_butex, expected_val, &duetime) < 0) { - if (errno != EAGAIN && errno != ETIMEDOUT) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to wait rdma window of " << _socket; - _socket->SetFailed(saved_errno, - "Fail to wait rdma window of %s: %s", - _socket->description().c_str(), - berror(saved_errno)); - } - if (_socket->Failed()) { - // NOTE: - // Different from TCP, we cannot find the RDMA channel - // failed by writing to it. Thus we must check if it - // is already failed here. - return 1; - } - } - } - } else { - return _tcp_transport->WaitEpollOut(_epollout_butex, pollin, duetime); - } - return 0; +int RdmaTransport::NegotiateUpgradeResources( + const rdma::RdmaConnectionInfo &remote, bool server) { + _rdma_ep->ApplyRemoteInfo(remote); + return _rdma_ep->BringUpQp(remote, server); } -void RdmaTransport::ProcessEvent(bthread_attr_t attr) { - bthread_t tid; - if (FLAGS_usercode_in_coroutine) { - OnEdge(_socket); - } else if (!EventDispatcherUnsched()) { - auto rc = bthread_start_urgent(&tid, &attr, OnEdge, _socket); - if (rc != 0) { - LOG(FATAL) << "Fail to start ProcessEvent"; - OnEdge(_socket); - } - } else if (bthread_start_background(&tid, &attr, OnEdge, _socket) != 0) { - LOG(FATAL) << "Fail to start ProcessEvent"; - OnEdge(_socket); - } +std::unique_ptr +RdmaTransport::CreateClientHandshakeAdapter() { + return rdma::CreateClientHandshakeAdapter(_rdma_ep); } -void RdmaTransport::QueueMessage(InputMessageClosure& input_msg, - int* num_bthread_created, bool last_msg) { - if (last_msg && !rdma::FLAGS_rdma_use_polling) { - return; - } - InputMessageBase* to_run_msg = input_msg.release(); - if (!to_run_msg) { - return; - } +std::vector> +RdmaTransport::CreateServerHandshakeAdapters() { + return rdma::CreateServerHandshakeAdapters(_rdma_ep); +} - if (rdma::FLAGS_rdma_disable_bthread) { - ProcessInputMessage(to_run_msg); - return; - } - // Create bthread for last_msg. The bthread is not scheduled - // until bthread_flush() is called (in the worse case). - - // TODO(gejun): Join threads. - bthread_t th; - bthread_attr_t tmp = (FLAGS_usercode_in_pthread ? - BTHREAD_ATTR_PTHREAD : - BTHREAD_ATTR_NORMAL) | BTHREAD_NOSIGNAL; - tmp.keytable_pool = _socket->keytable_pool(); - tmp.tag = bthread_self_tag(); - bthread_attr_set_name(&tmp, "ProcessInputMessage"); - - if (!FLAGS_usercode_in_coroutine && bthread_start_background( - &th, &tmp, ProcessInputMessage, to_run_msg) == 0) { - ++*num_bthread_created; - } else { - ProcessInputMessage(to_run_msg); - } +void RdmaTransport::ActivateUpgrade() { SetHighSpeedAvailable(true); } + +void RdmaTransport::DeactivateUpgrade() { SetHighSpeedAvailable(false); } + +int RdmaTransport::CutFromIOBuf(butil::IOBuf *buf) { + butil::IOBuf *data[1] = {buf}; + return static_cast(CutFromIOBufList(data, 1)); } -void RdmaTransport::Debug(std::ostream &os) { - if (_rdma_state == RDMA_ON && _rdma_ep) { - _rdma_ep->DebugInfo(os); - } +ssize_t RdmaTransport::CutFromIOBufList(butil::IOBuf **buf, size_t ndata) { + CHECK(_rdma_ep != nullptr); + return _rdma_ep->CutFromIOBufList(buf, ndata); } -int RdmaTransport::ContextInitOrDie(bool serverOrNot, const void* _options) { - if (serverOrNot) { - if (!OptionsAvailableOverRdma(static_cast(_options))) { - return -1; - } - rdma::GlobalRdmaInitializeOrDie(); - if (!rdma::InitPollingModeWithTag(static_cast(_options)->bthread_tag)) { - return -1; - } - } else { - if (!OptionsAvailableForRdma(static_cast(_options))) { - return -1; +int RdmaTransport::WaitEpollOut(butil::atomic *_epollout_butex, + bool pollin, const timespec duetime) { + if (_rdma_state == RDMA_ON) { + const int expected_val = _epollout_butex->load(butil::memory_order_acquire); + CHECK(_rdma_ep != nullptr); + if (!_rdma_ep->IsWritable()) { + g_vars->nwaitepollout << 1; + if (bthread::butex_wait(_epollout_butex, expected_val, &duetime) < 0) { + if (errno != EAGAIN && errno != ETIMEDOUT) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to wait rdma window of " << _socket; + _socket->SetFailed(saved_errno, "Fail to wait rdma window of %s: %s", + _socket->description().c_str(), + berror(saved_errno)); } - rdma::GlobalRdmaInitializeOrDie(); - if (!rdma::InitPollingModeWithTag(bthread_self_tag())) { - return -1; + if (_socket->Failed()) { + // NOTE: + // Different from TCP, we cannot find the RDMA channel + // failed by writing to it. Thus we must check if it + // is already failed here. + return 1; } - return 0; + } } + } + return 0; +} - return 0; +void RdmaTransport::ProcessEvent(bthread_attr_t attr) { + bthread_t tid; + if (FLAGS_usercode_in_coroutine) { + OnEdge(_socket); + } else if (!EventDispatcherUnsched()) { + auto rc = bthread_start_urgent(&tid, &attr, OnEdge, _socket); + if (rc != 0) { + LOG(FATAL) << "Fail to start ProcessEvent"; + OnEdge(_socket); + } + } else if (bthread_start_background(&tid, &attr, OnEdge, _socket) != 0) { + LOG(FATAL) << "Fail to start ProcessEvent"; + OnEdge(_socket); + } } -bool RdmaTransport::OptionsAvailableForRdma(const ChannelOptions* opt) { - if (opt->has_ssl_options()) { - LOG(WARNING) << "Cannot use SSL and RDMA at the same time"; - return false; - } - if (!rdma::SupportedByRdma(opt->protocol.name())) { - LOG(WARNING) << "Cannot use " << opt->protocol.name() - << " over RDMA"; - return false; - } - return true; +void RdmaTransport::QueueMessage(InputMessageClosure &input_msg, + int *num_bthread_created, bool last_msg) { + if (last_msg && !rdma::FLAGS_rdma_use_polling) { + return; + } + InputMessageBase *to_run_msg = input_msg.release(); + if (!to_run_msg) { + return; + } + + if (rdma::FLAGS_rdma_disable_bthread) { + ProcessInputMessage(to_run_msg); + return; + } + // Create bthread for last_msg. The bthread is not scheduled + // until bthread_flush() is called (in the worse case). + + // TODO(gejun): Join threads. + bthread_t th; + bthread_attr_t tmp = + (FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL) | + BTHREAD_NOSIGNAL; + tmp.keytable_pool = _socket->keytable_pool(); + tmp.tag = bthread_self_tag(); + bthread_attr_set_name(&tmp, "ProcessInputMessage"); + + if (!FLAGS_usercode_in_coroutine && + bthread_start_background(&th, &tmp, ProcessInputMessage, to_run_msg) == + 0) { + ++*num_bthread_created; + } else { + ProcessInputMessage(to_run_msg); + } +} + +void RdmaTransport::Debug(std::ostream &os) { + if (_rdma_state == RDMA_ON && _rdma_ep) { + _rdma_ep->DebugInfo(os); + } } -bool RdmaTransport::OptionsAvailableOverRdma(const ServerOptions* opt) { - if (opt->rtmp_service) { - LOG(WARNING) << "RTMP is not supported by RDMA"; - return false; +int RdmaTransport::ContextInitOrDie(bool serverOrNot, const void *_options) { + if (serverOrNot) { + if (!OptionsAvailableOverRdma( + static_cast(_options))) { + return -1; } - if (opt->has_ssl_options()) { - LOG(WARNING) << "SSL is not supported by RDMA"; - return false; + rdma::GlobalRdmaInitializeOrDie(); + if (!rdma::InitPollingModeWithTag( + static_cast(_options)->bthread_tag)) { + return -1; } - if (opt->nshead_service) { - LOG(WARNING) << "NSHEAD is not supported by RDMA"; - return false; + } else { + if (!OptionsAvailableForRdma( + static_cast(_options))) { + return -1; } - if (opt->mongo_service_adaptor) { - LOG(WARNING) << "MONGO is not supported by RDMA"; - return false; + rdma::GlobalRdmaInitializeOrDie(); + if (!rdma::InitPollingModeWithTag(bthread_self_tag())) { + return -1; } - return true; + return 0; + } + + return 0; +} + +bool RdmaTransport::OptionsAvailableForRdma(const ChannelOptions *opt) { + if (opt->has_ssl_options()) { + LOG(WARNING) << "Cannot use SSL and RDMA at the same time"; + return false; + } + if (!rdma::SupportedByRdma(opt->protocol.name())) { + LOG(WARNING) << "Cannot use " << opt->protocol.name() << " over RDMA"; + return false; + } + return true; +} + +bool RdmaTransport::OptionsAvailableOverRdma(const ServerOptions *opt) { + if (opt->rtmp_service) { + LOG(WARNING) << "RTMP is not supported by RDMA"; + return false; + } + if (opt->has_ssl_options()) { + LOG(WARNING) << "SSL is not supported by RDMA"; + return false; + } + if (opt->nshead_service) { + LOG(WARNING) << "NSHEAD is not supported by RDMA"; + return false; + } + if (opt->mongo_service_adaptor) { + LOG(WARNING) << "MONGO is not supported by RDMA"; + return false; + } + return true; } } // namespace brpc #endif diff --git a/src/brpc/rdma_transport.h b/src/brpc/rdma_transport.h index 1d78fbb430..5d177f629e 100644 --- a/src/brpc/rdma_transport.h +++ b/src/brpc/rdma_transport.h @@ -22,14 +22,15 @@ #include "brpc/socket.h" #include "brpc/channel.h" #include "brpc/transport.h" +#include "brpc/rdma/rdma_endpoint.h" +#include "brpc/handshake/rdma_handshake.h" namespace brpc { +class AdapterTransport; class RdmaTransport : public Transport { -friend class TransportFactory; -friend class rdma::RdmaEndpoint; -friend class rdma::RdmaConnect; -friend class rdma::RdmaHandshakeServerV2; -friend class rdma::RdmaHandshakeServerV3; + friend class TransportFactory; + friend class AdapterTransport; + friend class rdma::RdmaEndpoint; public: void Init(Socket* socket, const SocketOptions& options) override; void Release() override; @@ -37,7 +38,8 @@ friend class rdma::RdmaHandshakeServerV3; std::shared_ptr Connect() override; int CutFromIOBuf(butil::IOBuf* buf) override; ssize_t CutFromIOBufList(butil::IOBuf** buf, size_t ndata) override; - int WaitEpollOut(butil::atomic* _epollout_butex, bool pollin, const timespec duetime) override; + int WaitEpollOut(butil::atomic* epollout_butex, + bool pollin, timespec duetime) override; void ProcessEvent(bthread_attr_t attr) override; void QueueMessage(InputMessageClosure& inputMsg, int* num_bthread_created, bool last_msg) override; void Debug(std::ostream &os) override; @@ -45,8 +47,26 @@ friend class rdma::RdmaHandshakeServerV3; CHECK(_rdma_ep != nullptr); return _rdma_ep; } + static RdmaTransport* Get(const Socket* socket); + static RdmaTransport* Get(const SocketUniquePtr& socket) { + return Get(socket.get()); + } static int ContextInitOrDie(bool serverOrNot, const void* _options); + + // Resource operations consumed by the upper-level handshake coordinator. + int PrepareUpgradeResources(); + int NegotiateUpgradeResources(const rdma::RdmaConnectionInfo& remote, + bool server); + std::unique_ptr + CreateClientHandshakeAdapter(); + std::vector> + CreateServerHandshakeAdapters(); + void ActivateUpgrade(); + void DeactivateUpgrade(); + bool UpgradeActive() const { return _rdma_state == RDMA_ON; } private: + void SetHighSpeedAvailable(bool available); + static bool OptionsAvailableForRdma(const ChannelOptions* opt); static bool OptionsAvailableOverRdma(const ServerOptions* opt); @@ -60,8 +80,7 @@ friend class rdma::RdmaHandshakeServerV3; rdma::RdmaEndpoint* _rdma_ep = nullptr; // Should use RDMA or not RdmaState _rdma_state; - std::shared_ptr _tcp_transport; }; } // namespace brpc #endif // BRPC_WITH_RDMA -#endif //BRPC_RDMA_TRANSPORT_H \ No newline at end of file +#endif //BRPC_RDMA_TRANSPORT_H diff --git a/src/brpc/socket.h b/src/brpc/socket.h index 6d321f8bc3..d022d063bb 100644 --- a/src/brpc/socket.h +++ b/src/brpc/socket.h @@ -55,21 +55,19 @@ class ChannelBalancer; } namespace rdma { class RdmaEndpoint; -class RdmaConnect; -class RdmaHandshakeClientV2; -class RdmaHandshakeServerV2; -class RdmaHandshakeClientV3; -class RdmaHandshakeServerV3; } namespace ubring { class UBShmEndpoint; - class UBConnect; +} +namespace handshake { +class SocketHandshakeIO; } class Socket; class AuthContext; class EventDispatcher; class Stream; class Transport; +class AdapterTransport; // Set SO_SNDBUF/SO_RCVBUF according to socket_*_buffer_size flags. void SetSocketBufferOptions(int fd); @@ -326,14 +324,8 @@ friend class policy::ConsistentHashingLoadBalancer; friend class policy::RtmpContext; friend class schan::ChannelBalancer; friend class rdma::RdmaEndpoint; -friend class rdma::RdmaConnect; friend class ubring::UBShmEndpoint; -friend class ubring::UBConnect; friend class UBShmTransport; -friend class rdma::RdmaHandshakeClientV2; -friend class rdma::RdmaHandshakeServerV2; -friend class rdma::RdmaHandshakeClientV3; -friend class rdma::RdmaHandshakeServerV3; friend class HealthCheckTask; friend class OnAppHealthCheckDone; friend class HealthCheckManager; @@ -342,6 +334,8 @@ friend class VersionedRefWithId; friend class IOEvent; friend void DereferenceSocket(Socket*); friend class Transport; +friend class AdapterTransport; +friend class handshake::SocketHandshakeIO; friend class TcpTransport; friend class RdmaTransport; friend class TransportFactory; @@ -951,8 +945,10 @@ friend class TransportFactory; SSL* _ssl_session; // owner std::shared_ptr _ssl_ctx; - // Should use SOCKET_MODE_RDMA or SOCKET_MODE_TCP or Other, default is SOCKET_MODE_TCP Transport + // Requested provider: SOCKET_MODE_TCP, SOCKET_MODE_RDMA or another mode. SocketMode _socket_mode; + // The top-level AdapterTransport, which selects TCP or the requested + // accelerated Transport. std::unique_ptr _transport; // Pass from controller, for progressive reading. diff --git a/src/brpc/transport_factory.cpp b/src/brpc/transport_factory.cpp index 36fdaaed05..3355e0764d 100644 --- a/src/brpc/transport_factory.cpp +++ b/src/brpc/transport_factory.cpp @@ -16,7 +16,7 @@ // under the License. #include "brpc/transport_factory.h" -#include "brpc/tcp_transport.h" +#include "brpc/adapter_transport.h" #include "brpc/rdma_transport.h" #include "brpc/ubshm_transport.h" @@ -43,16 +43,16 @@ int TransportFactory::ContextInitOrDie(SocketMode mode, bool serverOrNot, const std::unique_ptr TransportFactory::CreateTransport(SocketMode mode) { if (mode == SOCKET_MODE_TCP) { - return std::unique_ptr(new TcpTransport()); + return std::unique_ptr(new AdapterTransport(mode)); } #if BRPC_WITH_RDMA else if (mode == SOCKET_MODE_RDMA) { - return std::unique_ptr(new RdmaTransport()); + return std::unique_ptr(new AdapterTransport(mode)); } #endif #if BRPC_WITH_UBRING else if (mode == SOCKET_MODE_UBRING) { - return std::unique_ptr(new UBShmTransport()); + return std::unique_ptr(new AdapterTransport(mode)); } #endif else { @@ -60,4 +60,4 @@ std::unique_ptr TransportFactory::CreateTransport(SocketMode mode) { return nullptr; } } -} // namespace brpc \ No newline at end of file +} // namespace brpc diff --git a/src/brpc/transport_factory.h b/src/brpc/transport_factory.h index d933a130e1..add249c438 100644 --- a/src/brpc/transport_factory.h +++ b/src/brpc/transport_factory.h @@ -22,7 +22,8 @@ #include "brpc/transport.h" namespace brpc { -// TransportFactory to create transport instance with socket_mode {TCP, RDMA} +// Creates the top-level AdapterTransport for all socket modes. The adapter +// selects TcpTransport or a concrete accelerated Transport internally. class TransportFactory { public: static int ContextInitOrDie(SocketMode mode, bool serverOrNot, const void* _options); @@ -31,4 +32,4 @@ class TransportFactory { }; } // namespace brpc -#endif //BRPC_TRANSPORT_FACTORY_H \ No newline at end of file +#endif //BRPC_TRANSPORT_FACTORY_H diff --git a/src/brpc/transport_handshake.cpp b/src/brpc/transport_handshake.cpp new file mode 100644 index 0000000000..1897b40a2a --- /dev/null +++ b/src/brpc/transport_handshake.cpp @@ -0,0 +1,332 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include "brpc/transport_handshake.h" + +#include + +#include "butil/logging.h" +#include "butil/object_pool.h" + +namespace brpc { +namespace handshake { + +ServerHandshakeContext* ServerHandshakeContext::Create( + HandshakeAdapter* adapter) { + ServerHandshakeContext* context = + butil::get_object(); + if (context != NULL) { + context->_adapter = adapter; + } + return context; +} + +void ServerHandshakeContext::Destroy() { + _adapter = NULL; + butil::return_object(this); +} + +static StepResult FinishWithFailure( + HandshakeSession* session, const std::function& on_failed) { + if (on_failed) { + on_failed(); + } + session->MarkFailed(); + return STEP_ERROR; +} + +static StepResult FinishWithFallback( + HandshakeSession* session, const std::function& set_tcp_active) { + session->PublishFallback([&set_tcp_active]() { + if (set_tcp_active) { + set_tcp_active(); + } + }); + return STEP_FALLBACK; +} + +static StepResult ConvertFrameResult(FrameResult result) { + switch (result) { + case FRAME_OK: return STEP_OK; + case FRAME_NOT_MINE: return STEP_NOT_MINE; + case FRAME_NEED_MORE: return STEP_NEED_MORE; + case FRAME_IO_ERROR: return STEP_ERROR; + case FRAME_PROTOCOL_ERROR: + errno = EPROTO; + return STEP_ERROR; + } + errno = EPROTO; + return STEP_ERROR; +} + +StepResult HandshakeSession::SendHello(const HandshakeCodec& codec, + bool enabled) { + CHECK(codec.build_hello); + std::string payload; + const StepResult result = codec.build_hello(enabled, &payload); + if (result != STEP_OK) { + return result; + } + return ConvertFrameResult( + FrameCodec::WriteFrame(_io, codec.hello_frame, payload)); +} + +StepResult HandshakeSession::ReceiveHello(const HandshakeCodec& codec, + HandshakeInput* input, + bool push_back_on_not_mine, + bool* magic_matched) { + CHECK(codec.parse_hello); + std::string payload; + const FrameResult frame_result = input != NULL + ? FrameCodec::ParseBufferedFrame( + input, codec.hello_frame, &payload, magic_matched) + : FrameCodec::ReadFrame( + _io, codec.hello_frame, push_back_on_not_mine, &payload); + const StepResult result = ConvertFrameResult(frame_result); + if (result != STEP_OK) { + return result; + } + set_protocol_version(codec.protocol_version); + return codec.parse_hello(payload); +} + +StepResult HandshakeSession::SendAck(const HandshakeCodec& codec, + bool enabled) { + CHECK(codec.build_ack); + std::string payload; + const StepResult result = codec.build_ack(enabled, &payload); + if (result != STEP_OK) { + return result; + } + return ConvertFrameResult( + FrameCodec::WriteFrame(_io, codec.ack_frame, payload)); +} + +StepResult HandshakeSession::ReceiveAck(const HandshakeCodec& codec, + HandshakeInput* input, + bool* enabled) { + CHECK(codec.parse_ack); + std::string payload; + const FrameResult frame_result = input != NULL + ? FrameCodec::ParseBufferedFrame(input, codec.ack_frame, &payload) + : FrameCodec::ReadFrame(_io, codec.ack_frame, false, &payload); + const StepResult result = ConvertFrameResult(frame_result); + if (result != STEP_OK) { + return result; + } + return codec.parse_ack(payload, enabled); +} + +StepResult HandshakeSession::SelectAndReceiveHello( + const std::vector& codecs, HandshakeInput* input, + bool push_back_on_not_mine, const HandshakeCodec** selected) { + CHECK(!codecs.empty()); + CHECK(selected != NULL); + if (input == NULL) { + // A blocking byte stream cannot try a second codec after consuming + // bytes from the fd. Such protocols must select a single codec before + // entering the common session. + CHECK_EQ(1UL, codecs.size()); + *selected = &codecs.front(); + return ReceiveHello(**selected, NULL, push_back_on_not_mine); + } + + bool need_more = false; + for (size_t i = 0; i < codecs.size(); ++i) { + bool magic_matched = false; + const StepResult result = ReceiveHello( + codecs[i], input, false, &magic_matched); + if (result == STEP_NOT_MINE) { + continue; + } + if (result == STEP_NEED_MORE) { + if (magic_matched) { + *selected = &codecs[i]; + set_protocol_version(codecs[i].protocol_version); + return STEP_NEED_MORE; + } + need_more = true; + continue; + } + *selected = &codecs[i]; + return result; + } + return need_more ? STEP_NEED_MORE : STEP_NOT_MINE; +} + +StepResult HandshakeSession::RunClient( + const ClientHandshakeCallbacks& callbacks) { + CHECK(callbacks.transport.prepare_resources); + CHECK(callbacks.transport.negotiate_resources); + CHECK(callbacks.transport.set_high_speed_active); + CHECK(callbacks.transport.set_tcp_active); + + SetPhase(PREPARING); + StepResult result = callbacks.transport.prepare_resources(); + if (result == STEP_FALLBACK) { + return FinishWithFallback(this, callbacks.transport.set_tcp_active); + } + if (result != STEP_OK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + + SetPhase(HELLO_SEND); + if (SendHello(callbacks.codec, true) != STEP_OK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + + SetPhase(HELLO_WAIT); + result = ReceiveHello(callbacks.codec, NULL, false); + if (result == STEP_ERROR || result == STEP_NOT_MINE || + result == STEP_NEED_MORE) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + bool enabled = result == STEP_OK; + + if (enabled) { + SetPhase(NEGOTIATING); + result = callbacks.transport.negotiate_resources(); + if (result != STEP_OK && result != STEP_FALLBACK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + enabled = result == STEP_OK; + } + + SetPhase(ACK_SEND); + if (SendAck(callbacks.codec, enabled) != STEP_OK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + + if (enabled) { + callbacks.transport.set_high_speed_active(); + MarkEstablished(); + return STEP_OK; + } + return FinishWithFallback(this, callbacks.transport.set_tcp_active); +} + +StepResult HandshakeSession::RunServer( + const ServerHandshakeCallbacks& callbacks) { + CHECK(!callbacks.codecs.empty()); + CHECK(callbacks.transport.prepare_resources); + CHECK(callbacks.transport.negotiate_resources); + CHECK(callbacks.transport.set_high_speed_active); + CHECK(callbacks.transport.set_tcp_active); + + // Once TCP fallback has been published, subsequent bytes are application + // protocol data and must bypass every upgrade codec without changing the + // terminal state. + if (phase() == FALLBACK_TCP) { + return STEP_NOT_MINE; + } + + const HandshakeCodec* selected = NULL; + if (phase() != ACK_WAIT) { + const int previous_phase = phase(); + _local_enabled = false; + SetPhase(HELLO_WAIT); + StepResult result = SelectAndReceiveHello( + callbacks.codecs, callbacks.input, + callbacks.fallback_on_not_mine, &selected); + if (result == STEP_NOT_MINE) { + if (callbacks.fallback_on_not_mine) { + return FinishWithFallback(this, callbacks.transport.set_tcp_active); + } + SetPhase(UNINITIALIZED); + return STEP_NOT_MINE; + } + if (result == STEP_NEED_MORE) { + if (selected == NULL) { + SetPhase(previous_phase); + } + return STEP_NEED_MORE; + } + if (result == STEP_ERROR) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + bool enabled = result == STEP_OK; + + if (enabled) { + SetPhase(PREPARING); + result = callbacks.transport.prepare_resources(); + if (result != STEP_OK && result != STEP_FALLBACK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + enabled = result == STEP_OK; + } + + if (enabled) { + SetPhase(NEGOTIATING); + result = callbacks.transport.negotiate_resources(); + if (result != STEP_OK && result != STEP_FALLBACK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + enabled = result == STEP_OK; + } + + SetPhase(HELLO_SEND); + CHECK(selected != NULL); + _local_enabled = enabled; + if (SendHello(*selected, enabled) != STEP_OK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + SetPhase(ACK_WAIT); + } else { + for (size_t i = 0; i < callbacks.codecs.size(); ++i) { + if (callbacks.codecs[i].protocol_version == protocol_version()) { + selected = &callbacks.codecs[i]; + break; + } + } + CHECK(selected != NULL); + } + + // Always try the ACK callback once. For a non-blocking server it returns + // STEP_NEED_MORE when the ACK has not arrived; when Hello and ACK are + // coalesced in the input buffer this consumes the ACK without waiting for + // another socket edge. + bool peer_enabled = false; + StepResult result = ReceiveAck( + *selected, callbacks.input, &peer_enabled); + if (result == STEP_NEED_MORE) { + return STEP_NEED_MORE; + } + if (result == STEP_ERROR || result == STEP_NOT_MINE) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + if (result == STEP_FALLBACK) { + return FinishWithFallback(this, callbacks.transport.set_tcp_active); + } + if (!peer_enabled) { + return FinishWithFallback(this, callbacks.transport.set_tcp_active); + } + if (!_local_enabled) { + errno = EPROTO; + return FinishWithFailure(this, callbacks.transport.on_failed); + } + if (callbacks.validate_established && + callbacks.validate_established() != STEP_OK) { + return FinishWithFailure(this, callbacks.transport.on_failed); + } + + callbacks.transport.set_high_speed_active(); + MarkEstablished(); + return STEP_OK; +} + +} // namespace handshake +} // namespace brpc diff --git a/src/brpc/transport_handshake.h b/src/brpc/transport_handshake.h new file mode 100644 index 0000000000..3899a3aa44 --- /dev/null +++ b/src/brpc/transport_handshake.h @@ -0,0 +1,197 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#ifndef BRPC_TRANSPORT_HANDSHAKE_H +#define BRPC_TRANSPORT_HANDSHAKE_H + +#include +#include +#include +#include + +#include "butil/atomicops.h" +#include "butil/macros.h" +#include "brpc/destroyable.h" +#include "brpc/handshake/handshake_frame.h" + +namespace brpc { + +class Socket; + +namespace handshake { + +class HandshakeAdapter; + +// Context retained by InputMessenger between the hello and ACK parse calls. +// Remembering the selected stateless adapter is necessary because ACK frames +// have no magic and cannot be dispatched from their bytes alone. +struct ServerHandshakeContext : public Destroyable { + ServerHandshakeContext() : _adapter(NULL) {} + static ServerHandshakeContext* Create(HandshakeAdapter* adapter); + HandshakeAdapter* adapter() const { return _adapter; } + void Destroy() override; + +private: + HandshakeAdapter* _adapter; +}; + +// Protocol adapters may use transport-specific intermediate values, but the +// terminal values are shared so that AdapterTransport can make the same +// acquire-side decision for RDMA, URMA and UBSHM. +enum Phase { + UNINITIALIZED = 0, + PREPARING = 1, + HELLO_SEND = 2, + HELLO_WAIT = 3, + NEGOTIATING = 4, + ACK_SEND = 5, + ACK_WAIT = 6, + ESTABLISHED = 0x100, + FALLBACK_TCP = 0x200, + FAILED = 0x300, +}; + +enum StepResult { + STEP_OK = 0, + STEP_FALLBACK, + STEP_NEED_MORE, + STEP_NOT_MINE, + STEP_ERROR, +}; + +// A protocol describes only its fields and resource-independent wire values. +// HandshakeSession owns framing and I/O through FrameCodec. The callbacks may +// retain strongly typed parsed state in their protocol adapter. +struct HandshakeCodec { + int protocol_version; + FrameSpec hello_frame; + FrameSpec ack_frame; + std::function build_hello; + std::function parse_hello; + std::function build_ack; + std::function parse_ack; +}; + +// Resource-specific operations supplied by a Transport and invoked by the +// common coordinator. Wire I/O and field codec invocation remain owned by +// HandshakeSession. +struct TransportUpgradeOps { + std::function prepare_resources; + std::function negotiate_resources; + std::function set_high_speed_active; + std::function set_tcp_active; + std::function on_failed; +}; + +struct ClientHandshakeCallbacks { + HandshakeCodec codec; + TransportUpgradeOps transport; +}; + +// The server driver is independent of the input mode. A parser callback can +// return STEP_NEED_MORE, while a blocking callback waits before returning. +struct ServerHandshakeCallbacks { + bool fallback_on_not_mine; + // Buffered parsers may offer multiple codecs (RDMA v2/v3). Blocking + // server handshakes currently provide exactly one codec. + std::vector codecs; + HandshakeInput* input; + TransportUpgradeOps transport; + std::function validate_established; +}; + +// Owns one connection-upgrade attempt, invokes the protocol field codec and +// resource callbacks, and provides common framing, TCP control-plane I/O, +// lifecycle and publication ordering. +class HandshakeSession { +public: + explicit HandshakeSession(Socket* socket = NULL) + : _socket_io(socket), _io(&_socket_io), _phase(UNINITIALIZED), + _protocol_version(0), _local_enabled(false) {} + + void Reset(Socket* socket) { + _socket_io.Reset(socket); + _io = &_socket_io; + _protocol_version = 0; + _local_enabled = false; + _phase.store(UNINITIALIZED, butil::memory_order_relaxed); + } + + int phase(butil::memory_order order = butil::memory_order_acquire) const { + return _phase.load(order); + } + + void SetPhase(int phase) { + _phase.store(phase, butil::memory_order_relaxed); + } + + int protocol_version() const { return _protocol_version; } + void set_protocol_version(int version) { _protocol_version = version; } + + void MarkEstablished() { + _phase.store(ESTABLISHED, butil::memory_order_release); + } + + void MarkFailed() { + _phase.store(FAILED, butil::memory_order_release); + } + + // The callback MUST publish the transport's TCP-active state. The release + // store then makes that state and any pushed-back bytes visible to the + // event thread that observes FALLBACK_TCP with an acquire load. This is + // the common form of the ordering fixes from #3347 and #3406. + template + void PublishFallback(PublishTcpActive publish_tcp_active) { + publish_tcp_active(); + _phase.store(FALLBACK_TCP, butil::memory_order_release); + } + + void NotifyReadable() { _socket_io.NotifyReadable(); } + + // Injects an in-memory stream in common-component unit tests. Reset() + // restores the Socket-backed implementation. + void SetIOForTest(HandshakeIO* io) { _io = io; } + + StepResult RunClient(const ClientHandshakeCallbacks& callbacks); + StepResult RunServer(const ServerHandshakeCallbacks& callbacks); + +private: + StepResult SendHello(const HandshakeCodec& codec, bool enabled); + StepResult ReceiveHello(const HandshakeCodec& codec, + HandshakeInput* input, + bool push_back_on_not_mine, + bool* magic_matched = NULL); + StepResult SendAck(const HandshakeCodec& codec, bool enabled); + StepResult ReceiveAck(const HandshakeCodec& codec, + HandshakeInput* input, bool* enabled); + StepResult SelectAndReceiveHello( + const std::vector& codecs, HandshakeInput* input, + bool push_back_on_not_mine, const HandshakeCodec** selected); + + SocketHandshakeIO _socket_io; + HandshakeIO* _io; + butil::atomic _phase; + int _protocol_version; + bool _local_enabled; + + DISALLOW_COPY_AND_ASSIGN(HandshakeSession); +}; + +} // namespace handshake +} // namespace brpc + +#endif // BRPC_TRANSPORT_HANDSHAKE_H diff --git a/src/brpc/ubshm/ub_endpoint.cpp b/src/brpc/ubshm/ub_endpoint.cpp index 45794fdc6e..fe1d6329c8 100644 --- a/src/brpc/ubshm/ub_endpoint.cpp +++ b/src/brpc/ubshm/ub_endpoint.cpp @@ -19,23 +19,20 @@ #include -#include -#include -#include "butil/fd_utility.h" -#include "butil/logging.h" // CHECK, LOG -#include "butil/sys_byteorder.h" // HostToNet,NetToHost -#include "bthread/bthread.h" #include "brpc/errno.pb.h" #include "brpc/event_dispatcher.h" #include "brpc/input_messenger.h" #include "brpc/socket.h" -#include "brpc/reloadable_flags.h" -#include "brpc/ubshm/ub_helper.h" -#include "brpc/ubshm/ub_endpoint.h" -#include "brpc/ubshm/shm/shm_def.h" #include "brpc/ubshm/common/common.h" -#include "brpc/ubshm_transport.h" +#include "brpc/ubshm/shm/shm_def.h" +#include "brpc/ubshm/ub_endpoint.h" +#include "brpc/ubshm/ub_helper.h" #include "brpc/ubshm/ubr_trx.h" +#include "brpc/ubshm_transport.h" +#include "bthread/bthread.h" +#include "butil/logging.h" // CHECK, LOG +#include + DECLARE_int32(task_group_ntags); @@ -44,9 +41,6 @@ DECLARE_bool(log_connection_close); namespace ubring { extern bool g_skip_ub_init; -DEFINE_int32(data_queue_size, 4, "data queue size for UB"); -DEFINE_bool(ub_trace_verbose, false, "Print log message verbosely"); -BRPC_VALIDATE_GFLAG(ub_trace_verbose, brpc::PassValidate); DEFINE_int32(ub_poller_num, 1, "Poller number in ub polling mode."); DEFINE_bool(ub_poller_yield, false, "Yield thread in RDMA polling mode."); DEFINE_bool(ub_edisp_unsched, false, "Disable event dispatcher schedule"); @@ -56,879 +50,373 @@ static const size_t MIN_ONCE_READ = 4096; static const size_t MAX_ONCE_READ = 524288; static const size_t IOBUF_IOV_MAX = 256; -static const char* MAGIC_STR = "UB"; -static const size_t MAGIC_STR_LEN = 2; -static const size_t HELLO_MSG_LEN_MIN = 64; -static const size_t ACK_MSG_LEN = 4; -static uint16_t g_ub_hello_msg_len = 64; -static uint16_t g_ub_hello_version = 2; -static uint16_t g_ub_impl_version = 1; - -static const uint32_t ACK_MSG_UB_OK = 0x1; - -static butil::Mutex* g_ubring_resource_mutex = nullptr; - -void HelloMessage::Serialize(void* data) const { - char* current_pos = static_cast(data); - const uint16_t net_msg_len = butil::HostToNet16(msg_len); - memcpy(current_pos, &net_msg_len, sizeof(net_msg_len)); - current_pos += sizeof(net_msg_len); - const uint16_t net_hello_ver = butil::HostToNet16(hello_ver); - memcpy(current_pos, &net_hello_ver, sizeof(net_hello_ver)); - current_pos += sizeof(net_hello_ver); - const uint16_t net_impl_ver = butil::HostToNet16(impl_ver); - memcpy(current_pos, &net_impl_ver, sizeof(net_impl_ver)); - current_pos += sizeof(net_impl_ver); - const uint64_t net_len = butil::HostToNet64(len); - memcpy(current_pos, &net_len, sizeof(net_len)); - current_pos += sizeof(net_len); - memcpy(current_pos, shm_name, SHM_MAX_NAME_BUFF_LEN); -} - -void HelloMessage::Deserialize(void* data) { - char* current_pos = static_cast(data); - uint16_t net_msg_len; - memcpy(&net_msg_len, current_pos, sizeof(net_msg_len)); - msg_len = butil::NetToHost16(net_msg_len); - current_pos += sizeof(net_msg_len); - uint16_t net_hello_ver; - memcpy(&net_hello_ver, current_pos, sizeof(net_hello_ver)); - hello_ver = butil::NetToHost16(net_hello_ver); - current_pos += sizeof(net_hello_ver); - uint16_t net_impl_ver; - memcpy(&net_impl_ver, current_pos, sizeof(net_impl_ver)); - impl_ver = butil::NetToHost16(net_impl_ver); - current_pos += sizeof(net_impl_ver); - uint64_t net_len; - memcpy(&net_len, current_pos, sizeof(net_len)); - len = butil::NetToHost64(net_len); - current_pos += sizeof(net_len); - memcpy(shm_name, current_pos, SHM_MAX_NAME_BUFF_LEN); -} - -std::string HelloMessage::toString() const { - constexpr size_t MAX_LEN = 16 + 6 + 16 + 6 + 16 + 6 + 20 + 6 + SHM_MAX_NAME_BUFF_LEN + 32; - std::array buf; - int n = snprintf(buf.data(), buf.size(), - "msg_len=%u, hello_ver=%u, impl_ver=%u, len=%lu, shm_name=%.*s", - msg_len, - hello_ver, - impl_ver, - static_cast(len), // compatible with 32/64-bit - static_cast(SHM_MAX_NAME_BUFF_LEN), // limit max output length - shm_name - ); - return std::string(buf.data(), static_cast(n)); -} +static butil::Mutex *g_ubring_resource_mutex = NULL; -UBShmEndpoint::UBShmEndpoint(Socket* s) - : _socket(s) - , _socket_id(s ? s->id() : INVALID_SOCKET_ID) - , _state(UNINIT) - , _ub_ring(nullptr) - , _cq_sid(INVALID_SOCKET_ID) -{ - _read_butex = bthread::butex_create_checked>(); -} +UBShmEndpoint::UBShmEndpoint(Socket *s) + : _socket(s), _socket_id(s ? s->id() : INVALID_SOCKET_ID), + _ub_ring(nullptr), _cq_sid(INVALID_SOCKET_ID) {} -UBShmEndpoint::~UBShmEndpoint() { - Reset(); - bthread::butex_destroy(_read_butex); -} +UBShmEndpoint::~UBShmEndpoint() { Reset(); } void UBShmEndpoint::Reset() { - DeallocateResources(); + DeallocateResources(); - delete _ub_ring; - _ub_ring = nullptr; - _cq_sid = INVALID_SOCKET_ID; - _state = UNINIT; + delete _ub_ring; + _ub_ring = nullptr; + _cq_sid = INVALID_SOCKET_ID; } -void UBConnect::StartConnect(const Socket* socket, - void (*done)(int err, void* data), - void* data) { - auto* ub_transport = static_cast(socket->_transport.get()); - CHECK(ub_transport->_ub_ep != nullptr); - SocketUniquePtr s; - if (Socket::Address(socket->id(), &s) != 0) { - return; - } - if (!IsUBAvailable()) { - ub_transport->_ub_ep->_state = UBShmEndpoint::FALLBACK_TCP; - ub_transport->_ub_state = UBShmTransport::UB_OFF; - done(0, data); - return; - } - _done = done; - _data = data; - bthread_t tid; - bthread_attr_t attr = BTHREAD_ATTR_NORMAL; - bthread_attr_set_name(&attr, "UBProcessHandshakeAtClient"); - if (bthread_start_background(&tid, &attr, - UBShmEndpoint::ProcessHandshakeAtClient, ub_transport->_ub_ep) < 0) { - LOG(FATAL) << "Fail to start handshake bthread"; - Run(); - } else { - s.release(); - } -} - -void UBConnect::StopConnect(Socket* socket) { } - -void UBConnect::Run() { - _done(errno, _data); -} - -static void TryReadOnTcpDuringRdmaEst(Socket* s) { - int progress = Socket::PROGRESS_INIT; - while (true) { - uint8_t tmp; - ssize_t nr = read(s->fd(), &tmp, 1); - if (nr < 0) { - if (errno != EAGAIN) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read from " << s; - s->SetFailed(saved_errno, "Fail to read from %s: %s", - s->description().c_str(), berror(saved_errno)); - return; - } - if (!s->MoreReadEvents(&progress)) { - break; - } - } else if (nr == 0) { - s->SetEOF(); - return; - } else { - LOG(WARNING) << "Read unexpected data from " << s; - s->SetFailed(EPROTO, "Read unexpected data from %s", - s->description().c_str()); - return; - } - } -} - -void UBShmEndpoint::OnNewDataFromTcp(Socket* m) { - auto* ub_transport = static_cast(m->_transport.get()); - UBShmEndpoint* ep = ub_transport->GetUBShmEp(); - CHECK(ep != nullptr); - - int progress = Socket::PROGRESS_INIT; - while (true) { - if (ep->_state == UNINIT) { - if (!m->CreatedByConnect()) { - if (!IsUBAvailable()) { - ep->_state = FALLBACK_TCP; - ub_transport->_ub_state = UBShmTransport::UB_OFF; - continue; - } - bthread_t tid; - ep->_state = S_HELLO_WAIT; - SocketUniquePtr s; - m->ReAddress(&s); - bthread_attr_t attr = BTHREAD_ATTR_NORMAL; - bthread_attr_set_name(&attr, "UBProcessHandshakeAtServer"); - if (bthread_start_background(&tid, &attr, - ProcessHandshakeAtServer, ep) < 0) { - ep->_state = UNINIT; - LOG(FATAL) << "Fail to start handshake bthread"; - } else { - s.release(); - } - } else { - // The connection may be closed or reset before the client - // starts handshake. This will be handled by client handshake. - // Ignore the exception here. - } - } else if (ep->_state < ESTABLISHED) { // during handshake - ep->_read_butex->fetch_add(1, butil::memory_order_release); - bthread::butex_wake(ep->_read_butex); - } else if (ep->_state == FALLBACK_TCP){ // handshake finishes - InputMessenger::OnNewMessages(m); - return; - } else if (ep->_state == ESTABLISHED) { - TryReadOnTcpDuringRdmaEst(ep->_socket); - return; - } - if (!m->MoreReadEvents(&progress)) { - break; - } - } -} -bool HelloNegotiationValid(HelloMessage& msg) { - if (msg.hello_ver == g_ub_hello_version && - msg.impl_ver == g_ub_impl_version) { - // This can be modified for future compatibility - return true; - } +bool UBShmEndpoint::IsWritable() const { + if (BAIDU_UNLIKELY(g_skip_ub_init)) { + // Just for UT return false; + } + auto ret = _ub_ring->IsUbrTrxWriteable(EPOLLET); + if (ret == 0) { + return true; + } + return false; } -static const int WAIT_TIMEOUT_MS = 50; - -int UBShmEndpoint::ReadFromFd(void* data, size_t len) { - CHECK(data != nullptr); - int nr = 0; - size_t received = 0; - do { - const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); - nr = read(_socket->fd(), (uint8_t*)data + received, len - received); - if (nr < 0) { - if (errno == EAGAIN) { - const int expected_val = _read_butex->load(butil::memory_order_acquire); - if (bthread::butex_wait(_read_butex, expected_val, &duetime) < 0) { - if (errno != EWOULDBLOCK && errno != ETIMEDOUT) { - return -1; - } - } - } else { - return -1; - } - } else if (nr == 0) { - errno = EEOF; - return -1; - } else { - received += nr; - } - } while (received < len); - return 0; -} - -int UBShmEndpoint::WriteToFd(void* data, size_t len) { - CHECK(data != nullptr); - int nw = 0; - size_t written = 0; - do { - const timespec duetime = butil::milliseconds_from_now(WAIT_TIMEOUT_MS); - nw = write(_socket->fd(), (uint8_t*)data + written, len - written); - if (nw < 0) { - if (errno == EAGAIN) { - if (_socket->WaitEpollOut(_socket->fd(), true, &duetime) < 0) { - if (errno != ETIMEDOUT) { - return -1; - } - } - } else { - return -1; - } - } else { - written += nw; - } - } while (written < len); +ssize_t UBShmEndpoint::CutFromIOBufList(butil::IOBuf **from, size_t ndata) { + if (BAIDU_UNLIKELY(g_skip_ub_init)) { + // Just for UT + errno = EAGAIN; + return -1; + } + if (BAIDU_UNLIKELY(ndata == 0)) { return 0; -} - -inline void UBShmEndpoint::TryReadOnTcp() { - if (_socket->_nevent.fetch_add(1, butil::memory_order_acq_rel) == 0) { - if (_state == FALLBACK_TCP) { - InputMessenger::OnNewMessages(_socket); - } else if (_state == ESTABLISHED) { - TryReadOnTcpDuringRdmaEst(_socket); - } - } -} - -void* UBShmEndpoint::ProcessHandshakeAtClient(void* arg) { - UBShmEndpoint* ep = static_cast(arg); - SocketUniquePtr s(ep->_socket); - UBConnect::RunGuard rg((UBConnect*)s->_app_connect.get()); - - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Start handshake on " << s->_local_side; - - uint8_t data[g_ub_hello_msg_len]; - - ep->_state = C_ALLOC_SHM; - auto* ub_transport = static_cast(s->_transport.get()); - size_t local_shm_len = (size_t)(FLAGS_data_queue_size) * MB_TO_BYTE; - SHM local_trx_shm = {nullptr, local_shm_len, 0, {0}, (uint32_t)s->fd()}; - auto shm_name_str = butil::endpoint2str(s->local_side()); - const char* shm_name = shm_name_str.c_str(); - if (ep->AllocateClientResources(&local_trx_shm, shm_name) < 0) { - LOG(WARNING) << "Fallback to tcp:" << s->description(); - ub_transport->_ub_state = UBShmTransport::UB_OFF; - ep->_state = FALLBACK_TCP; - return nullptr; - } - - ep->_state = C_HELLO_SEND; - HelloMessage local_msg; - local_msg.msg_len = g_ub_hello_msg_len; - local_msg.hello_ver = g_ub_hello_version; - local_msg.impl_ver = g_ub_impl_version; - local_msg.len = local_shm_len; - memcpy(local_msg.shm_name, local_trx_shm.name, SHM_MAX_NAME_BUFF_LEN); - memcpy(data, MAGIC_STR, MAGIC_STR_LEN); - local_msg.Serialize((char*)data + MAGIC_STR_LEN); - if (ep->WriteToFd(data, g_ub_hello_msg_len) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to send hello message to server:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - LOG_IF(INFO, FLAGS_ub_trace_verbose) << "client handshake message : " << local_msg.toString(); - - ep->_state = C_HELLO_WAIT; - if (ep->ReadFromFd(data, MAGIC_STR_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to get hello message from server:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - if (memcmp(data, MAGIC_STR, MAGIC_STR_LEN) != 0) { - LOG(WARNING) << "Read unexpected data during handshake:" << s->description(); - s->SetFailed(EPROTO, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(EPROTO)); - ep->_state = FAILED; - return nullptr; - } - - if (ep->ReadFromFd(data, HELLO_MSG_LEN_MIN - MAGIC_STR_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to get Hello Message from server:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - HelloMessage remote_msg; - remote_msg.Deserialize(data); - if (remote_msg.msg_len < HELLO_MSG_LEN_MIN) { - LOG(WARNING) << "Fail to parse Hello Message length from server:" - << s->description(); - s->SetFailed(EPROTO, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(EPROTO)); - ep->_state = FAILED; - return nullptr; - } - - if (remote_msg.msg_len > HELLO_MSG_LEN_MIN) { - // TODO: Read Hello Message customized data - // Just for future use, should not happen now - } - - if (!HelloNegotiationValid(remote_msg)) { - LOG(WARNING) << "Fail to negotiate with server, fallback to tcp:" - << s->description(); - ub_transport->_ub_state = UBShmTransport::UB_OFF; + } + struct iovec vec[IOBUF_IOV_MAX]; + size_t nvec = 0; + for (size_t i = 0; i < ndata; ++i) { + const butil::IOBuf *p = from[i]; + const size_t nref = p->backing_block_num(); + for (size_t j = 0; j < nref && nvec < IOBUF_IOV_MAX; ++j, ++nvec) { + butil::StringPiece sp = p->backing_block(j); + vec[nvec].iov_base = const_cast(sp.data()); + vec[nvec].iov_len = sp.size(); + } + } + + ssize_t nw = 0; + errno = 0; + nw = _ub_ring->UbrTrxWritev(vec, nvec); + if (UNLIKELY(nw == -1)) { + if (errno == EMSGSIZE) { + LOG(ERROR) << "Non-blocking send msg failed, message is larger than " + "ubring capacity."; } else { - ep->_state = C_MAP_REMOTE_SHM; - if (ep->_ub_ring->UbrMapRemoteShm(&local_trx_shm, shm_name) < 0) { - LOG(WARNING) << "Fail to map the remote shm, fallback to tcp:" << s->description(); - ub_transport->_ub_state = UBShmTransport::UB_OFF; - } else { - ub_transport->_ub_state = UBShmTransport::UB_ON; - } - } - - ep->_state = C_ACK_SEND; - uint32_t flags = 0; - if (ub_transport->_ub_state != UBShmTransport::UB_OFF) { - flags |= ACK_MSG_UB_OK; - } - uint32_t* tmp = (uint32_t*)data; - *tmp = butil::HostToNet32(flags); - if (ep->WriteToFd(data, ACK_MSG_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to send Ack Message to server:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - - if (ub_transport->_ub_state == UBShmTransport::UB_ON) { - ep->_state = ESTABLISHED; - ep->_ub_ring->UbrUnlinkLocalShm(); - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Client handshake ends (use ubring) on " << s->description(); - } else { - ep->_state = FALLBACK_TCP; - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Client handshake ends (use tcp) on " << s->description(); - } - - errno = 0; - - return nullptr; -} - -void* UBShmEndpoint::ProcessHandshakeAtServer(void* arg) { - UBShmEndpoint* ep = static_cast(arg); - SocketUniquePtr s(ep->_socket); - - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Start handshake on " << s->description(); - - uint8_t data[g_ub_hello_msg_len]; - - ep->_state = S_HELLO_WAIT; - if (ep->ReadFromFd(data, MAGIC_STR_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read Hello Message from client:" << s->description() << " " << s->_remote_side; - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - auto* ub_transport = static_cast(s->_transport.get()); - if (memcmp(data, MAGIC_STR, MAGIC_STR_LEN) != 0) { - LOG_IF(INFO, FLAGS_ub_trace_verbose) << "It seems that the " - << "client does not use RDMA, fallback to TCP:" - << s->description(); - s->_read_buf.append(data, MAGIC_STR_LEN); - ep->_state = FALLBACK_TCP; - ub_transport->_ub_state = UBShmTransport::UB_OFF; - ep->TryReadOnTcp(); - return nullptr; - } - - if (ep->ReadFromFd(data, g_ub_hello_msg_len - MAGIC_STR_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read Hello Message from client:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - - HelloMessage remote_msg; - remote_msg.Deserialize(data); - LOG_IF(INFO, FLAGS_ub_trace_verbose) << "server receive handshake message : " << remote_msg.toString(); - if (remote_msg.msg_len < HELLO_MSG_LEN_MIN) { - LOG(WARNING) << "Fail to parse Hello Message length from client:" - << s->description(); - s->SetFailed(EPROTO, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(EPROTO)); - ep->_state = FAILED; - return nullptr; - } - if (remote_msg.msg_len > HELLO_MSG_LEN_MIN) { - // TODO: Read Hello Message customized header - // Just for future use, should not happen now - } - - if (!HelloNegotiationValid(remote_msg)) { - LOG(WARNING) << "Fail to negotiate with client, fallback to tcp:" - << s->description(); - ub_transport->_ub_state = UBShmTransport::UB_OFF; - } else { - ep->_state = S_ALLOC_SHM; - ubring::SHM remote_trx_shm = {nullptr, remote_msg.len, 0, {0}, (uint32_t)ep->_socket->fd()}; - strncpy(remote_trx_shm.name, remote_msg.shm_name, SHM_MAX_NAME_BUFF_LEN); - - size_t local_shm_len = (size_t)(FLAGS_data_queue_size) * MB_TO_BYTE; - // server-side shared memory name - ubring::SHM local_trx_shm = {nullptr, local_shm_len, 0, {0}, (uint32_t)ep->_socket->fd()}; - char client_name[SHM_MAX_NAME_BUFF_LEN]; - strncpy(client_name, remote_msg.shm_name, SHM_MAX_NAME_BUFF_LEN); - - char *client_ip_port = strrchr(client_name, '_'); - if (client_ip_port != nullptr) { - *client_ip_port = '\0'; - } - int result = snprintf(local_trx_shm.name, SHM_MAX_NAME_BUFF_LEN, "%s_%s", - client_name, SERVER_SHM_NAME_SUFFIX); - if (UNLIKELY(result < 0)) { - LOG(WARNING) << "Copy client shared memory name failed, ret=" << result; - ub_transport->_ub_state = UBShmTransport::UB_OFF; - } - if (result >= 0 && ep->AllocateServerResources(&remote_trx_shm, &local_trx_shm) < 0) { - LOG(WARNING) << "Fail to allocate ub resources, fallback to tcp:" - << s->description(); - ub_transport->_ub_state = UBShmTransport::UB_OFF; - } - } - - ep->_state = S_HELLO_SEND; - HelloMessage local_msg; - local_msg.msg_len = g_ub_hello_msg_len; - if (ub_transport->_ub_state == UBShmTransport::UB_OFF) { - local_msg.impl_ver = 0; - local_msg.hello_ver = 0; - } else { - local_msg.hello_ver = g_ub_hello_version; - local_msg.impl_ver = g_ub_impl_version; - local_msg.len = (FLAGS_data_queue_size) * MB_TO_BYTE; - memcpy(local_msg.shm_name, remote_msg.shm_name, SHM_MAX_NAME_BUFF_LEN); - } - memcpy(data, MAGIC_STR, MAGIC_STR_LEN); - local_msg.Serialize((char*)data + MAGIC_STR_LEN); - if (ep->WriteToFd(data, g_ub_hello_msg_len) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to send Hello Message to client:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ub handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - - ep->_state = S_ACK_WAIT; - if (ep->ReadFromFd(data, ACK_MSG_LEN) < 0) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read ack message from client:" << s->description(); - s->SetFailed(saved_errno, "Fail to complete ubring handshake from %s: %s", - s->description().c_str(), berror(saved_errno)); - ep->_state = FAILED; - return nullptr; - } - - uint32_t* tmp = (uint32_t*)data; - uint32_t flags = butil::NetToHost32(*tmp); - if (flags & ACK_MSG_UB_OK) { - if (ub_transport->_ub_state == UBShmTransport::UB_OFF) { - LOG(WARNING) << "Fail to parse Hello Message length from client:" - << s->description(); - s->SetFailed(EPROTO, "Fail to complete ub handshake from %s: %s", - s->description().c_str(), berror(EPROTO)); - ep->_state = FAILED; - return nullptr; - } else { - ub_transport->_ub_state = UBShmTransport::UB_ON; - ep->_state = ESTABLISHED; - ep->_ub_ring->UbrUnlinkLocalShm(); - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Server handshake ends (use ubring) on " << s->description(); - } - } else { - ub_transport->_ub_state = UBShmTransport::UB_OFF; - ep->_state = FALLBACK_TCP; - LOG_IF(INFO, FLAGS_ub_trace_verbose) - << "Server handshake ends (use tcp) on " << s->description(); - } - ep->TryReadOnTcp(); - - return nullptr; -} - -bool UBShmEndpoint::IsWritable() const { - if (BAIDU_UNLIKELY(g_skip_ub_init)) { - // Just for UT - return false; - } - auto ret = _ub_ring->IsUbrTrxWriteable(EPOLLET); - if (ret == 0) { - return true; - } - return false; -} - -ssize_t UBShmEndpoint::CutFromIOBufList(butil::IOBuf** from, size_t ndata) { - if (BAIDU_UNLIKELY(g_skip_ub_init)) { - // Just for UT - errno = EAGAIN; - return -1; - } - if (BAIDU_UNLIKELY(ndata == 0)) { - return 0; - } - struct iovec vec[IOBUF_IOV_MAX]; - size_t nvec = 0; - for (size_t i = 0; i < ndata; ++i) { - const butil::IOBuf* p = from[i]; - const size_t nref = p->backing_block_num(); - for (size_t j = 0; j < nref && nvec < IOBUF_IOV_MAX; ++j, ++nvec) { - butil::StringPiece sp = p->backing_block(j); - vec[nvec].iov_base = const_cast(sp.data()); - vec[nvec].iov_len = sp.size(); - } - } - - ssize_t nw = 0; - errno = 0; - nw = _ub_ring->UbrTrxWritev(vec, nvec); - if (UNLIKELY(nw == -1)) { - if (errno == EMSGSIZE) { - LOG(ERROR) << "Non-blocking send msg failed, message is larger than ubring capacity."; - } else { - LOG(ERROR) << "Non-blocking send msg in failed, connection has been closed."; - errno = EPIPE; - } - } else if (UNLIKELY(nw == UBRING_RETRY)) { - errno = EAGAIN; - nw = -1; - } - if (nw <= 0) { - return nw; - } - size_t npop_all = nw; - for (size_t i = 0; i < ndata; ++i) { - npop_all -= from[i]->pop_front(npop_all); - if (npop_all == 0) { - break; - } - } + LOG(ERROR) + << "Non-blocking send msg in failed, connection has been closed."; + errno = EPIPE; + } + } else if (UNLIKELY(nw == UBRING_RETRY)) { + errno = EAGAIN; + nw = -1; + } + if (nw <= 0) { return nw; + } + size_t npop_all = nw; + for (size_t i = 0; i < ndata; ++i) { + npop_all -= from[i]->pop_front(npop_all); + if (npop_all == 0) { + break; + } + } + return nw; } -int UBShmEndpoint::AllocateClientResources(ubring::SHM* local_trx_shm, const char* shm_name) { - if (BAIDU_UNLIKELY(g_skip_ub_init)) { - // For UT - return 0; - } - - CHECK(_ub_ring == nullptr); - // TODO: Pooling management - _ub_ring = new UBRing(); - - SocketOptions options; - options.user = this; - options.keytable_pool = _socket->_keytable_pool; - if (Socket::Create(options, &_cq_sid) < 0) { - PLOG(WARNING) << "Fail to create socket for cq"; - return -1; - } - int ret = _ub_ring->UbrAllocateLocalShm(local_trx_shm, shm_name); - if (ret != 0) { - return ret; - } - PollerRegisterEvent(CqSidOp::ADD, EPOLLIN); +int UBShmEndpoint::AllocateClientResources(ubring::SHM *local_trx_shm, + const char *shm_name) { + if (BAIDU_UNLIKELY(g_skip_ub_init)) { + // For UT return 0; + } + + CHECK(_ub_ring == nullptr); + // TODO: Pooling management + _ub_ring = new UBRing(); + + SocketOptions options; + options.user = this; + options.keytable_pool = _socket->_keytable_pool; + if (Socket::Create(options, &_cq_sid) < 0) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to create socket for cq"; + delete _ub_ring; + _ub_ring = NULL; + _cq_sid = INVALID_SOCKET_ID; + errno = saved_errno; + return -1; + } + int ret = _ub_ring->UbrAllocateLocalShm(local_trx_shm, shm_name); + if (ret != 0) { + const int saved_errno = errno; + DeallocateResources(); + delete _ub_ring; + _ub_ring = NULL; + _cq_sid = INVALID_SOCKET_ID; + errno = saved_errno; + return ret; + } + PollerRegisterEvent(CqSidOp::ADD, EPOLLIN); + return 0; } -int UBShmEndpoint::AllocateServerResources(ubring::SHM* remote_trx_shm, ubring::SHM* local_trx_shm) { - if (BAIDU_UNLIKELY(g_skip_ub_init)) { - // For UT - return 0; - } - - CHECK(_ub_ring == nullptr); - // TODO: Pooling management - _ub_ring = new UBRing(); - - SocketOptions options; - options.user = this; - options.keytable_pool = _socket->_keytable_pool; - if (Socket::Create(options, &_cq_sid) < 0) { - PLOG(WARNING) << "Fail to create socket for cq"; - return -1; - } - int ret = _ub_ring->UbrAllocateServerShm(remote_trx_shm, local_trx_shm); - if (ret != 0) { - return ret; - } - // TODO mwj should polling start after the connection is established? - PollerRegisterEvent(CqSidOp::ADD, EPOLLIN); +int UBShmEndpoint::AllocateServerResources(ubring::SHM *remote_trx_shm, + ubring::SHM *local_trx_shm) { + if (BAIDU_UNLIKELY(g_skip_ub_init)) { + // For UT + return 0; + } + + CHECK(_ub_ring == nullptr); + // TODO: Pooling management + _ub_ring = new UBRing(); + + SocketOptions options; + options.user = this; + options.keytable_pool = _socket->_keytable_pool; + if (Socket::Create(options, &_cq_sid) < 0) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to create socket for cq"; + delete _ub_ring; + _ub_ring = NULL; + _cq_sid = INVALID_SOCKET_ID; + errno = saved_errno; + return -1; + } + int ret = _ub_ring->UbrAllocateServerShm(remote_trx_shm, local_trx_shm); + if (ret != 0) { + const int saved_errno = errno; + DeallocateResources(); + delete _ub_ring; + _ub_ring = NULL; + _cq_sid = INVALID_SOCKET_ID; + errno = saved_errno; return ret; + } + // TODO mwj should polling start after the connection is established? + PollerRegisterEvent(CqSidOp::ADD, EPOLLIN); + return ret; } void UBShmEndpoint::DeallocateResources() { - if (!_ub_ring) { - return; - } - PollerRegisterEvent(CqSidOp::REMOVE); - _ub_ring->UbrTrxClose(); - if (INVALID_SOCKET_ID != _cq_sid) { - SocketUniquePtr s; - if (Socket::Address(_cq_sid, &s) == 0) { - s->_user = nullptr; - s->_fd = -1; - s->SetFailed(); - } - } -} - -void UBShmEndpoint::PollIn(UBShmEndpoint* ep, uint32_t ep_event) { + if (!_ub_ring) { + return; + } + PollerRegisterEvent(CqSidOp::REMOVE); + _ub_ring->UbrTrxClose(); + if (INVALID_SOCKET_ID != _cq_sid) { SocketUniquePtr s; - if (Socket::Address(ep->_socket_id, &s) < 0) { - return; + if (Socket::Address(_cq_sid, &s) == 0) { + s->_user = nullptr; + s->_fd = -1; + s->SetFailed(); } - auto* ub_transport = static_cast(s->_transport.get()); - CHECK(ep == ub_transport->_ub_ep); - - InputMessageClosure last_msg; - while (true) { - int ret = ep->_ub_ring->IsUbrTrxReadable(ep_event); - if (ret < 0) { - return; - } - - bool read_eof = false; - while (!read_eof) { - const int64_t received_us = butil::cpuwide_time_us(); - const int64_t base_realtime = butil::gettimeofday_us() - received_us; - - size_t once_read = s->_avg_msg_size * 16; - if (once_read < MIN_ONCE_READ) { - once_read = MIN_ONCE_READ; - } else if (once_read > MAX_ONCE_READ) { - once_read = MAX_ONCE_READ; - } - - const ssize_t nr = s->_read_buf.append_from_reader(ep->_ub_ring, once_read); - if (nr <= 0) { - if (0 == nr) { - // Set `read_eof' flag and proceed to feed EOF into `Protocol' - // (implied by m->_read_buf.empty), which may produce a new - // `InputMessageBase' under some protocols such as HTTP - LOG_IF(WARNING, FLAGS_log_connection_close) << *s << " was closed by remote side"; - read_eof = true; - } else if (errno != EAGAIN) { - if (errno == EINTR) { - continue; - } - const int saved_errno = errno; - PLOG(WARNING) << "Fail to read from " << *s; - s->SetFailed(saved_errno, "Fail to read from %s: %s", - s->description().c_str(), berror(saved_errno)); - return; - } else { - return; - } - } - - InputMessenger* messenger = static_cast(s->user()); - if (messenger->ProcessNewMessage(s.get(), nr, read_eof, received_us, - base_realtime, last_msg) < 0) { - return; - } - } + } +} - if (read_eof) { - s->SetEOF(); +void UBShmEndpoint::PollIn(UBShmEndpoint *ep, uint32_t ep_event) { + SocketUniquePtr s; + if (Socket::Address(ep->_socket_id, &s) < 0) { + return; + } + UBShmTransport *ub_transport = UBShmTransport::Get(s.get()); + CHECK(ep == ub_transport->_ub_ep); + + InputMessageClosure last_msg; + while (true) { + int ret = ep->_ub_ring->IsUbrTrxReadable(ep_event); + if (ret < 0) { + return; + } + + bool read_eof = false; + while (!read_eof) { + const int64_t received_us = butil::cpuwide_time_us(); + const int64_t base_realtime = butil::gettimeofday_us() - received_us; + + size_t once_read = s->_avg_msg_size * 16; + if (once_read < MIN_ONCE_READ) { + once_read = MIN_ONCE_READ; + } else if (once_read > MAX_ONCE_READ) { + once_read = MAX_ONCE_READ; + } + + const ssize_t nr = + s->_read_buf.append_from_reader(ep->_ub_ring, once_read); + if (nr <= 0) { + if (0 == nr) { + // Set `read_eof' flag and proceed to feed EOF into `Protocol' + // (implied by m->_read_buf.empty), which may produce a new + // `InputMessageBase' under some protocols such as HTTP + LOG_IF(WARNING, FLAGS_log_connection_close) + << *s << " was closed by remote side"; + read_eof = true; + } else if (errno != EAGAIN) { + if (errno == EINTR) { + continue; + } + const int saved_errno = errno; + PLOG(WARNING) << "Fail to read from " << *s; + s->SetFailed(saved_errno, "Fail to read from %s: %s", + s->description().c_str(), berror(saved_errno)); + return; + } else { + return; } - } -} + } -void UBShmEndpoint::PollOut(UBShmEndpoint* ep, uint32_t ep_event) { - SocketUniquePtr s; - if (Socket::Address(ep->_socket_id, &s) < 0) { + InputMessenger *messenger = static_cast(s->user()); + if (messenger->ProcessNewMessage(s.get(), nr, read_eof, received_us, + base_realtime, last_msg) < 0) { return; + } } - auto* ub_transport = static_cast(s->_transport.get()); - CHECK(ep == ub_transport->_ub_ep); - if (ep->IsWritable()) { - s->WakeAsEpollOut(); + + if (read_eof) { + s->SetEOF(); } + } +} +void UBShmEndpoint::PollOut(UBShmEndpoint *ep, uint32_t ep_event) { + SocketUniquePtr s; + if (Socket::Address(ep->_socket_id, &s) < 0) { + return; + } + UBShmTransport *ub_transport = UBShmTransport::Get(s.get()); + CHECK(ep == ub_transport->_ub_ep); + if (ep->IsWritable()) { + s->WakeAsEpollOut(); + } } int UBShmEndpoint::GlobalInitialize() { - g_ubring_resource_mutex = new butil::Mutex; - _poller_groups = std::vector(FLAGS_task_group_ntags); - return 0; + g_ubring_resource_mutex = new butil::Mutex; + _poller_groups = std::vector(FLAGS_task_group_ntags); + return 0; } void UBShmEndpoint::GlobalRelease() { - for (int i = 0; i < FLAGS_task_group_ntags; ++i) { - PollingModeRelease(i); - } + for (int i = 0; i < FLAGS_task_group_ntags; ++i) { + PollingModeRelease(i); + } } std::vector UBShmEndpoint::_poller_groups; int UBShmEndpoint::PollingModeInitialize(bthread_tag_t tag, - std::function callback, - std::function init_fn, - std::function release_fn) { - auto& group = _poller_groups[tag]; - auto& pollers = group.pollers; - auto& running = group.running; - bool expected = false; - if (!running.compare_exchange_strong(expected, true)) { - return 0; - } - struct FnArgs { - Poller* poller; - std::atomic* running; - }; - auto fn = [](void* p) -> void* { - std::unique_ptr args(static_cast(p)); - auto poller = args->poller; - auto running = args->running; - std::unordered_set cq_sids; - CqSidOp op; - - if (poller->init_fn) { - poller->init_fn(); + std::function callback, + std::function init_fn, + std::function release_fn) { + auto &group = _poller_groups[tag]; + auto &pollers = group.pollers; + auto &running = group.running; + bool expected = false; + if (!running.compare_exchange_strong(expected, true)) { + return 0; + } + struct FnArgs { + Poller *poller; + std::atomic *running; + }; + auto fn = [](void *p) -> void * { + std::unique_ptr args(static_cast(p)); + auto poller = args->poller; + auto running = args->running; + std::unordered_set cq_sids; + CqSidOp op; + + if (poller->init_fn) { + poller->init_fn(); + } + while (running->load(std::memory_order_relaxed)) { + while (poller->op_queue.Dequeue(op)) { + if (op.type == CqSidOp::ADD) { + cq_sids.emplace(op); + } else if (op.type == CqSidOp::REMOVE) { + cq_sids.erase(op); + + } else if (op.type == CqSidOp::MOD) { + cq_sids.erase(op); + cq_sids.emplace(op); + } + } + for (auto cq : cq_sids) { + SocketUniquePtr s; + if (Socket::Address(cq.sid, &s) < 0) { + continue; } - while (running->load(std::memory_order_relaxed)) { - while (poller->op_queue.Dequeue(op)) { - if (op.type == CqSidOp::ADD) { - cq_sids.emplace(op); - } else if (op.type == CqSidOp::REMOVE) { - cq_sids.erase(op); - - } else if (op.type == CqSidOp::MOD) { - cq_sids.erase(op); - cq_sids.emplace(op); - } - } - for (auto cq : cq_sids) { - SocketUniquePtr s; - if (Socket::Address(cq.sid, &s) < 0) { - continue; - } - UBShmEndpoint* ep = static_cast(s->user()); - if (!ep) { - continue; - } - - if (cq.event & EPOLLIN) { - PollIn(ep, cq.event); - } - - if (cq.event & EPOLLOUT) { - PollOut(ep, cq.event); - } - } - if (poller->callback) { - poller->callback(); - } - if (FLAGS_ub_poller_yield) { - bthread_yield(); - } + UBShmEndpoint *ep = static_cast(s->user()); + if (!ep) { + continue; } - if (poller->release_fn) { - poller->release_fn(); + if (cq.event & EPOLLIN) { + PollIn(ep, cq.event); } - return nullptr; - }; - for (int i = 0; i < FLAGS_ub_poller_num; ++i) { - auto args = new FnArgs{&pollers[i], &running}; - auto attr = FLAGS_ub_disable_bthread ? BTHREAD_ATTR_PTHREAD - : BTHREAD_ATTR_NORMAL; - attr.tag = tag; - bthread_attr_set_name(&attr, "UBPolling"); - pollers[i].callback = callback; - pollers[i].init_fn = init_fn; - pollers[i].release_fn = release_fn; - auto rc = bthread_start_background(&pollers[i].tid, &attr, fn, args); - if (rc != 0) { - LOG(ERROR) << "Fail to start ubring polling bthread"; - return -1; + if (cq.event & EPOLLOUT) { + PollOut(ep, cq.event); } + } + if (poller->callback) { + poller->callback(); + } + if (FLAGS_ub_poller_yield) { + bthread_yield(); + } } - return 0; + + if (poller->release_fn) { + poller->release_fn(); + } + + return nullptr; + }; + for (int i = 0; i < FLAGS_ub_poller_num; ++i) { + auto args = new FnArgs{&pollers[i], &running}; + auto attr = + FLAGS_ub_disable_bthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL; + attr.tag = tag; + bthread_attr_set_name(&attr, "UBPolling"); + pollers[i].callback = callback; + pollers[i].init_fn = init_fn; + pollers[i].release_fn = release_fn; + auto rc = bthread_start_background(&pollers[i].tid, &attr, fn, args); + if (rc != 0) { + LOG(ERROR) << "Fail to start ubring polling bthread"; + return -1; + } + } + return 0; } void UBShmEndpoint::PollingModeRelease(bthread_tag_t tag) { - auto& group = _poller_groups[tag]; - auto& pollers = group.pollers; - auto& running = group.running; - running.store(false, std::memory_order_relaxed); - for (int i = 0; i < FLAGS_ub_poller_num; ++i) { - bthread_join(pollers[i].tid, nullptr); - } + auto &group = _poller_groups[tag]; + auto &pollers = group.pollers; + auto &running = group.running; + running.store(false, std::memory_order_relaxed); + for (int i = 0; i < FLAGS_ub_poller_num; ++i) { + bthread_join(pollers[i].tid, nullptr); + } } void UBShmEndpoint::PollerRegisterEvent(CqSidOp::OpType op, uint32_t events) { - auto index = butil::fmix32(_cq_sid) % FLAGS_ub_poller_num; - auto& group = _poller_groups[bthread_self_tag()]; - auto& pollers = group.pollers; - auto& poller = pollers[index]; - if (INVALID_SOCKET_ID != _cq_sid) { - poller.op_queue.Enqueue(CqSidOp{_cq_sid, events, op}); - } + auto index = butil::fmix32(_cq_sid) % FLAGS_ub_poller_num; + auto &group = _poller_groups[bthread_self_tag()]; + auto &pollers = group.pollers; + auto &poller = pollers[index]; + if (INVALID_SOCKET_ID != _cq_sid) { + poller.op_queue.Enqueue(CqSidOp{_cq_sid, events, op}); + } } -} // namespace ubring -} // namespace brpc +} // namespace ubring +} // namespace brpc -#endif // if BRPC_WITH_UBRING +#endif // if BRPC_WITH_UBRING diff --git a/src/brpc/ubshm/ub_endpoint.h b/src/brpc/ubshm/ub_endpoint.h index 03c5134522..e537719d45 100644 --- a/src/brpc/ubshm/ub_endpoint.h +++ b/src/brpc/ubshm/ub_endpoint.h @@ -20,232 +20,152 @@ #if BRPC_WITH_UBRING -#include -#include -#include -#include -#include -#include "butil/atomicops.h" -#include "butil/iobuf.h" -#include "butil/macros.h" -#include "butil/containers/mpsc_queue.h" +#include "brpc/handshake/ubshm_handshake.h" #include "brpc/socket.h" +#include "brpc/ubshm/shm/shm_def.h" #include "brpc/ubshm/ub_helper.h" #include "brpc/ubshm/ub_ring.h" -#include "brpc/ubshm/shm/shm_def.h" - +#include "butil/atomicops.h" +#include "butil/containers/mpsc_queue.h" +#include "butil/iobuf.h" +#include "butil/macros.h" +#include +#include namespace brpc { class Socket; +class UBShmTransport; +namespace handshake { +class UBShmServerHandshakeAdapter; +} namespace ubring { DECLARE_int32(ub_poller_num); DECLARE_bool(ub_edisp_unsched); DECLARE_bool(ub_disable_bthread); -struct HelloMessage { - void Serialize(void* data) const; - void Deserialize(void* data); - std::string toString() const; - - uint16_t msg_len; - uint16_t hello_ver; - uint16_t impl_ver; - uint64_t len; - char shm_name[SHM_MAX_NAME_BUFF_LEN]; -}; +class BAIDU_CACHELINE_ALIGNMENT UBShmEndpoint : public SocketUser { + friend class Socket; + friend class ::brpc::UBShmTransport; + friend class ::brpc::handshake::UBShmServerHandshakeAdapter; -class UBConnect : public AppConnect { public: - void StartConnect(const Socket* socket, - void (*done)(int err, void* data), void* data) override; - void StopConnect(Socket*) override; - struct RunGuard { - RunGuard(UBConnect* rc) { this_rc = rc; } - ~RunGuard() { if (this_rc) this_rc->Run(); } - UBConnect* this_rc; - }; + explicit UBShmEndpoint(Socket *s); + ~UBShmEndpoint() override; -private: - void Run(); - void (*_done)(int, void*){nullptr}; - void* _data{nullptr}; -}; + // Global initialization + // Return 0 if success, -1 if failed and errno set + static int GlobalInitialize(); -class BAIDU_CACHELINE_ALIGNMENT UBShmEndpoint : public SocketUser { -friend class UBConnect; -friend class Socket; -public: - explicit UBShmEndpoint(Socket* s); - ~UBShmEndpoint() override; + static void GlobalRelease(); - // Global initialization - // Return 0 if success, -1 if failed and errno set - static int GlobalInitialize(); + // Reset the endpoint (for next use) + void Reset(); - static void GlobalRelease(); + // Cut data from the given IOBuf list and use UBRING to send + // Return bytes cut if success, -1 if failed and errno set + ssize_t CutFromIOBufList(butil::IOBuf **data, size_t ndata); - // Reset the endpoint (for next use) - void Reset(); + // Whether the endpoint can send more data + bool IsWritable() const; - // Cut data from the given IOBuf list and use UBRING to send - // Return bytes cut if success, -1 if failed and errno set - ssize_t CutFromIOBufList(butil::IOBuf** data, size_t ndata); + void PollerRegisterEpollOut(bool pollin) { + uint32_t events = EPOLLOUT | EPOLLET; + if (pollin) { + PollerRegisterEvent(CqSidOp::MOD, events | EPOLLIN); + return; + } + PollerRegisterEvent(CqSidOp::ADD, events); + } + + void PollerUnRegisterEpollOut(bool pollin) { + uint32_t events = EPOLLIN | EPOLLET; + if (pollin) { + PollerRegisterEvent(CqSidOp::MOD, events); + return; + } + PollerRegisterEvent(CqSidOp::REMOVE); + } - // Whether the endpoint can send more data - bool IsWritable() const; + // Initialize polling mode + static int PollingModeInitialize(bthread_tag_t tag, + std::function callback, + std::function init_fn, + std::function release_fn); - void PollerRegisterEpollOut(bool pollin) { - uint32_t events = EPOLLOUT | EPOLLET; - if (pollin) { - PollerRegisterEvent(CqSidOp::MOD, events | EPOLLIN); - return; - } - PollerRegisterEvent(CqSidOp::ADD, events); - } + static void PollingModeRelease(bthread_tag_t tag); - void PollerUnRegisterEpollOut(bool pollin) { - uint32_t events = EPOLLIN | EPOLLET; - if (pollin) { - PollerRegisterEvent(CqSidOp::MOD, events); - return; - } - PollerRegisterEvent(CqSidOp::REMOVE); - } +private: + // Allocate resources + // Return 0 if success, -1 if failed and errno set + int AllocateClientResources(SHM *local_trx_shm, const char *shm_name); - // Callback when there is new epollin event on TCP fd - static void OnNewDataFromTcp(Socket* m); + int AllocateServerResources(SHM *remote_trx_shm, SHM *local_trx_shm); - // Initialize polling mode - static int PollingModeInitialize(bthread_tag_t tag, - std::function callback, - std::function init_fn, - std::function release_fn); + // Release resources + void DeallocateResources(); - static void PollingModeRelease(bthread_tag_t tag); + // Poll CQ and get the work completion + static void PollIn(UBShmEndpoint *ep, uint32_t ep_event); -#ifdef UNIT_TEST -public: -#else -private: -#endif - enum State { - UNINIT = 0x0, - C_ALLOC_SHM = 0x1, - C_HELLO_SEND = 0x2, - C_HELLO_WAIT = 0x3, - C_MAP_REMOTE_SHM = 0x4, - C_ACK_SEND = 0x5, - S_HELLO_WAIT = 0x11, - S_ALLOC_SHM = 0x12, - S_HELLO_SEND = 0x13, - S_ACK_WAIT = 0x14, - ESTABLISHED = 0x100, - FALLBACK_TCP = 0x200, - FAILED = 0x300 - }; - - // Process handshake at the client - static void* ProcessHandshakeAtClient(void* arg); - - // Process handshake at the server - static void* ProcessHandshakeAtServer(void* arg); - - // Allocate resources - // Return 0 if success, -1 if failed and errno set - int AllocateClientResources(SHM* local_trx_shm, const char* shm_name); - - int AllocateServerResources(SHM* remote_trx_shm, SHM* local_trx_shm); - - // Release resources - void DeallocateResources(); - - // Read at most len bytes from fd in _socket to data - // wait for _read_butex if encounter EAGAIN - // return -1 if encounter other errno (including EOF) - int ReadFromFd(void* data, size_t len); - - - // Write at most len bytes from data to fd in _socket - // wait for _epollout_butex if encounter EAGAIN - // return -1 if encounter other errno - int WriteToFd(void* data, size_t len); - - // Poll CQ and get the work completion - static void PollIn(UBShmEndpoint* ep, uint32_t ep_event); - - static void PollOut(UBShmEndpoint* ep, uint32_t ep_event); - - // Try to read data on TCP fd in _socket - inline void TryReadOnTcp(); - - // Not owner - Socket* _socket; - SocketId _socket_id; - - State _state; - - // ub resource - ubring::UBRing* _ub_ring{nullptr}; - - SocketId _cq_sid; - - // butex for inform read events on TCP fd during handshake - butil::atomic *_read_butex; - - DISALLOW_COPY_AND_ASSIGN(UBShmEndpoint); - - struct CqSidOp { - enum OpType { - ADD, - REMOVE, - MOD - }; - SocketId sid; - uint32_t event; - OpType type; - }; - - struct CqSidOpHash { - std::size_t operator()(const CqSidOp& op) const { - return op.sid; - } - }; - - struct CqSidOpEqual { - bool operator()(const CqSidOp& lhs, const CqSidOp& rhs) const { - return lhs.sid == rhs.sid; - } - }; - - // Poller instance - struct BAIDU_CACHELINE_ALIGNMENT Poller { - bthread_t tid{INVALID_BTHREAD}; - butil::MPSCQueue> op_queue; - // Callback used for io_uring/spdk etc - std::function callback; - // Init and Destroy function - std::function init_fn; - std::function release_fn; - }; - // Poller group - struct BAIDU_CACHELINE_ALIGNMENT PollerGroup { - PollerGroup() : pollers(FLAGS_ub_poller_num), running(false) {} - std::vector pollers; - std::atomic running; - }; - static std::vector _poller_groups; - - void PollerRegisterEvent(CqSidOp::OpType op, uint32_t events = EPOLLET); + static void PollOut(UBShmEndpoint *ep, uint32_t ep_event); + + // Not owner + Socket *_socket; + SocketId _socket_id; + + // ub resource + ubring::UBRing *_ub_ring{nullptr}; + + SocketId _cq_sid; + + DISALLOW_COPY_AND_ASSIGN(UBShmEndpoint); + + struct CqSidOp { + enum OpType { ADD, REMOVE, MOD }; + SocketId sid; + uint32_t event; + OpType type; + }; + + struct CqSidOpHash { + std::size_t operator()(const CqSidOp &op) const { return op.sid; } + }; + + struct CqSidOpEqual { + bool operator()(const CqSidOp &lhs, const CqSidOp &rhs) const { + return lhs.sid == rhs.sid; + } + }; + + // Poller instance + struct BAIDU_CACHELINE_ALIGNMENT Poller { + bthread_t tid{INVALID_BTHREAD}; + butil::MPSCQueue> op_queue; + // Callback used for io_uring/spdk etc + std::function callback; + // Init and Destroy function + std::function init_fn; + std::function release_fn; + }; + // Poller group + struct BAIDU_CACHELINE_ALIGNMENT PollerGroup { + PollerGroup() : pollers(FLAGS_ub_poller_num), running(false) {} + std::vector pollers; + std::atomic running; + }; + static std::vector _poller_groups; + + void PollerRegisterEvent(CqSidOp::OpType op, uint32_t events = EPOLLET); }; -} // namespace ubring -} // namespace brpc +} // namespace ubring +} // namespace brpc -#else // if BRPC_WITH_UBRING +#else // if BRPC_WITH_UBRING -class UBShmEndpoint { }; +class UBShmEndpoint {}; #endif -#endif //BRPC_UB_ENDPOINT_H +#endif // BRPC_UB_ENDPOINT_H diff --git a/src/brpc/ubshm_transport.cpp b/src/brpc/ubshm_transport.cpp index df4eb36bed..113134a0b4 100644 --- a/src/brpc/ubshm_transport.cpp +++ b/src/brpc/ubshm_transport.cpp @@ -17,10 +17,16 @@ #if BRPC_WITH_UBRING -#include "brpc/ubshm_transport.h" -#include "brpc/tcp_transport.h" +#include + +#include "brpc/adapter_transport.h" +#include "brpc/errno.pb.h" +#include "brpc/ubshm/common/common.h" #include "brpc/ubshm/ub_endpoint.h" #include "brpc/ubshm/ub_helper.h" +#include "brpc/ubshm/ubr_trx.h" +#include "brpc/ubshm_transport.h" + namespace brpc { DECLARE_bool(usercode_in_coroutine); @@ -28,208 +34,230 @@ DECLARE_bool(usercode_in_pthread); extern SocketVarsCollector *g_vars; +UBShmTransport *UBShmTransport::Get(const Socket *socket) { + const AdapterTransport *adapter = AdapterTransport::Get(socket); + Transport *transport = adapter->high_speed_transport(); + CHECK(transport != NULL); + return static_cast(transport); +} + void UBShmTransport::Init(Socket *socket, const SocketOptions &options) { - CHECK(_ub_ep == nullptr); - if (options.socket_mode == SOCKET_MODE_UBRING) { - _ub_ep = new ubring::UBShmEndpoint(socket); - _ub_state = UB_UNKNOWN; - } else { - _ub_state = UB_OFF; - socket->_socket_mode = SOCKET_MODE_TCP; - } - _socket = socket; - _default_connect = options.app_connect; - _on_edge_trigger = options.on_edge_triggered_events; - if (options.need_on_edge_trigger && _on_edge_trigger == nullptr) { - _on_edge_trigger = ubring::UBShmEndpoint::OnNewDataFromTcp; - } - _tcp_transport = std::make_shared(); - _tcp_transport->Init(socket, options); + CHECK(_ub_ep == nullptr); + _socket = socket; + _default_connect = options.app_connect; + _on_edge_trigger = nullptr; + _ub_ep = new (std::nothrow) ubring::UBShmEndpoint(socket); + if (!_ub_ep) { + const int saved_errno = errno; + PLOG(ERROR) << "Fail to create UBShmEndpoint"; + socket->SetFailed(saved_errno, "Fail to create UBShmEndpoint: %s", + berror(saved_errno)); + } + _ub_state = UB_UNKNOWN; } void UBShmTransport::Release() { - if (_ub_ep) { - delete _ub_ep; - _ub_ep = nullptr; - _ub_state = UB_UNKNOWN; - } + if (_ub_ep) { + delete _ub_ep; + _ub_ep = nullptr; + _ub_state = UB_UNKNOWN; + } } int UBShmTransport::Reset(int32_t expected_nref) { - if (_ub_ep) { - _ub_ep->Reset(); - _ub_state = UB_UNKNOWN; - } - return 0; + if (_ub_ep) { + _ub_ep->Reset(); + _ub_state = UB_UNKNOWN; + } + return 0; } std::shared_ptr UBShmTransport::Connect() { - if (_default_connect == nullptr) { - return std::make_shared(); - } - return _default_connect; + return _default_connect; +} + +void UBShmTransport::SetHighSpeedAvailable(bool available) { + _ub_state = available ? UB_ON : UB_OFF; +} + +int UBShmTransport::PrepareUpgradeResources(ubring::SHM *local_trx_shm, + const char *shm_name) { + return _ub_ep->AllocateClientResources(local_trx_shm, shm_name); +} + +int UBShmTransport::NegotiateUpgradeResources(ubring::SHM *local_trx_shm, + const char *shm_name) { + return _ub_ep->_ub_ring->UbrMapRemoteShm(local_trx_shm, shm_name); +} + +int UBShmTransport::PrepareServerUpgradeResources(ubring::SHM *remote_trx_shm, + ubring::SHM *local_trx_shm) { + return _ub_ep->AllocateServerResources(remote_trx_shm, local_trx_shm); +} + +void UBShmTransport::ActivateUpgrade() { SetHighSpeedAvailable(true); } + +void UBShmTransport::DeactivateUpgrade() { SetHighSpeedAvailable(false); } + +void UBShmTransport::FinishUpgrade() { + if (_ub_ep != NULL && _ub_ep->_ub_ring != NULL) { + _ub_ep->_ub_ring->UbrUnlinkLocalShm(); + } } int UBShmTransport::CutFromIOBuf(butil::IOBuf *buf) { - if (_ub_ep && _ub_state != UB_OFF) { - butil::IOBuf *data_arr[1] = {buf}; - return _ub_ep->CutFromIOBufList(data_arr, 1); - } else { - return _tcp_transport->CutFromIOBuf(buf); - } + butil::IOBuf *data[1] = {buf}; + return static_cast(CutFromIOBufList(data, 1)); } ssize_t UBShmTransport::CutFromIOBufList(butil::IOBuf **buf, size_t ndata) { - if (_ub_ep && _ub_state != UB_OFF) { - return _ub_ep->CutFromIOBufList(buf, ndata); - } - return _tcp_transport->CutFromIOBufList(buf, ndata); + CHECK(_ub_ep != NULL); + return _ub_ep->CutFromIOBufList(buf, ndata); } int UBShmTransport::WaitEpollOut(butil::atomic *_epollout_butex, - bool pollin, const timespec duetime) { - // LOG(INFO) << "mwj pollin4=" << pollin << " duetime=" << butil::timespec_to_microseconds(duetime); - if (_ub_state == UB_ON) { - // LOG(INFO) << "mwj pollin1=" << pollin; - const int expected_val = _epollout_butex->load(butil::memory_order_acquire); - CHECK(_ub_ep != nullptr); - if (!_ub_ep->IsWritable()) { - g_vars->nwaitepollout << 1; - _ub_ep->PollerRegisterEpollOut(pollin); - auto mwj_ret = bthread::butex_wait(_epollout_butex, expected_val, &duetime); - // LOG(INFO) << "mwj pollin2=" << pollin << " mwj_ret=" << mwj_ret; - if (mwj_ret < 0) { - if (errno != EAGAIN && errno != ETIMEDOUT) { - const int saved_errno = errno; - PLOG(WARNING) << "Fail to wait ub window of " << _socket; - _socket->SetFailed(saved_errno, - "Fail to wait ub window of %s: %s", - _socket->description().c_str(), - berror(saved_errno)); - } - if (_socket->Failed()) { - // NOTE: - // Different from TCP, we cannot find the UB channel - // failed by writing to it. Thus we must check if it - // is already failed here. - return 1; - } - } - _ub_ep->PollerUnRegisterEpollOut(pollin); + bool pollin, const timespec duetime) { + // LOG(INFO) << "mwj pollin4=" << pollin << " duetime=" << + // butil::timespec_to_microseconds(duetime); + if (_ub_state == UB_ON) { + // LOG(INFO) << "mwj pollin1=" << pollin; + const int expected_val = _epollout_butex->load(butil::memory_order_acquire); + CHECK(_ub_ep != nullptr); + if (!_ub_ep->IsWritable()) { + g_vars->nwaitepollout << 1; + _ub_ep->PollerRegisterEpollOut(pollin); + auto mwj_ret = + bthread::butex_wait(_epollout_butex, expected_val, &duetime); + // LOG(INFO) << "mwj pollin2=" << pollin << " mwj_ret=" << mwj_ret; + if (mwj_ret < 0) { + if (errno != EAGAIN && errno != ETIMEDOUT) { + const int saved_errno = errno; + PLOG(WARNING) << "Fail to wait ub window of " << _socket; + _socket->SetFailed(saved_errno, "Fail to wait ub window of %s: %s", + _socket->description().c_str(), + berror(saved_errno)); + } + if (_socket->Failed()) { + // NOTE: + // Different from TCP, we cannot find the UB channel + // failed by writing to it. Thus we must check if it + // is already failed here. + return 1; } - } else { - return _tcp_transport->WaitEpollOut(_epollout_butex, pollin, duetime); + } } - // LOG(INFO) << "mwj return 0"; - return 0; + _ub_ep->PollerUnRegisterEpollOut(pollin); + } + return 0; } void UBShmTransport::ProcessEvent(bthread_attr_t attr) { - bthread_t tid; - if (FLAGS_usercode_in_coroutine) { - OnEdge(_socket); - } else if (ubring::FLAGS_ub_edisp_unsched == false) { - auto rc = bthread_start_background(&tid, &attr, OnEdge, _socket); - if (rc != 0) { - LOG(FATAL) << "Fail to start ProcessEvent"; - OnEdge(_socket); - } - } else if (bthread_start_urgent(&tid, &attr, OnEdge, _socket) != 0) { - LOG(FATAL) << "Fail to start ProcessEvent"; - OnEdge(_socket); + bthread_t tid; + if (FLAGS_usercode_in_coroutine) { + OnEdge(_socket); + } else if (ubring::FLAGS_ub_edisp_unsched == false) { + auto rc = bthread_start_background(&tid, &attr, OnEdge, _socket); + if (rc != 0) { + LOG(FATAL) << "Fail to start ProcessEvent"; + OnEdge(_socket); } + } else if (bthread_start_urgent(&tid, &attr, OnEdge, _socket) != 0) { + LOG(FATAL) << "Fail to start ProcessEvent"; + OnEdge(_socket); + } } -void UBShmTransport::QueueMessage(InputMessageClosure& input_msg, - int* num_bthread_created, bool last_msg) { - if (last_msg) { - return; - } - InputMessageBase* to_run_msg = input_msg.release(); - if (!to_run_msg) { - return; - } +void UBShmTransport::QueueMessage(InputMessageClosure &input_msg, + int *num_bthread_created, bool last_msg) { + if (last_msg) { + return; + } + InputMessageBase *to_run_msg = input_msg.release(); + if (!to_run_msg) { + return; + } - if (ubring::FLAGS_ub_disable_bthread) { - ProcessInputMessage(to_run_msg); - return; - } - // Create bthread for last_msg. The bthread is not scheduled - // until bthread_flush() is called (in the worse case). - - // TODO(gejun): Join threads. - bthread_t th; - bthread_attr_t tmp = (FLAGS_usercode_in_pthread ? - BTHREAD_ATTR_PTHREAD : - BTHREAD_ATTR_NORMAL) | BTHREAD_NOSIGNAL; - tmp.keytable_pool = _socket->keytable_pool(); - tmp.tag = bthread_self_tag(); - bthread_attr_set_name(&tmp, "ProcessInputMessage"); - - if (!FLAGS_usercode_in_coroutine && bthread_start_background( - &th, &tmp, ProcessInputMessage, to_run_msg) == 0) { - ++*num_bthread_created; - } else { - ProcessInputMessage(to_run_msg); - } + if (ubring::FLAGS_ub_disable_bthread) { + ProcessInputMessage(to_run_msg); + return; + } + // Create bthread for last_msg. The bthread is not scheduled + // until bthread_flush() is called (in the worse case). + + // TODO(gejun): Join threads. + bthread_t th; + bthread_attr_t tmp = + (FLAGS_usercode_in_pthread ? BTHREAD_ATTR_PTHREAD : BTHREAD_ATTR_NORMAL) | + BTHREAD_NOSIGNAL; + tmp.keytable_pool = _socket->keytable_pool(); + tmp.tag = bthread_self_tag(); + bthread_attr_set_name(&tmp, "ProcessInputMessage"); + + if (!FLAGS_usercode_in_coroutine && + bthread_start_background(&th, &tmp, ProcessInputMessage, to_run_msg) == + 0) { + ++*num_bthread_created; + } else { + ProcessInputMessage(to_run_msg); + } } void UBShmTransport::Debug(std::ostream &os) {} -int UBShmTransport::ContextInitOrDie(bool serverOrNot, const void* _options) { - if (serverOrNot) { - if (!OptionsAvailableOverUB(static_cast(_options))) { - return -1; - } - ubring::GlobalUBInitializeOrDie(); - if (!ubring::InitPollingModeWithTag(static_cast(_options)->bthread_tag)) { - return -1; - } - } else { - if (!OptionsAvailableForUB(static_cast(_options))) { - return -1; - } - ubring::GlobalUBInitializeOrDie(); - if (!ubring::InitPollingModeWithTag(bthread_self_tag())) { - return -1; - } - return 0; +int UBShmTransport::ContextInitOrDie(bool serverOrNot, const void *_options) { + if (serverOrNot) { + if (!OptionsAvailableOverUB(static_cast(_options))) { + return -1; + } + ubring::GlobalUBInitializeOrDie(); + if (!ubring::InitPollingModeWithTag( + static_cast(_options)->bthread_tag)) { + return -1; + } + } else { + if (!OptionsAvailableForUB(static_cast(_options))) { + return -1; + } + ubring::GlobalUBInitializeOrDie(); + if (!ubring::InitPollingModeWithTag(bthread_self_tag())) { + return -1; } - return 0; + } + + return 0; } -bool UBShmTransport::OptionsAvailableForUB(const ChannelOptions* opt) { - if (opt->has_ssl_options()) { - LOG(WARNING) << "Cannot use SSL and UB at the same time"; - return false; - } - if (!ubring::SupportedByUB(opt->protocol.name())) { - LOG(WARNING) << "Cannot use " << opt->protocol.name() - << " over UB"; - return false; - } - return true; +bool UBShmTransport::OptionsAvailableForUB(const ChannelOptions *opt) { + if (opt->has_ssl_options()) { + LOG(WARNING) << "Cannot use SSL and UB at the same time"; + return false; + } + if (!ubring::SupportedByUB(opt->protocol.name())) { + LOG(WARNING) << "Cannot use " << opt->protocol.name() << " over UB"; + return false; + } + return true; } -bool UBShmTransport::OptionsAvailableOverUB(const ServerOptions* opt) { - if (opt->rtmp_service) { - LOG(WARNING) << "RTMP is not supported by UB"; - return false; - } - if (opt->has_ssl_options()) { - LOG(WARNING) << "SSL is not supported by UB"; - return false; - } - if (opt->nshead_service) { - LOG(WARNING) << "NSHEAD is not supported by UB"; - return false; - } - if (opt->mongo_service_adaptor) { - LOG(WARNING) << "MONGO is not supported by UB"; - return false; - } - return true; +bool UBShmTransport::OptionsAvailableOverUB(const ServerOptions *opt) { + if (opt->rtmp_service) { + LOG(WARNING) << "RTMP is not supported by UB"; + return false; + } + if (opt->has_ssl_options()) { + LOG(WARNING) << "SSL is not supported by UB"; + return false; + } + if (opt->nshead_service) { + LOG(WARNING) << "NSHEAD is not supported by UB"; + return false; + } + if (opt->mongo_service_adaptor) { + LOG(WARNING) << "MONGO is not supported by UB"; + return false; + } + return true; } } // namespace brpc -#endif \ No newline at end of file +#endif diff --git a/src/brpc/ubshm_transport.h b/src/brpc/ubshm_transport.h index b3d1e7c518..5cad026e2c 100644 --- a/src/brpc/ubshm_transport.h +++ b/src/brpc/ubshm_transport.h @@ -21,12 +21,14 @@ #include "brpc/socket.h" #include "brpc/channel.h" #include "brpc/transport.h" +#include "brpc/ubshm/shm/shm_def.h" namespace brpc { +class AdapterTransport; class UBShmTransport : public Transport { friend class TransportFactory; + friend class AdapterTransport; friend class ubring::UBShmEndpoint; -friend class ubring::UBConnect; public: void Init(Socket* socket, const SocketOptions& options) override; void Release() override; @@ -34,7 +36,8 @@ friend class ubring::UBConnect; std::shared_ptr Connect() override; int CutFromIOBuf(butil::IOBuf* buf) override; ssize_t CutFromIOBufList(butil::IOBuf** buf, size_t ndata) override; - int WaitEpollOut(butil::atomic* _epollout_butex, bool pollin, const timespec duetime) override; + int WaitEpollOut(butil::atomic* epollout_butex, + bool pollin, timespec duetime) override; void ProcessEvent(bthread_attr_t attr) override; void QueueMessage(InputMessageClosure& inputMsg, int* num_bthread_created, bool last_msg) override; void Debug(std::ostream &os) override; @@ -42,8 +45,21 @@ friend class ubring::UBConnect; CHECK(_ub_ep != nullptr); return _ub_ep; } + static UBShmTransport* Get(const Socket* socket); static int ContextInitOrDie(bool serverOrNot, const void* _options); + int PrepareUpgradeResources(ubring::SHM* local_trx_shm, + const char* shm_name); + int NegotiateUpgradeResources(ubring::SHM* local_trx_shm, + const char* shm_name); + int PrepareServerUpgradeResources(ubring::SHM* remote_trx_shm, + ubring::SHM* local_trx_shm); + void ActivateUpgrade(); + void DeactivateUpgrade(); + void FinishUpgrade(); + bool UpgradeActive() const { return _ub_state == UB_ON; } private: + void SetHighSpeedAvailable(bool available); + static bool OptionsAvailableForUB(const ChannelOptions* opt); static bool OptionsAvailableOverUB(const ServerOptions* opt); private: @@ -57,8 +73,7 @@ friend class ubring::UBConnect; ubring::UBShmEndpoint* _ub_ep = nullptr; // Should use UB or not UBState _ub_state; - std::shared_ptr _tcp_transport; }; } // namespace brpc #endif // BRPC_WITH_UBRING -#endif //BRPC_UB_TRANSPORT_H \ No newline at end of file +#endif //BRPC_UB_TRANSPORT_H diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/01ccfd37e3d64cd110462f1203e0d20642510e3e3d14a570a041257996772a31.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/01ccfd37e3d64cd110462f1203e0d20642510e3e3d14a570a041257996772a31.json new file mode 100644 index 0000000000..dc93d7be43 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/01ccfd37e3d64cd110462f1203e0d20642510e3e3d14a570a041257996772a31.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_opcode_h", "label": "urma_opcode.h", "file_type": "code", "source_file": "sdk/urma/urma_opcode.h", "source_location": "L1"}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_opcode_h", "target": "errno", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_opcode.h", "source_location": "L14", "weight": 1.0}], "raw_calls": []} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/1df09f4812201fd3151eb13e804615a74b896364be016d8a28ec657f714e1422.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/1df09f4812201fd3151eb13e804615a74b896364be016d8a28ec657f714e1422.json new file mode 100644 index 0000000000..ebff288857 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/1df09f4812201fd3151eb13e804615a74b896364be016d8a28ec657f714e1422.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "label": "urma_helper.h", "file_type": "code", "source_file": "urma_helper.h", "source_location": "L1"}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "cstddef", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L21", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "cstdint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "functional", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "string", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L24", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "atomicops", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L27", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "urma_api", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L31", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_h", "target": "urma_types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.h", "source_location": "L32", "weight": 1.0}], "raw_calls": []} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/3dcbdee4a792ca85149ae0eada9ea3f39bb1c3f972074cfdeb983ed964bc1f54.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/3dcbdee4a792ca85149ae0eada9ea3f39bb1c3f972074cfdeb983ed964bc1f54.json new file mode 100644 index 0000000000..4bfad372ec --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/3dcbdee4a792ca85149ae0eada9ea3f39bb1c3f972074cfdeb983ed964bc1f54.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "label": "urma_handshake.cpp", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "label": "HelloMessage::Serialize()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L72", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "label": "HelloMessage::Deserialize()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L91", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_validhello", "label": "ValidHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L127", "_callable": true}, {"id": "parsedhello", "label": "ParsedHello", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "label": "ReadBodyAndNegotiate()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L141", "_callable": true}, {"id": "urmaendpoint", "label": "UrmaEndpoint", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_drainbytes", "label": "DrainBytes()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L173", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "label": "UrmaHandshakeClientV2::SendLocalHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L187", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "label": "UrmaHandshakeClientV2::ReceiveAndParseRemoteHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L196", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "label": "UrmaHandshakeServerV2::ReceiveAndParseRemoteHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L210", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "label": "UrmaHandshakeServerV2::SendLocalHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L215", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "label": "UrmaHandshakeClientV3::SendLocalHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L240", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "label": "UrmaHandshakeClientV3::ReceiveAndParseRemoteHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L246", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "label": "UrmaHandshakeServerV3::ReceiveAndParseRemoteHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L258", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "label": "UrmaHandshakeServerV3::SendLocalHello()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L263", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createclienthandshake", "label": "CreateClientHandshake()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L274", "_callable": true}, {"id": "urmahandshake", "label": "UrmaHandshake", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "label": "CreateServerHandshakeByMagic()", "file_type": "code", "source_file": "urma_handshake.cpp", "source_location": "L282", "_callable": true}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L18", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "algorithm", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "cstring", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "limits", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L24", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "gflags", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "atomicops", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L28", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "iobuf", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L29", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "logging", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L30", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "sys_byteorder", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L31", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "socket", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L33", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "urma_endpoint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L34", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "urma_helper", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L35", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L36", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "urma_transport", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L37", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L72", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L91", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_validhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L127", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_validhello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L127", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L141", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "target": "urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L141", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L141", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_drainbytes", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L173", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_drainbytes", "target": "urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L173", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L187", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L196", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L196", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L210", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L210", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L215", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L240", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L246", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L246", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L258", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L258", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L263", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createclienthandshake", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L274", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createclienthandshake", "target": "urmahandshake", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L274", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createclienthandshake", "target": "urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L274", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L282", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "target": "urmahandshake", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L282", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "target": "urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L282", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_validhello", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L163", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_drainbytes", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L166", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L207", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_handshake.cpp", "source_location": "L212", "weight": 1.0}], "raw_calls": [{"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L74", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L75", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L76", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L77", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L78", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L79", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L80", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L81", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "memset", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L83", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L84", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L85", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet64", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L86", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet64", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L87", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L88", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L93", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L94", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost16", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L95", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L96", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L97", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L98", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L99", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L100", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L103", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L104", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost64", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L105", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost64", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L106", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L107", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L144", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "callee": "Deserialize", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L146", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L155", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_readbodyandnegotiate", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L158", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_drainbytes", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L177", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "callee": "FillLocalHelloV2", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L189", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L191", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "callee": "Serialize", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L192", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "callee": "WriteToFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L193", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L200", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "callee": "memcmp", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L201", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "callee": "PushBackToReadBuf", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L204", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "FillLocalHelloV2", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L217", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "get", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L218", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "load", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L219", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "memcpy", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L229", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "Serialize", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L230", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "callee": "WriteToFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L231", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "callee": "FillLocalHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L242", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "callee": "WriteHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L243", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L250", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "callee": "memcmp", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L251", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "callee": "PushBackToReadBuf", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L252", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "callee": "ReadAndParseHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L255", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "callee": "ReadAndParseHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L260", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "callee": "FillLocalHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L265", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "callee": "WriteHelloV3", "is_member_call": true, "source_file": "urma_handshake.cpp", "source_location": "L267", "receiver": "_ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "callee": "memcmp", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L284", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_createserverhandshakebymagic", "callee": "memcmp", "is_member_call": false, "source_file": "urma_handshake.cpp", "source_location": "L287", "receiver": null, "lang": "cpp"}], "cpp_type_table": {"path": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.cpp", "table": {"p": "ParsedHello", "m": "HelloMessage", "msg": "UrmaHello"}}} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/5af18e30c1f05aae06e4f45bf09d4d6ab3654daf64631c4821071a362adf2f1e.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/5af18e30c1f05aae06e4f45bf09d4d6ab3654daf64631c4821071a362adf2f1e.json new file mode 100644 index 0000000000..9e5c46ae91 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/5af18e30c1f05aae06e4f45bf09d4d6ab3654daf64631c4821071a362adf2f1e.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "label": "urma_helper.cpp", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "label": "UserSeg", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L139", "_callable": true}, {"id": "urma_target_seg_t", "label": "urma_target_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_tseg", "label": "tseg", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L140"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_base", "label": "base", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L141"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_len", "label": "len", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L142"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pagesize", "label": "PageSize()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L155", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_alignup", "label": "AlignUp()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L160", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "label": "BufferPool", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L174", "_callable": true}, {"id": "mutex", "label": "Mutex", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_mutexes", "label": "mutexes", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L175"}, {"id": "vector", "label": "vector", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_free_lists", "label": "free_lists", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L176"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_in_use", "label": "in_use", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L177"}, {"id": "atomic", "label": "atomic", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_outstanding", "label": "outstanding", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L178"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_buffer_count", "label": ".buffer_count()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L180", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_shardfor", "label": "ShardFor()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L186", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_preferredshard", "label": "PreferredShard()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L193", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "label": "PoolAllocate()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L200", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "label": "PoolDeallocate()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L227", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "label": "InitPool()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L259", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getpoolsegfor", "label": "GetPoolSegFor()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L313", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "label": "GlobalRelease()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L324", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "label": "GlobalUrmaInitializeImpl()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L372", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "label": "GlobalUrmaInitializeOrDie()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L521", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_isurmaavailable", "label": "IsUrmaAvailable()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L540", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globaldisableurma", "label": "GlobalDisableUrma()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L544", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_supportedbyurma", "label": "SupportedByUrma()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L548", "_callable": true}, {"id": "string", "label": "string", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmacontext", "label": "GetUrmaContext()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L552", "_callable": true}, {"id": "urma_context_t", "label": "urma_context_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmamaxsge", "label": "GetUrmaMaxSge()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L553", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmarecvblocksize", "label": "GetUrmaRecvBlockSize()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L554", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "label": "InitPollingModeWithTag()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L560", "_callable": true}, {"id": "bthread_tag_t", "label": "bthread_tag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "function", "label": "function", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_releasepollingmodewithtag", "label": "ReleasePollingModeWithTag()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L570", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "label": "RegisterMemoryForUrma()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L578", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "label": "DeregisterMemoryForUrma()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L613", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getseghandle", "label": "GetSegHandle()", "file_type": "code", "source_file": "urma_helper.cpp", "source_location": "L622", "_callable": true}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "urma_helper", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L18", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "errno", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "pthread", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "stdlib", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L24", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "string", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L25", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "mman", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "unistd", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L27", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "atomic", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L29", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "new", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L30", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "utility", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L31", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "vector", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L32", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "gflags", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L34", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "atomicops", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L36", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "flat_map", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L37", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "iobuf", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L38", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "logging", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L39", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "macros", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L40", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "scoped_lock", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L41", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "lock", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L42", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "urma_api", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L44", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "urma_types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L45", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "urma_endpoint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L46", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L139", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L140", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_tseg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L140", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_base", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L141", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_userseg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L142", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pagesize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L155", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_alignup", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L160", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L174", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "mutex", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L175", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_mutexes", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L175", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "vector", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L176", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_free_lists", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L176", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "vector", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L177", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_in_use", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L177", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "atomic", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L178", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_outstanding", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L178", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_buffer_count", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L180", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_shardfor", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L186", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_preferredshard", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L193", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L200", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L227", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L259", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getpoolsegfor", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L313", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getpoolsegfor", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L313", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L324", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L372", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L521", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_isurmaavailable", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L540", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globaldisableurma", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L544", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_supportedbyurma", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L548", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_supportedbyurma", "target": "string", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L548", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmacontext", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L552", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmacontext", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L552", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmamaxsge", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L553", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_geturmarecvblocksize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L554", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L560", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "target": "bthread_tag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L560", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L560", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L560", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L560", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_releasepollingmodewithtag", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L570", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_releasepollingmodewithtag", "target": "bthread_tag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L570", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L578", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L613", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getseghandle", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L622", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "cstdlib", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L653", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "logging", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L655", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L660", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_preferredshard", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L209", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_shardfor", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L242", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_buffer_count", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L261", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pagesize", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L264", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_alignup", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L265", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "target": "string", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L414", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L485", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_buffer_count", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L514", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L527", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_helper.cpp", "source_location": "L529", "weight": 1.0}], "raw_calls": [{"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pagesize", "callee": "sysconf", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L156", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_bufferpool_buffer_count", "callee": "size", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L181", "receiver": "in_use", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_preferredshard", "callee": "pthread_self", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L196", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L201", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "g_mem_alloc_orig", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L202", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "malloc", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L202", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "g_mem_alloc_orig", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L207", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "malloc", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L207", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L212", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "empty", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L214", "receiver": "fl", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "back", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L215", "receiver": "fl", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "pop_back", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L216", "receiver": "fl", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "size", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L219", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L220", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L223", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "g_mem_alloc_orig", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L224", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_poolallocate", "callee": "malloc", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L224", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L228", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "g_mem_dealloc_orig", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L229", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "free", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L230", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "g_mem_dealloc_orig", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L238", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "free", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L239", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L243", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "size", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L245", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L247", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "push_back", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L252", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "load", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L253", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_pooldeallocate", "callee": "fetch_sub", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L254", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "mmap", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L267", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "PLOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L270", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "urma_register_seg", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L290", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "PLOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L292", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "munmap", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L293", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "assign", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L297", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "push_back", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L300", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpool", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L303", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "store", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L325", "receiver": "g_urma_available", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "SetDefaultBlockSize", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L335", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "GlobalRelease", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L338", "receiver": "UrmaEndpoint", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "urma_unregister_seg", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L340", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "munmap", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L344", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "urma_delete_context", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L355", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "urma_uninit", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L359", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalrelease", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L361", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L373", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "store", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L374", "receiver": "g_urma_available", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L381", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_init", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L387", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L390", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L398", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_get_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L405", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L407", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L408", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "empty", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L413", "receiver": "FLAGS_urma_device", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L420", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L421", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_query_device", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L427", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L428", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L429", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_get_eid_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L434", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L436", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_eid_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L437", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L438", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_create_context", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L442", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_eid_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L443", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "urma_free_device_list", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L444", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L447", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L457", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "init", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L471", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L472", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "assign", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L481", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "reserve", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L483", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L486", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "GetDefaultBlockSize", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L495", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "SetDefaultBlockSize", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L498", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "GlobalInitialize", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L500", "receiver": "UrmaEndpoint", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L501", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "store", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L505", "receiver": "g_urma_available", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeimpl", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L511", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "load", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L523", "receiver": "g_init_once", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "compare_exchange_strong", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L524", "receiver": "g_init_once", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L526", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L528", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "store", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L531", "receiver": "g_init_once", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "load", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L534", "receiver": "g_init_once", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_isurmaavailable", "callee": "load", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L541", "receiver": "g_urma_available", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globaldisableurma", "callee": "store", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L545", "receiver": "g_urma_available", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L564", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "callee": "PollingModeInitialize", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L565", "receiver": "UrmaEndpoint", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "callee": "move", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L566", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "callee": "move", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L566", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_initpollingmodewithtag", "callee": "move", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L567", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_releasepollingmodewithtag", "callee": "PollingModeRelease", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L571", "receiver": "UrmaEndpoint", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L579", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "urma_register_seg", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L595", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "PLOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L597", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L600", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "insert", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L605", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L606", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_registermemoryforurma", "callee": "urma_unregister_seg", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L607", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "callee": "BAIDU_UNLIKELY", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L614", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L615", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "callee": "seek", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L616", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "callee": "urma_unregister_seg", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L618", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_deregistermemoryforurma", "callee": "erase", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L619", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getseghandle", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L633", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getseghandle", "callee": "begin", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L635", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_getseghandle", "callee": "end", "is_member_call": true, "source_file": "urma_helper.cpp", "source_location": "L635", "receiver": "g_user_segs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "LOG", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L661", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_helper_globalurmainitializeordie", "callee": "exit", "is_member_call": false, "source_file": "urma_helper.cpp", "source_location": "L662", "receiver": null, "lang": "cpp"}], "cpp_type_table": {"path": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp", "table": {"us": "UserSeg"}}} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/608feeb18131c6633a1d3bae5ce1bdaf944a337cafc10e12152fa2915751f7d0.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/608feeb18131c6633a1d3bae5ce1bdaf944a337cafc10e12152fa2915751f7d0.json new file mode 100644 index 0000000000..5dc5ce90e5 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/608feeb18131c6633a1d3bae5ce1bdaf944a337cafc10e12152fa2915751f7d0.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "label": "mock_urma.cpp", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "label": "JfcState", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L54", "_callable": true}, {"id": "mutex", "label": "mutex", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_mutex", "label": "mutex", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L55"}, {"id": "deque", "label": "deque", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_cr_t", "label": "urma_cr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_completions", "label": "completions", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L56"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_event_pending", "label": "event_pending", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L57"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv", "label": "PendingRecv", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L60", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_addr", "label": "addr", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L61"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_len", "label": "len", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L62"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L63"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "label": "PushCompletion()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L83", "_callable": true}, {"id": "urma_jfc_t", "label": "urma_jfc_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_init", "label": "urma_init()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L122", "_callable": true}, {"id": "urma_status_t", "label": "urma_status_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_init_attr_t", "label": "urma_init_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "label": "urma_uninit()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L131", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "label": "urma_get_device_list()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L155", "_callable": true}, {"id": "urma_device_t", "label": "urma_device_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "label": "urma_get_device_by_name()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L195", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_device_list", "label": "urma_free_device_list()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L233", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "label": "urma_query_device()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L239", "_callable": true}, {"id": "urma_device_attr_t", "label": "urma_device_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_eid_list", "label": "urma_get_eid_list()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L252", "_callable": true}, {"id": "urma_eid_info_t", "label": "urma_eid_info_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_eid_list", "label": "urma_free_eid_list()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L262", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_context", "label": "urma_create_context()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L268", "_callable": true}, {"id": "urma_context_t", "label": "urma_context_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "label": "urma_delete_context()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L280", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "label": "urma_create_jfce()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L290", "_callable": true}, {"id": "urma_jfce_t", "label": "urma_jfce_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "label": "urma_delete_jfce()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L308", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "label": "urma_create_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L319", "_callable": true}, {"id": "urma_jfc_cfg_t", "label": "urma_jfc_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "label": "urma_delete_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L337", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "label": "urma_create_jfr()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L348", "_callable": true}, {"id": "urma_jfr_t", "label": "urma_jfr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_jfr_cfg_t", "label": "urma_jfr_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "label": "urma_delete_jfr()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L364", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "label": "urma_register_seg()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L376", "_callable": true}, {"id": "urma_target_seg_t", "label": "urma_target_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_seg_cfg_t", "label": "urma_seg_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "label": "urma_unregister_seg()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L392", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "label": "urma_import_seg()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L402", "_callable": true}, {"id": "urma_seg_t", "label": "urma_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_token_t", "label": "urma_token_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_import_seg_flag_t", "label": "urma_import_seg_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "label": "urma_unimport_seg()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L417", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "label": "urma_get_async_event()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L427", "_callable": true}, {"id": "urma_async_event_t", "label": "urma_async_event_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_async_event", "label": "urma_ack_async_event()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L439", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "label": "urma_create_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L441", "_callable": true}, {"id": "urma_jetty_t", "label": "urma_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_jetty_cfg_t", "label": "urma_jetty_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "label": "urma_delete_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L458", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "label": "urma_unbind_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L469", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "label": "urma_import_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L478", "_callable": true}, {"id": "urma_target_jetty_t", "label": "urma_target_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "urma_rjetty_t", "label": "urma_rjetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "label": "urma_unimport_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L493", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "label": "urma_bind_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L503", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "label": "urma_modify_jetty()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L514", "_callable": true}, {"id": "urma_jetty_attr_t", "label": "urma_jetty_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "label": "urma_post_jetty_send_wr()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L522", "_callable": true}, {"id": "urma_jfs_wr_t", "label": "urma_jfs_wr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "label": "urma_post_jfr_wr()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L605", "_callable": true}, {"id": "urma_jfr_wr_t", "label": "urma_jfr_wr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "label": "urma_poll_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L627", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_rearm_jfc", "label": "urma_rearm_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L647", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_wait_jfc", "label": "urma_wait_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L651", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_jfc", "label": "urma_ack_jfc()", "file_type": "code", "source_file": "mock_urma.cpp", "source_location": "L674", "_callable": true}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "urma_api", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L38", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "algorithm", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L40", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "atomic", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L41", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "cerrno", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L42", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "cstring", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L43", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "deque", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L44", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "map", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L45", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "mutex", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L46", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "shared_mutex", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L47", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "eventfd", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L48", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "unistd", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L49", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "vector", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L50", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L54", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "mutex", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L55", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L55", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "deque", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L56", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "urma_cr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L56", "weight": 1.0, "context": "generic_arg"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_completions", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L56", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate_event_pending", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L57", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L60", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L61", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L62", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pendingrecv_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L63", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L83", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L83", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_jfcstate", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L83", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "target": "urma_cr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L83", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_init", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L122", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_init", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L122", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_init", "target": "urma_init_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L122", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L131", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L131", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L155", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L155", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L195", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L195", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_device_list", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L233", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_device_list", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L233", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L239", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L239", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L239", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "target": "urma_device_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L239", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_eid_list", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L252", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_eid_list", "target": "urma_eid_info_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L252", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_eid_list", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L252", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_eid_list", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L262", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_free_eid_list", "target": "urma_eid_info_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L262", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_context", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L268", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_context", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L268", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_context", "target": "urma_device_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L268", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L280", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L280", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L280", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L290", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "target": "urma_jfce_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L290", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L290", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L308", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L308", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "target": "urma_jfce_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L308", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L319", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L319", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L319", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "target": "urma_jfc_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L319", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L337", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L337", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L337", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L348", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "target": "urma_jfr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L348", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L348", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "target": "urma_jfr_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L348", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L364", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L364", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "target": "urma_jfr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L364", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L376", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L376", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L376", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "target": "urma_seg_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L376", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L392", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L392", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L392", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "target": "urma_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "target": "urma_import_seg_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L402", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L417", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L417", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L417", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L427", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L427", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L427", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "target": "urma_async_event_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L427", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_async_event", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L439", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_async_event", "target": "urma_async_event_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L439", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L441", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L441", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L441", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "target": "urma_jetty_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L441", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L458", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L458", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L458", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L469", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L469", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L469", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L478", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L478", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L478", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "target": "urma_rjetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L478", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L478", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L493", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L493", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L493", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L503", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L503", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L503", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L503", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L514", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L514", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L514", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "target": "urma_jetty_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L514", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L522", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L522", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L522", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "target": "urma_jfs_wr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L522", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "target": "urma_jfs_wr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L522", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L605", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L605", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "target": "urma_jfr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L605", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "target": "urma_jfr_wr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L605", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "target": "urma_jfr_wr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L605", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L627", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L627", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "target": "urma_cr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L627", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_rearm_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L647", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_rearm_jfc", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L647", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_rearm_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L647", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_wait_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L651", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_wait_jfc", "target": "urma_jfce_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L651", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_wait_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L651", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L674", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_ack_jfc", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L674", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "mock_urma.cpp", "source_location": "L543", "weight": 1.0}], "raw_calls": [{"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "callee": "push_back", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L88", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_pushcompletion", "callee": "write", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L97", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L137", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L138", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L139", "receiver": "jfce_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L143", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L144", "receiver": "jfr_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L145", "receiver": "jfr_jfc_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L146", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L147", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L148", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L149", "receiver": "jetty_id_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "clear", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L150", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_uninit", "callee": "store", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L151", "receiver": "next_jetty_id", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L162", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L163", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L164", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L165", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L177", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "strcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L179", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "strcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L180", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "push_back", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L184", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L186", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L187", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_list", "callee": "size", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L188", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L201", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "strcmp", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L203", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L215", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "strcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L217", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "strcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L218", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "push_back", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L222", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "strcmp", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L225", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_device_by_name", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L229", "receiver": "device_list", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_query_device", "callee": "memcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L248", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_eid_list", "callee": "memcpy", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L258", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L282", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L282", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_context", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L285", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L292", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L292", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfce", "callee": "eventfd", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L299", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L310", "receiver": "jfce_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L310", "receiver": "jfce_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L313", "receiver": "jfce_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfce", "callee": "close", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L314", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L321", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L321", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfc", "callee": "memset", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L325", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L339", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L339", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfc", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L343", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L350", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jfr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L350", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L366", "receiver": "jfr_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L366", "receiver": "jfr_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L369", "receiver": "jfr_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L370", "receiver": "jfr_jfc_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jfr", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L371", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L378", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L378", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_register_seg", "callee": "memset", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L382", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L394", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L394", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unregister_seg", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L397", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L407", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_seg", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L407", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L419", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L419", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_seg", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L422", "receiver": "seg_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L433", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_get_async_event", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L433", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L443", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L443", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "callee": "memset", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L447", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_create_jetty", "callee": "fetch_add", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L450", "receiver": "next_jetty_id", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L460", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L460", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L463", "receiver": "jetty_id_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_delete_jetty", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L464", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L471", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unbind_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L471", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L483", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_import_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L483", "receiver": "context_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L495", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L495", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_unimport_jetty", "callee": "erase", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L498", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L506", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L506", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L507", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_bind_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L507", "receiver": "target_jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L516", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_modify_jetty", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L516", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L525", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L527", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L528", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L529", "receiver": "jetty_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L530", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "unlock", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L535", "receiver": "read_lock", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L552", "receiver": "jetty_id_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L553", "receiver": "jetty_id_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L558", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L559", "receiver": "jfr_jfc_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L560", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L560", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L561", "receiver": "jfr_jfc_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "front", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L564", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "pop_front", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L565", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "memcpy", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L574", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L582", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jetty_send_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L583", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L608", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L609", "receiver": "jfr_recv_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_post_jfr_wr", "callee": "push_back", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L618", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "find", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L631", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "end", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L632", "receiver": "jfc_state_map", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L637", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "front", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L638", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "pop_front", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L639", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_poll_jfc", "callee": "empty", "is_member_call": true, "source_file": "mock_urma.cpp", "source_location": "L641", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_mock_urma_urma_wait_jfc", "callee": "read", "is_member_call": false, "source_file": "mock_urma.cpp", "source_location": "L658", "receiver": null, "lang": "cpp"}], "cpp_type_table": {"path": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp", "table": {"remote_state": "JfcState", "recv": "PendingRecv", "local_state": "JfcState", "state": "JfcState"}}} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/6870b34881c2bda6a7406307467705c41b2381b7a5af286fab00d3241d6a5eca.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/6870b34881c2bda6a7406307467705c41b2381b7a5af286fab00d3241d6a5eca.json new file mode 100644 index 0000000000..9ccaeb8d17 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/6870b34881c2bda6a7406307467705c41b2381b7a5af286fab00d3241d6a5eca.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "label": "urma_types.h", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr", "label": "urma_init_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L85", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr_token", "label": "token", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L86"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr_uasid", "label": "uasid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L87"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ref", "label": "urma_ref", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L152", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "label": "urma_port_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L160", "_callable": true}, {"id": "urma_mtu_t", "label": "urma_mtu_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_max_mtu", "label": "max_mtu", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L161"}, {"id": "urma_port_state_t", "label": "urma_port_state_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_state", "label": "state", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L162"}, {"id": "urma_link_width_t", "label": "urma_link_width_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_width", "label": "active_width", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L163"}, {"id": "urma_speed_t", "label": "urma_speed_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_speed", "label": "active_speed", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L164"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_mtu", "label": "active_mtu", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L165"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info", "label": "urma_sl_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L178", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info_sl", "label": "SL", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L179"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info_tp_type", "label": "tp_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L180"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "label": "urma_device_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L254", "_callable": true}, {"id": "urma_device_feature_t", "label": "urma_device_feature_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_feature", "label": "feature", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L255"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfc", "label": "max_jfc", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L256"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs", "label": "max_jfs", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L257"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr", "label": "max_jfr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L258"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty", "label": "max_jetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L259"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty_grp", "label": "max_jetty_grp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L260"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty_in_jetty_grp", "label": "max_jetty_in_jetty_grp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L261"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfc_depth", "label": "max_jfc_depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L262"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_depth", "label": "max_jfs_depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L263"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr_depth", "label": "max_jfr_depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L264"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_inline_len", "label": "max_jfs_inline_len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L265"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_sge", "label": "max_jfs_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L266"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_rsge", "label": "max_jfs_rsge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L267"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr_sge", "label": "max_jfr_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L268"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_msg_size", "label": "max_msg_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L269"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_read_size", "label": "max_read_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L270"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_write_size", "label": "max_write_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L271"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_cas_size", "label": "max_cas_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L272"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_swap_size", "label": "max_swap_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L273"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_add_size", "label": "max_fetch_and_add_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L274"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_sub_size", "label": "max_fetch_and_sub_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L275"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_and_size", "label": "max_fetch_and_and_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L276"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_or_size", "label": "max_fetch_and_or_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L277"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_xor_size", "label": "max_fetch_and_xor_size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L278"}, {"id": "urma_atomic_feature_t", "label": "urma_atomic_feature_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_atomic_feat", "label": "atomic_feat", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L279"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L280"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_congestion_ctrl_alg", "label": "congestion_ctrl_alg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L281"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_ceq_cnt", "label": "ceq_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L282"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_tp_in_tpg", "label": "max_tp_in_tpg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L283"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_eid_cnt", "label": "max_eid_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L284"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_page_size_cap", "label": "page_size_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L285"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_oor_cnt", "label": "max_oor_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L286"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_mn", "label": "mn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L287"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_netaddr_cnt", "label": "max_netaddr_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L288"}, {"id": "urma_order_type_cap_t", "label": "urma_order_type_cap_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rm_order_cap", "label": "rm_order_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L289"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rc_order_cap", "label": "rc_order_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L290"}, {"id": "urma_tp_type_cap_t", "label": "urma_tp_type_cap_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rm_tp_cap", "label": "rm_tp_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L291"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rc_tp_cap", "label": "rc_tp_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L292"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_um_tp_cap", "label": "um_tp_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L293"}, {"id": "urma_tp_feature_t", "label": "urma_tp_feature_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_tp_feature", "label": "tp_feature", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L294"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_priority_info", "label": "priority_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L295"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_guid", "label": "urma_guid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L298", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_guid_raw", "label": "raw", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L299"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "label": "urma_device_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L302", "_callable": true}, {"id": "urma_guid_t", "label": "urma_guid_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_guid", "label": "guid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L303"}, {"id": "urma_device_cap_t", "label": "urma_device_cap_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_dev_cap", "label": "dev_cap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L304"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_port_cnt", "label": "port_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L305"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_port_attr", "label": "port_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L306"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_reserved_jetty_id_min", "label": "reserved_jetty_id_min", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L307"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_reserved_jetty_id_max", "label": "reserved_jetty_id_max", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L308"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token", "label": "urma_token", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L312", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_token", "label": "token", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L313"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sysfs_dev", "label": "urma_sysfs_dev", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L316", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ops", "label": "urma_ops", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L318", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_provider_ops", "label": "urma_provider_ops", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L319", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "label": "urma_cc_entry", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L358", "_callable": true}, {"id": "urma_tp_cc_alg_t", "label": "urma_tp_cc_alg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_alg", "label": "alg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L359"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_cc_pattern_idx", "label": "cc_pattern_idx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L360"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_cc_priority", "label": "cc_priority", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L361"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "label": "urma_device", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L364", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L365"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_path", "label": "path", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L367"}, {"id": "urma_transport_type_t", "label": "urma_transport_type_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_type", "label": "type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L368"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_ops", "label": "ops", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L369"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_sysfs_dev", "label": "sysfs_dev", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L370"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "label": "urma_context", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L383", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_dev", "label": "dev", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L384"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_ops", "label": "ops", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L385"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_dev_fd", "label": "dev_fd", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L386"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_async_fd", "label": "async_fd", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L387"}, {"id": "pthread_mutex_t", "label": "pthread_mutex_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_mutex", "label": "mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L388"}, {"id": "urma_eid_t", "label": "urma_eid_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_eid", "label": "eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L389"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_eid_index", "label": "eid_index", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L390"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_uasid", "label": "uasid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L391"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_ref", "label": "ref", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L392"}, {"id": "urma_context_aggr_mode_t", "label": "urma_context_aggr_mode_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_aggr_mode", "label": "aggr_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L393"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info", "label": "urma_eid_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L396", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info_eid", "label": "eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L397"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info_eid_index", "label": "eid_index", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L398"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg", "label": "urma_jfce_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L401", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg_depth", "label": "depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L402"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L403"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "label": "urma_jfce", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L406", "_callable": true}, {"id": "urma_context_t", "label": "urma_context_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L407"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_fd", "label": "fd", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L408"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_ref", "label": "ref", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L409"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "label": "urma_jfc_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L423", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_depth", "label": "depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L424"}, {"id": "urma_jfc_flag_t", "label": "urma_jfc_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L425"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_ceqn", "label": "ceqn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L426"}, {"id": "urma_jfce_t", "label": "urma_jfce_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_jfce", "label": "jfce", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L428"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L429"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr", "label": "urma_jfc_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L437", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_mask", "label": "mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L438"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_moderate_count", "label": "moderate_count", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L439"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_moderate_period", "label": "moderate_period", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L440"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "label": "urma_jetty_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L443", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_eid", "label": "eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L444"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_uasid", "label": "uasid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L445"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L446"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "label": "urma_jfc_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L467", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_jfc_opt_mask", "label": "jfc_opt_mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L468"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_is_actived", "label": "is_actived", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L470"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_cqe_base_addr", "label": "urma_jfc_cqe_base_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L471"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_id", "label": "urma_jfc_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L472"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_db_addr", "label": "urma_jfc_db_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L473"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_db_status", "label": "urma_jfc_db_status", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L474"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_pi", "label": "urma_jfc_pi", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L475"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_pi_type", "label": "urma_jfc_pi_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L476"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_ci", "label": "urma_jfc_ci", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L477"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L478"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "label": "urma_jfc", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L481", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L482"}, {"id": "urma_jfc_id_t", "label": "urma_jfc_id_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_jfc_id", "label": "jfc_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L483"}, {"id": "urma_jfc_cfg_t", "label": "urma_jfc_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_jfc_cfg", "label": "jfc_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L484"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L485"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_event_mutex", "label": "event_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L486"}, {"id": "pthread_cond_t", "label": "pthread_cond_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_event_cond", "label": "event_cond", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L487"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_comp_events_acked", "label": "comp_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L488"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_async_events_acked", "label": "async_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L489"}, {"id": "urma_jfc_opt_t", "label": "urma_jfc_opt_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_urma_jfc_opt", "label": "urma_jfc_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L490"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "label": "urma_jfs_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L534", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_jfs_opt_mask", "label": "jfs_opt_mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L535"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_is_actived", "label": "is_actived", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L537"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_sqe_base_addr", "label": "urma_jfs_sqe_base_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L538"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_id", "label": "urma_jfs_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L539"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_db_addr", "label": "urma_jfs_db_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L540"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_db_status", "label": "urma_jfs_db_status", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L541"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_pi", "label": "urma_jfs_pi", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L542"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_pi_type", "label": "urma_jfs_pi_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L543"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_ci", "label": "urma_jfs_ci", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L544"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L545"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "label": "urma_jfs_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L548", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_depth", "label": "depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L549"}, {"id": "urma_jfs_flag_t", "label": "urma_jfs_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L550"}, {"id": "urma_transport_mode_t", "label": "urma_transport_mode_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L551"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_priority", "label": "priority", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L552"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_sge", "label": "max_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L554"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_rsge", "label": "max_rsge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L555"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_inline_data", "label": "max_inline_data", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L556"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_rnr_retry", "label": "rnr_retry", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L558"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_err_timeout", "label": "err_timeout", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L562"}, {"id": "urma_jfc_t", "label": "urma_jfc_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_jfc", "label": "jfc", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L564"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L565"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "label": "urma_jfs", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L568", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L569"}, {"id": "urma_jfs_id_t", "label": "urma_jfs_id_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_jfs_id", "label": "jfs_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L570"}, {"id": "urma_jfs_cfg_t", "label": "urma_jfs_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_jfs_cfg", "label": "jfs_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L571"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L572"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_event_mutex", "label": "event_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L573"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_event_cond", "label": "event_cond", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L574"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_async_events_acked", "label": "async_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L575"}, {"id": "urma_jfs_opt_t", "label": "urma_jfs_opt_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_urma_jfs_opt", "label": "urma_jfs_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L576"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr", "label": "urma_jfs_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L585", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr_mask", "label": "mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L586"}, {"id": "urma_jfs_state_t", "label": "urma_jfs_state_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr_state", "label": "state", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L587"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "label": "urma_jfr_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L625", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_jfr_opt_mask", "label": "jfr_opt_mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L626"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_is_actived", "label": "is_actived", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L628"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_rqe_base_addr", "label": "urma_jfr_rqe_base_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L629"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_id", "label": "urma_jfr_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L630"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_db_addr", "label": "urma_jfr_db_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L631"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_db_status", "label": "urma_jfr_db_status", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L632"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_pi", "label": "urma_jfr_pi", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L633"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_pi_type", "label": "urma_jfr_pi_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L634"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_ci", "label": "urma_jfr_ci", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L635"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L636"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "label": "urma_jfr_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L639", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L640"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_depth", "label": "depth", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L642"}, {"id": "urma_jfr_flag_t", "label": "urma_jfr_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L643"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L644"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_max_sge", "label": "max_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L645"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_min_rnr_timer", "label": "min_rnr_timer", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L646"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_jfc", "label": "jfc", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L648"}, {"id": "urma_token_t", "label": "urma_token_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_token_value", "label": "token_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L649"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L650"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "label": "urma_jfr_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L658", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_mask", "label": "mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L659"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_rx_threshold", "label": "rx_threshold", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L660"}, {"id": "urma_jfr_state_t", "label": "urma_jfr_state_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_state", "label": "state", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L661"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "label": "urma_jfr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L664", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L665"}, {"id": "urma_jfr_id_t", "label": "urma_jfr_id_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_jfr_id", "label": "jfr_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L666"}, {"id": "urma_jfr_cfg_t", "label": "urma_jfr_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_jfr_cfg", "label": "jfr_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L667"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L668"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_event_mutex", "label": "event_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L669"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_event_cond", "label": "event_cond", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L670"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_async_events_acked", "label": "async_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L671"}, {"id": "urma_jfr_opt_t", "label": "urma_jfr_opt_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_urma_jfr_opt", "label": "urma_jfr_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L672"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "label": "urma_rjfr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L702", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_jfr_id", "label": "jfr_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L703"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L704"}, {"id": "urma_import_jetty_flag_t", "label": "urma_import_jetty_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L705"}, {"id": "urma_tp_type_t", "label": "urma_tp_type_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_tp_type", "label": "tp_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L706"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp", "label": "urma_tp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L709", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_tpn", "label": "tpn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L710"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "label": "urma_jetty_grp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L724", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "label": "urma_jetty_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L726", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L727"}, {"id": "urma_jetty_flag_t", "label": "urma_jetty_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L728"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_jfs_cfg", "label": "jfs_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L731"}, {"id": "urma_jetty_grp_t", "label": "urma_jetty_grp_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_jetty_grp", "label": "jetty_grp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L741"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L742"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "label": "urma_rjetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L756", "_callable": true}, {"id": "urma_jetty_id_t", "label": "urma_jetty_id_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_jetty_id", "label": "jetty_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L757"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L758"}, {"id": "urma_jetty_grp_policy_t", "label": "urma_jetty_grp_policy_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_policy", "label": "policy", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L759"}, {"id": "urma_target_type_t", "label": "urma_target_type_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_type", "label": "type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L760"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L761"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_tp_type", "label": "tp_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L762"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "label": "urma_target_jetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L765", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L766"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L767"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L768"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L769"}, {"id": "urma_tp_t", "label": "urma_tp_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_tp", "label": "tp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L770"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_type", "label": "type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L771"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L772"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_policy", "label": "policy", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L773"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_tp_type", "label": "tp_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L774"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "label": "urma_jetty_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L782", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_mask", "label": "mask", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L783"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_rx_threshold", "label": "rx_threshold", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L784"}, {"id": "urma_jetty_state_t", "label": "urma_jetty_state_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_state", "label": "state", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L785"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "label": "urma_jetty_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L788", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_is_actived", "label": "is_actived", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L789"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_jfs_opt", "label": "jfs_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L790"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L791"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "label": "urma_jetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L794", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L795"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_jetty_id", "label": "jetty_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L796"}, {"id": "urma_target_jetty_t", "label": "urma_target_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_remote_jetty", "label": "remote_jetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L797"}, {"id": "urma_jetty_cfg_t", "label": "urma_jetty_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_jetty_cfg", "label": "jetty_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L799"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L800"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_event_mutex", "label": "event_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L801"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_event_cond", "label": "event_cond", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L802"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_async_events_acked", "label": "async_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L803"}, {"id": "urma_jetty_opt_t", "label": "urma_jetty_opt_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_urma_jetty_opt", "label": "urma_jetty_opt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L804"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "label": "urma_notifier", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L807", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L808"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_fd", "label": "fd", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L809"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_incomplete_tjetty_list", "label": "incomplete_tjetty_list", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L810"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "label": "urma_notify", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L818", "_callable": true}, {"id": "urma_notify_type_t", "label": "urma_notify_type_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_type", "label": "type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L819"}, {"id": "urma_status_t", "label": "urma_status_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_status", "label": "status", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L820"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L821"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "label": "urma_jetty_grp_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L840", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L841"}, {"id": "urma_jetty_grp_flag_t", "label": "urma_jetty_grp_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L842"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_token_value", "label": "token_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L843"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L844"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_policy", "label": "policy", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L846"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L847"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L851"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_grp_id", "label": "jetty_grp_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L852"}, {"id": "urma_jetty_grp_cfg_t", "label": "urma_jetty_grp_cfg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_cnt", "label": "jetty_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L854"}, {"id": "urma_jetty_t", "label": "urma_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_list", "label": "jetty_list", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L855"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_list_mutex", "label": "list_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L856"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L857"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_event_mutex", "label": "event_mutex", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L858"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_event_cond", "label": "event_cond", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L859"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_async_events_acked", "label": "async_events_acked", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L860"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "label": "urma_ubva", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L864", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_eid", "label": "eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L865"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_uasid", "label": "uasid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L866"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_va", "label": "va", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L867"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "label": "urma_token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L946", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L947"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L948"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L949"}, {"id": "urma_ref_t", "label": "urma_ref_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_ref", "label": "ref", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L950"}, {"id": "urma_token_id_flag_t", "label": "urma_token_id_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L951"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "label": "urma_seg_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L954", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_va", "label": "va", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L955"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_len", "label": "len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L956"}, {"id": "urma_token_id_t", "label": "urma_token_id_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L957"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_token_value", "label": "token_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L958"}, {"id": "urma_reg_seg_flag_t", "label": "urma_reg_seg_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L959"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L960"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_iova", "label": "iova", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L961"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "label": "urma_seg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L964", "_callable": true}, {"id": "urma_ubva_t", "label": "urma_ubva_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_ubva", "label": "ubva", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L965"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_len", "label": "len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L966"}, {"id": "urma_seg_attr_t", "label": "urma_seg_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_attr", "label": "attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L967"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L968"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "label": "urma_target_seg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L971", "_callable": true}, {"id": "urma_seg_t", "label": "urma_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_seg", "label": "seg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L972"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L973"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_mva", "label": "mva", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L974"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L975"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L976"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_handle", "label": "handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L977"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in", "label": "urma_user_ctl_in", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L980", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_addr", "label": "addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L981"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_len", "label": "len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L982"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_opcode", "label": "opcode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L987"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out", "label": "urma_user_ctl_out", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L990", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_addr", "label": "addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L991"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_len", "label": "len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L992"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L993"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "label": "urma_user_target_seg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L996", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_attr", "label": "attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L997"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L998"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_token_value", "label": "token_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L999"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "label": "urma_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1002", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_addr", "label": "addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1003"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_len", "label": "len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1004"}, {"id": "urma_target_seg_t", "label": "urma_target_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_tseg", "label": "tseg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1010"}, {"id": "urma_user_tseg_t", "label": "urma_user_tseg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_user_tseg", "label": "user_tseg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1011"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg", "label": "urma_sg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1014", "_callable": true}, {"id": "urma_sge_t", "label": "urma_sge_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg_sge", "label": "sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1015"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg_num_sge", "label": "num_sge", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1016"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "label": "urma_rw_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1053", "_callable": true}, {"id": "urma_sg_t", "label": "urma_sg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_src", "label": "src", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1054"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_dst", "label": "dst", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1056"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_target_hint", "label": "target_hint", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1058"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_notify_data", "label": "notify_data", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1059"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "label": "urma_send_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1062", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_src", "label": "src", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1063"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_target_hint", "label": "target_hint", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1064"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_imm_data", "label": "imm_data", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1065"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_tseg", "label": "tseg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1066"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "label": "urma_cas_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1069", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr_dst", "label": "dst", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1070"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr_src", "label": "src", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1071"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "label": "urma_faa_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1082", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr_dst", "label": "dst", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1083"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr_src", "label": "src", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1084"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "label": "urma_jfs_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1091", "_callable": true}, {"id": "urma_opcode_t", "label": "urma_opcode_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_opcode", "label": "opcode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1092"}, {"id": "urma_jfs_wr_flag_t", "label": "urma_jfs_wr_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1093"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_tjetty", "label": "tjetty", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1094"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1095"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_next", "label": "next", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1102"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "label": "urma_jfr_wr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1105", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_src", "label": "src", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1106"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1107"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_next", "label": "next", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1108"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token", "label": "urma_cr_token", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1122", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token_token_id", "label": "token_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1123"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token_token_value", "label": "token_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1124"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "label": "urma_cr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1127", "_callable": true}, {"id": "urma_cr_status_t", "label": "urma_cr_status_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_status", "label": "status", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1128"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1129"}, {"id": "urma_cr_opcode_t", "label": "urma_cr_opcode_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_opcode", "label": "opcode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1130"}, {"id": "urma_cr_flag_t", "label": "urma_cr_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1131"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_completion_len", "label": "completion_len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1132"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_local_id", "label": "local_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1134"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_remote_id", "label": "remote_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1135"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_tpn", "label": "tpn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1141"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_user_data", "label": "user_data", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1142"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "label": "urma_async_event", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1145", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_urma_ctx", "label": "urma_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1147"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_element", "label": "element", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1156"}, {"id": "urma_async_event_type_t", "label": "urma_async_event_type_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_event_type", "label": "event_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1157"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_priv", "label": "priv", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1158"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "label": "urma_ur", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1184", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1185"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_size", "label": "size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1186"}, {"id": "urma_ur_attr_t", "label": "urma_ur_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_attr", "label": "attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1187"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_token", "label": "token", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1188"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_user_ctx", "label": "user_ctx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1189"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "label": "urma_target_ur", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1193", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1194"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_size", "label": "size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1195"}, {"id": "urma_import_ur_flag_t", "label": "urma_import_ur_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1196"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_tseg_list", "label": "tseg_list", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1197"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_cnt", "label": "cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1198"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info", "label": "urma_seg_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1201", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info_seg", "label": "seg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1202"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info_idx_in_ur", "label": "idx_in_ur", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1203"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "label": "urma_ur_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1207", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1208"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_size", "label": "size", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1209"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_attr", "label": "attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1210"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_cnt", "label": "cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1211"}, {"id": "urma_seg_info_t", "label": "urma_seg_info_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_seg_list", "label": "seg_list", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1212"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "label": "urma_jfr_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1215", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_name", "label": "name", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1216"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_eid", "label": "eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1217"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_uasid", "label": "uasid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1218"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_id", "label": "id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1219"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "label": "urma_tp_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1238", "_callable": true}, {"id": "urma_tp_cfg_flag_t", "label": "urma_tp_cfg_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1239"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1241"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_retry_num", "label": "retry_num", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1242"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_retry_factor", "label": "retry_factor", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1243"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_ack_timeout", "label": "ack_timeout", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1244"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_dscp", "label": "dscp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1245"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_oor_cnt", "label": "oor_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1246"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "label": "urma_net_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1295", "_callable": true}, {"id": "sa_family_t", "label": "sa_family_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_sin_family", "label": "sin_family", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1296"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_vlan", "label": "vlan", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1301"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_mac", "label": "mac", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1302"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_prefix_len", "label": "prefix_len", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1303"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info", "label": "urma_net_addr_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1306", "_callable": true}, {"id": "urma_net_addr_t", "label": "urma_net_addr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info_netaddr", "label": "netaddr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1307"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info_index", "label": "index", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1308"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "label": "urma_tp_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1311", "_callable": true}, {"id": "urma_tp_mod_flag_t", "label": "urma_tp_mod_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1312"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_tpn", "label": "peer_tpn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1313"}, {"id": "urma_tp_state_t", "label": "urma_tp_state_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_state", "label": "state", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1314"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_tx_psn", "label": "tx_psn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1315"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_rx_psn", "label": "rx_psn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1316"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_mtu", "label": "mtu", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1317"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_cc_pattern_idx", "label": "cc_pattern_idx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1318"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_oos_cnt", "label": "oos_cnt", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1319"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_local_net_addr_idx", "label": "local_net_addr_idx", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1320"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_net_addr", "label": "peer_net_addr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1321"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_data_udp_start", "label": "data_udp_start", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1322"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_ack_udp_start", "label": "ack_udp_start", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1323"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_udp_range", "label": "udp_range", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1324"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_hop_limit", "label": "hop_limit", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1325"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_flow_label", "label": "flow_label", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1326"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_port_id", "label": "port_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1327"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_mn", "label": "mn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1328"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_trans_type", "label": "peer_trans_type", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1329"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "label": "urma_get_tp_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1347", "_callable": true}, {"id": "urma_get_tp_cfg_flag_t", "label": "urma_get_tp_cfg_flag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_flag", "label": "flag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1348"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_trans_mode", "label": "trans_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1349"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_local_eid", "label": "local_eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1350"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_peer_eid", "label": "peer_eid", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1351"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_info", "label": "urma_tp_info", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1354", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_info_tp_handle", "label": "tp_handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1355"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr", "label": "urma_active_tp_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1358", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_tx_psn", "label": "tx_psn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1359"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_rx_psn", "label": "rx_psn", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1360"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1361"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "label": "urma_active_tp_cfg", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1364", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tp_handle", "label": "tp_handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1365"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_peer_tp_handle", "label": "peer_tp_handle", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1366"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tag", "label": "tag", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1367"}, {"id": "urma_active_tp_attr_t", "label": "urma_active_tp_attr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tp_attr", "label": "tp_attr", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1368"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "label": "urma_tp_attr_value", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1376", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_retry_times_init", "label": "retry_times_init", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1377"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_at", "label": "at", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1378"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sip", "label": "sip", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1379"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dip", "label": "dip", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1380"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sma", "label": "sma", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1381"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dma", "label": "dma", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1382"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_vlan_id", "label": "vlan_id", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1383"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_vlan_en", "label": "vlan_en", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1384"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dscp", "label": "dscp", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1385"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_at_times", "label": "at_times", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1386"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sl", "label": "sl", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1387"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_ttl", "label": "ttl", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1388"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_ack_udp_srcport", "label": "ack_udp_srcport", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1389"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_data_udp_srcport", "label": "data_udp_srcport", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1390"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_udp_srcport_range", "label": "udp_srcport_range", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1391"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_spray_en", "label": "spray_en", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1392"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_udp_global_en", "label": "udp_global_en", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1393"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserve_0", "label": "reserve_0", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1394"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sl_bitmap", "label": "sl_bitmap", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1395"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dscp_config_mode", "label": "dscp_config_mode", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1396"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserve_1", "label": "reserve_1", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1397"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserved", "label": "reserved", "file_type": "code", "source_file": "sdk/urma/urma_types.h", "source_location": "L1398"}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "inet", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L14", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "pthread", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L15", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "stdint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L16", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "stdbool", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L17", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "socket", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L18", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "stdatomic", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L21", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "atomic", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "urma_opcode", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L85", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr_token", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L86", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_init_attr_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L87", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ref", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L152", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L160", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "urma_mtu_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L161", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_max_mtu", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L161", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "urma_port_state_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L162", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_state", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L162", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "urma_link_width_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L163", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_width", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L163", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "urma_speed_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L164", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_speed", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L164", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "urma_mtu_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L165", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_port_attr_active_mtu", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L165", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L178", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info_sl", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L179", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sl_info_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L180", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L254", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_device_feature_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L255", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_feature", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L255", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfc", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L256", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L257", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L258", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L259", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty_grp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L260", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jetty_in_jetty_grp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L261", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfc_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L262", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L263", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L264", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_inline_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L265", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L266", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfs_rsge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L267", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_jfr_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L268", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_msg_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L269", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_read_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L270", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_write_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L271", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_cas_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L272", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_swap_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L273", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_add_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L274", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_sub_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L275", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_and_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L276", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_or_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L277", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_fetch_and_xor_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L278", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_atomic_feature_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L279", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_atomic_feat", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L279", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L280", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_congestion_ctrl_alg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L281", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_ceq_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L282", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_tp_in_tpg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L283", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_eid_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L284", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_page_size_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L285", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_oor_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L286", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_mn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L287", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_max_netaddr_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L288", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_order_type_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L289", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rm_order_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L289", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_order_type_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L290", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rc_order_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L290", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_tp_type_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L291", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rm_tp_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L291", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_tp_type_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L292", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_rc_tp_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L292", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_tp_type_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L293", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_um_tp_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L293", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "urma_tp_feature_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L294", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_tp_feature", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L294", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_cap_priority_info", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L295", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_guid", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L298", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_guid", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_guid_raw", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L299", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L302", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "urma_guid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L303", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_guid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L303", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "urma_device_cap_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L304", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_dev_cap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L304", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_port_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L305", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_port_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L306", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_reserved_jetty_id_min", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L307", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_attr_reserved_jetty_id_max", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L308", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L312", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_token", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L313", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sysfs_dev", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L316", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ref", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L317", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ops", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L318", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_provider_ops", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L319", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L358", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "target": "urma_tp_cc_alg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L359", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_alg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L359", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_cc_pattern_idx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L360", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cc_entry_cc_priority", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L361", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L364", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L365", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_path", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L367", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "urma_transport_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L368", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L368", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_ops", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L369", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_device_sysfs_dev", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L370", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L383", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_dev", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L384", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_ops", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L385", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_dev_fd", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L386", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_async_fd", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L387", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L388", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L388", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L389", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L389", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_eid_index", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L390", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L391", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_ref", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L392", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "urma_context_aggr_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L393", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_context_aggr_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L393", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L396", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L397", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L397", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_eid_info_eid_index", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L398", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L401", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L402", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L403", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L406", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L407", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L407", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_fd", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L408", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfce_ref", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L409", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L423", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L424", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "urma_jfc_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L425", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L425", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_ceqn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L426", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "urma_jfce_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L428", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_jfce", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L428", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L429", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L437", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L438", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_moderate_count", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L439", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_attr_moderate_period", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L440", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L443", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L444", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L444", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L445", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L446", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L449", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L450", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L451", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L467", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_jfc_opt_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L468", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_is_actived", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L470", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_cqe_base_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L471", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L472", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_db_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L473", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_db_status", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L474", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_pi", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L475", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_pi_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L476", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_urma_jfc_ci", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L477", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_opt_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L478", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L481", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L482", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L482", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "urma_jfc_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L483", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_jfc_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L483", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "urma_jfc_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L484", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_jfc_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L484", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L485", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L486", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_event_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L486", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "pthread_cond_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L487", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_event_cond", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L487", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_comp_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L488", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_async_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L489", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "urma_jfc_opt_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L490", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfc_urma_jfc_opt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L490", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L534", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_jfs_opt_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L535", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_is_actived", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L537", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_sqe_base_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L538", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L539", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_db_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L540", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_db_status", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L541", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_pi", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L542", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_pi_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L543", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_urma_jfs_ci", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L544", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_opt_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L545", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L548", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L549", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "urma_jfs_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L550", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L550", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L551", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L551", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_priority", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L552", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L554", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_rsge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L555", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_max_inline_data", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L556", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_rnr_retry", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L558", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_err_timeout", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L562", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L564", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_jfc", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L564", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L565", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L568", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L569", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L569", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "urma_jfs_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L570", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_jfs_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L570", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "urma_jfs_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L571", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_jfs_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L571", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L572", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L573", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_event_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L573", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "pthread_cond_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L574", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_event_cond", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L574", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_async_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L575", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "urma_jfs_opt_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L576", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_urma_jfs_opt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L576", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L585", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L586", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr", "target": "urma_jfs_state_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L587", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_attr_state", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L587", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L625", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_jfr_opt_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L626", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_is_actived", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L628", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_rqe_base_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L629", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L630", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_db_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L631", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_db_status", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L632", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_pi", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L633", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_pi_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L634", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_urma_jfr_ci", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L635", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_opt_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L636", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L639", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L640", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_depth", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L642", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "urma_jfr_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L643", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L643", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L644", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L644", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_max_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L645", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_min_rnr_timer", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L646", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L648", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_jfc", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L648", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L649", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_token_value", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L649", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L650", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L658", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L659", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_rx_threshold", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L660", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "target": "urma_jfr_state_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L661", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_attr_state", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L661", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L664", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L665", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L665", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "urma_jfr_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L666", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_jfr_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L666", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "urma_jfr_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L667", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_jfr_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L667", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L668", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L669", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_event_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L669", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "pthread_cond_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L670", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_event_cond", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L670", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_async_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L671", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "urma_jfr_opt_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L672", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_urma_jfr_opt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L672", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L702", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "urma_jfr_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L703", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_jfr_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L703", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L704", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L704", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "urma_import_jetty_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L705", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L705", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "urma_tp_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L706", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjfr_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L706", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L709", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_tpn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L710", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L724", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L726", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L727", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "urma_jetty_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L728", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L728", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "urma_jfs_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L731", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_jfs_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L731", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "urma_jetty_grp_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L741", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_jetty_grp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L741", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L742", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L756", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_jetty_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L757", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_jetty_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L757", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L758", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L758", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_jetty_grp_policy_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L759", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_policy", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L759", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_target_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L760", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L760", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_import_jetty_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L761", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L761", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "urma_tp_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L762", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rjetty_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L762", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L765", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L766", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L766", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_jetty_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L767", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L767", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L768", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L769", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L769", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_tp_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L770", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_tp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L770", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_target_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L771", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L771", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_import_jetty_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L772", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L772", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_jetty_grp_policy_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L773", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_policy", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L773", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "urma_tp_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L774", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_jetty_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L774", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L782", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_mask", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L783", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_rx_threshold", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L784", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "target": "urma_jetty_state_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L785", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_attr_state", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L785", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L788", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_is_actived", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L789", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "target": "urma_jfs_opt_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L790", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_jfs_opt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L790", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_opt_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L791", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L794", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L795", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L795", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "urma_jetty_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L796", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_jetty_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L796", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L797", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_remote_jetty", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L797", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "urma_jetty_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L799", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_jetty_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L799", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L800", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L801", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_event_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L801", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "pthread_cond_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L802", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_event_cond", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L802", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_async_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L803", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "urma_jetty_opt_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L804", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_urma_jetty_opt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L804", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L807", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L808", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L808", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_fd", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L809", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notifier_incomplete_tjetty_list", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L810", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L818", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "target": "urma_notify_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L819", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L819", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "target": "urma_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L820", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_status", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L820", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_notify_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L821", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L840", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L841", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "urma_jetty_grp_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L842", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L842", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L843", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_token_value", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L843", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L844", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "urma_jetty_grp_policy_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L846", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_policy", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L846", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L847", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L850", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L851", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L851", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "urma_jetty_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L852", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_grp_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L852", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "urma_jetty_grp_cfg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L853", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_cfg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L853", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L854", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L855", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_jetty_list", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L855", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L856", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_list_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L856", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L857", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "pthread_mutex_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L858", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_event_mutex", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L858", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "pthread_cond_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L859", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_event_cond", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L859", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jetty_grp_async_events_acked", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L860", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L864", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L865", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L865", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L866", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ubva_va", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L867", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L946", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L947", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L947", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L948", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L949", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "urma_ref_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L950", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_ref", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L950", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "urma_token_id_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L951", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_token_id_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L951", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L954", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_va", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L955", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L956", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "urma_token_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L957", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L957", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L958", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_token_value", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L958", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "urma_reg_seg_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L959", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L959", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L960", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_cfg_iova", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L961", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L964", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "urma_ubva_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L965", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_ubva", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L965", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L966", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "urma_seg_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L967", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L967", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L968", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L971", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "urma_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L972", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_seg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L972", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L973", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_mva", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L974", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L975", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L975", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "urma_token_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L976", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L976", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_seg_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L977", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L980", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L981", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L982", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_in_opcode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L987", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L990", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L991", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L992", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_ctl_out_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L993", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L996", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "target": "urma_seg_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L997", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L997", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L998", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L999", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_user_target_seg_token_value", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L999", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1002", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1003", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1004", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1010", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_tseg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1010", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "urma_user_tseg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1011", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sge_user_tseg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1011", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1014", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1015", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1015", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_sg_num_sge", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1016", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1053", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "urma_sg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1054", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_src", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1054", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "urma_sg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1056", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_dst", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1056", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_target_hint", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1058", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_rw_wr_notify_data", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1059", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1062", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "urma_sg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1063", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_src", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1063", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_target_hint", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1064", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_imm_data", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1065", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1066", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_send_wr_tseg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1066", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1069", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1070", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr_dst", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1070", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1071", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cas_wr_src", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1071", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1082", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1083", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr_dst", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1083", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1084", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_faa_wr_src", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1084", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1091", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "urma_opcode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1092", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_opcode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1092", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "urma_jfs_wr_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1093", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1093", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1094", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_tjetty", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1094", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1095", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfs_wr_next", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1102", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1105", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "target": "urma_sg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1106", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_src", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1106", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1107", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_wr_next", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1108", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1122", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1123", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token", "target": "urma_token_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1124", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_token_token_value", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1124", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1127", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "urma_cr_status_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1128", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_status", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1128", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1129", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "urma_cr_opcode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1130", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_opcode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1130", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "urma_cr_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1131", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1131", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_completion_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1132", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_local_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1134", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "urma_jetty_id_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1135", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_remote_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1135", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_tpn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1141", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_cr_user_data", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1142", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1145", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "urma_context_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1147", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_urma_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1147", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_element", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1156", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "urma_async_event_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1157", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_event_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1157", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_async_event_priv", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1158", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1184", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1185", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1186", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "urma_ur_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1187", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1187", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_token", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1188", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_user_ctx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1189", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1193", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1194", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1195", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "urma_import_ur_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1196", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1196", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1197", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_tseg_list", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1197", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_target_ur_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1198", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1201", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info", "target": "urma_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1202", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info_seg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1202", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_seg_info_idx_in_ur", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1203", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1207", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1208", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1209", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "urma_ur_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1210", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1210", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1211", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "urma_seg_info_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1212", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_ur_info_seg_list", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1212", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1215", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_name", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1216", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1217", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1217", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1218", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_jfr_info_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1219", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1238", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "urma_tp_cfg_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1239", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1239", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1241", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1241", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_retry_num", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1242", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_retry_factor", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1243", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_ack_timeout", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1244", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_dscp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1245", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_cfg_oor_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1246", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1295", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "target": "sa_family_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1296", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_sin_family", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1296", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_vlan", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1301", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_mac", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1302", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_prefix_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1303", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1306", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info", "target": "urma_net_addr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1307", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info_netaddr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1307", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_net_addr_info_index", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1308", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1311", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "urma_tp_mod_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1312", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1312", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_tpn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1313", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "urma_tp_state_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1314", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_state", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1314", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_tx_psn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1315", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_rx_psn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1316", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "urma_mtu_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1317", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_mtu", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1317", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_cc_pattern_idx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1318", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_oos_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1319", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_local_net_addr_idx", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1320", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "urma_net_addr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1321", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_net_addr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1321", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_data_udp_start", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1322", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_ack_udp_start", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1323", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_udp_range", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1324", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_hop_limit", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1325", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_flow_label", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1326", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_port_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1327", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_mn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1328", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "urma_transport_type_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1329", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_peer_trans_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1329", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1347", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "urma_get_tp_cfg_flag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1348", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_flag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1348", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "urma_transport_mode_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1349", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_trans_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1349", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1350", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_local_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1350", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "urma_eid_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1351", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_get_tp_cfg_peer_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1351", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_info", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1354", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_info", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_info_tp_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1355", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1358", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_tx_psn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1359", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_rx_psn", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1360", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_attr_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1361", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1364", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tp_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1365", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_peer_tp_handle", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1366", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tag", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1367", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "target": "urma_active_tp_attr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1368", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg_tp_attr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1368", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1371", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1372", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_active_tp_cfg", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1373", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "relation": "contains", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1376", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_retry_times_init", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1377", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_at", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1378", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sip", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1379", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dip", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1380", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sma", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1381", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dma", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1382", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_vlan_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1383", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_vlan_en", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1384", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dscp", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1385", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_at_times", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1386", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sl", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1387", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_ttl", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1388", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_ack_udp_srcport", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1389", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_data_udp_srcport", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1390", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_udp_srcport_range", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1391", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_spray_en", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1392", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_udp_global_en", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1393", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserve_0", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1394", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_sl_bitmap", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1395", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_dscp_config_mode", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1396", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserve_1", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1397", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_types_urma_tp_attr_value_reserved", "relation": "defines", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_types.h", "source_location": "L1398", "weight": 1.0, "context": "field"}], "raw_calls": []} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/7899e48f9378edf160c448d2d8eb8cdaa14683461e3f2562a4ce8dedce8721ed.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/7899e48f9378edf160c448d2d8eb8cdaa14683461e3f2562a4ce8dedce8721ed.json new file mode 100644 index 0000000000..0ffde6c745 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/7899e48f9378edf160c448d2d8eb8cdaa14683461e3f2562a4ce8dedce8721ed.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "label": "urma_endpoint.h", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmatransport", "label": "UrmaTransport", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L42", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmahandshake", "label": "UrmaHandshake", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L46", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_parsedhello", "label": "ParsedHello", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L47", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "label": "UrmaConnect", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L56", "_callable": true}, {"id": "appconnect", "label": "AppConnect", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "label": "StartConnect", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L59"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_stopconnect", "label": "StopConnect", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L61"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_run", "label": "Run", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L70"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_data", "label": "_data", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L72"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_error", "label": "_error", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L73"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "label": "UrmaResource", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L81", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_next", "label": "next", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L82"}, {"id": "urma_jfc_t", "label": "urma_jfc_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfc", "label": "jfc", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L84"}, {"id": "urma_jfce_t", "label": "urma_jfce_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfce", "label": "jfce", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L85"}, {"id": "urma_jfr_t", "label": "urma_jfr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfr", "label": "jfr", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L86"}, {"id": "urma_jetty_t", "label": "urma_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jetty", "label": "jetty", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L87"}, {"id": "urma_target_jetty_t", "label": "urma_target_jetty_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_remote_jetty", "label": "remote_jetty", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L89"}, {"id": "urma_target_seg_t", "label": "urma_target_seg_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_remote_seg", "label": "remote_seg", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L90"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "label": ".UrmaResource()", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L92", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint", "label": "UrmaEndpoint()", "file_type": "code", "source_file": "urma_endpoint.h", "source_location": "L100", "_callable": true}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "cstdint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L21", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "functional", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "vector", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "atomicops", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L25", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "iobuf", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "macros", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L27", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "mpsc_queue", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L28", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L29", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "socket", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L31", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "urma_api", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L35", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "urma_types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L36", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L37", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L38", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmatransport", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L42", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmahandshake", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L46", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_parsedhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L47", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L56", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "appconnect", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L56", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L59", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_stopconnect", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L61", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_run", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L70", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_data", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L72", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_error", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L73", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L81", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_next", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L82", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L84", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfc", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L84", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_jfce_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L85", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfce", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L85", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_jfr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L86", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jfr", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L86", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L87", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_jetty", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L87", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_target_jetty_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L89", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_remote_jetty", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L89", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "urma_target_seg_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L90", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_remote_seg", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L90", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L92", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L100", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.h", "source_location": "L344", "weight": 1.0}], "raw_calls": [{"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint", "callee": "DISALLOW_COPY_AND_ASSIGN", "is_member_call": false, "source_file": "urma_endpoint.h", "source_location": "L334", "receiver": null, "lang": "cpp"}], "cpp_type_table": {"path": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h", "table": {"_rbuf": "IOBuf>", "_sbuf": "IOBuf>", "_cq_sid": "SocketId", "_resource": "UrmaResource", "_socket": "Socket"}}} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/9ead6eae6b7ea7f4b18e3757e1e7d33a73a6879dca40078e12765880de1061a1.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/9ead6eae6b7ea7f4b18e3757e1e7d33a73a6879dca40078e12765880de1061a1.json new file mode 100644 index 0000000000..52450abd22 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/9ead6eae6b7ea7f4b18e3757e1e7d33a73a6879dca40078e12765880de1061a1.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "label": "urma_handshake.h", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "label": "UrmaEndpoint", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L32", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "label": "ParsedHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L38", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_buffer_size", "label": "buffer_size", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L39"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_recv_buffer_cnt", "label": "recv_buffer_cnt", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L40"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_jetty_id", "label": "jetty_id", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L41"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_eid", "label": "eid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L42"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_uasid", "label": "uasid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L43"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_tp_type", "label": "tp_type", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L44"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_eid", "label": "seg_eid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L47"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_uasid", "label": "seg_uasid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L48"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_va", "label": "seg_va", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L49"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_len", "label": "seg_len", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L50"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_token_id", "label": "seg_token_id", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L51"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "label": "HelloMessage", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L73", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_msg_len", "label": "msg_len", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L74"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_hello_ver", "label": "hello_ver", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L75"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_impl_ver", "label": "impl_ver", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L76"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_buffer_size", "label": "buffer_size", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L77"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_recv_buffer_cnt", "label": "recv_buffer_cnt", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L78"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_jetty_id", "label": "jetty_id", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L79"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_eid", "label": "eid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L80"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_uasid", "label": "uasid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L81"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_tp_type", "label": "tp_type", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L82"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_pad", "label": "pad", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L83"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_eid", "label": "seg_eid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L84"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_uasid", "label": "seg_uasid", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L85"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_va", "label": "seg_va", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L86"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_len", "label": "seg_len", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L87"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_token_id", "label": "seg_token_id", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L88"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "label": "Serialize", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L90"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "label": "Deserialize", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L91"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "label": "UrmaHandshake", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L97", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_urmahandshake", "label": ".~UrmaHandshake()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L99", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_protocolversion", "label": "ProtocolVersion", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L100"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_sendlocalhello", "label": "SendLocalHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L104"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_receiveandparseremotehello", "label": "ReceiveAndParseRemoteHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L110"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "label": "UrmaHandshakeClientV2", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L114", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_urmahandshakeclientv2", "label": ".UrmaHandshakeClientV2()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L116", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_protocolversion", "label": ".ProtocolVersion()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L117", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "label": "SendLocalHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L118"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "label": "ReceiveAndParseRemoteHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L119"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_ep", "label": "_ep", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L121"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "label": "UrmaHandshakeServerV2", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L124", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_urmahandshakeserverv2", "label": ".UrmaHandshakeServerV2()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L126", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_protocolversion", "label": ".ProtocolVersion()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L127", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "label": "SendLocalHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L128"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "label": "ReceiveAndParseRemoteHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L129"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_ep", "label": "_ep", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L131"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "label": "UrmaHandshakeClientV3", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L135", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_urmahandshakeclientv3", "label": ".UrmaHandshakeClientV3()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L137", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_protocolversion", "label": ".ProtocolVersion()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L138", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "label": "SendLocalHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L139"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "label": "ReceiveAndParseRemoteHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L140"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_ep", "label": "_ep", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L142"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "label": "UrmaHandshakeServerV3", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L145", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_urmahandshakeserverv3", "label": ".UrmaHandshakeServerV3()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L147", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_protocolversion", "label": ".ProtocolVersion()", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L148", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "label": "SendLocalHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L149"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "label": "ReceiveAndParseRemoteHello", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L150"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_ep", "label": "_ep", "file_type": "code", "source_file": "urma_handshake.h", "source_location": "L152"}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "cstdint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L21", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "cstring", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "string", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "urma_types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L27", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L32", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L38", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_buffer_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L39", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_recv_buffer_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L40", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_jetty_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L41", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L42", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L43", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L44", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L47", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L48", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_va", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L49", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L50", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_parsedhello_seg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L51", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L73", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_msg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L74", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_hello_ver", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L75", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_impl_ver", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L76", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_buffer_size", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L77", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_recv_buffer_cnt", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L78", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_jetty_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L79", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L80", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L81", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_tp_type", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L82", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_pad", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L83", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_eid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L84", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_uasid", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L85", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_va", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L86", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_len", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L87", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_seg_token_id", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L88", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_serialize", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L90", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_hellomessage_deserialize", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L91", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L97", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_urmahandshake", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L99", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_protocolversion", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L100", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_sendlocalhello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L104", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake_receiveandparseremotehello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L110", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L114", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L114", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_urmahandshakeclientv2", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L116", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L116", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_protocolversion", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L117", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_sendlocalhello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L118", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_receiveandparseremotehello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L119", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L121", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv2_ep", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L121", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L124", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L124", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_urmahandshakeserverv2", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L126", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L126", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_protocolversion", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L127", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_sendlocalhello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L128", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_receiveandparseremotehello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L129", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L131", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv2_ep", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L131", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L135", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L135", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_urmahandshakeclientv3", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L137", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L137", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_protocolversion", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L138", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_sendlocalhello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L139", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_receiveandparseremotehello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L140", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L142", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeclientv3_ep", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L142", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_h", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L145", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshake", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L145", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_urmahandshakeserverv3", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L147", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L147", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_protocolversion", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L148", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_sendlocalhello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L149", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_receiveandparseremotehello", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L150", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmaendpoint", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L152", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_handshake_urmahandshakeserverv3_ep", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_handshake.h", "source_location": "L152", "weight": 1.0, "context": "field"}], "raw_calls": []} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/bb7775d86173e02925fc786db010956f4dd08aef5a92ffdbffd70a11effd1833.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/bb7775d86173e02925fc786db010956f4dd08aef5a92ffdbffd70a11effd1833.json new file mode 100644 index 0000000000..3373b3214b --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/bb7775d86173e02925fc786db010956f4dd08aef5a92ffdbffd70a11effd1833.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "label": "urma_endpoint.cpp", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty", "label": "PreparedJetty", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L82", "_callable": true}, {"id": "urmaresource", "label": "UrmaResource", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty_res", "label": "res", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L83"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjettycount", "label": "PreparedJettyCount()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L89", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "label": "UrmaResource::~UrmaResource()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L125", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "label": "UrmaEndpoint::UrmaEndpoint()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L138", "_callable": true}, {"id": "socket", "label": "Socket", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "label": "UrmaEndpoint::Reset()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L159", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "label": "UrmaEndpoint::ReadFromFd()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L188", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pushbacktoreadbuf", "label": "UrmaEndpoint::PushBackToReadBuf()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L215", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "label": "UrmaEndpoint::WriteToFd()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L219", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "label": "UrmaEndpoint::MakeLocalParsedHello()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L239", "_callable": true}, {"id": "parsedhello", "label": "ParsedHello", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "label": "UrmaEndpoint::FillLocalHelloV2()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L261", "_callable": true}, {"id": "hellomessage", "label": "HelloMessage", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "label": "UrmaEndpoint::FillLocalHelloV3()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L282", "_callable": true}, {"id": "urmahello", "label": "UrmaHello", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "label": "UrmaEndpoint::WriteHelloV3()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L298", "_callable": true}, {"id": "iobuf", "label": "IOBuf", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "label": "UrmaEndpoint::ReadAndParseHelloV3()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L327", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "label": "UrmaEndpoint::AllocateResources()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L360", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "label": "UrmaEndpoint::DeallocateResources()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L462", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "label": "UrmaEndpoint::ImportPeer()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L494", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf", "label": "UrmaIOBuf", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L546", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "label": ".cut_into_sglist()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L556", "_callable": true}, {"id": "urma_sge_t", "label": "urma_sge_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "label": "UrmaEndpoint::CutFromIOBufList()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L590", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_iswritable", "label": "UrmaEndpoint::IsWritable()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L664", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_dopostrecv", "label": "UrmaEndpoint::DoPostRecv()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L673", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "label": "UrmaEndpoint::PostRecv()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L687", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendimm", "label": "UrmaEndpoint::SendImm()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L727", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendack", "label": "UrmaEndpoint::SendAck()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L751", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "label": "UrmaEndpoint::HandleCompletion()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L761", "_callable": true}, {"id": "urma_cr_t", "label": "urma_cr_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "label": "UrmaEndpoint::PollCq()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L847", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "label": "UrmaEndpoint::ApplyRemoteHello()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L930", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "label": "UrmaEndpoint::OnNewDataFromTcp()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L953", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_tryreadontcp", "label": "UrmaEndpoint::TryReadOnTcp()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1010", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "label": "TryReadOnTcpDuringUrmaEst()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1016", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "label": "UrmaEndpoint::FallbackToTcp()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1042", "_callable": true}, {"id": "urmatransport", "label": "UrmaTransport", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "label": "UrmaEndpoint::FailHandshake()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1051", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "label": "UrmaEndpoint::ProcessHandshakeAtClient()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1072", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "label": "UrmaEndpoint::ProcessHandshakeAtServer()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1144", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "label": "UrmaConnect::StartConnect()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1240", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_stopconnect", "label": "UrmaConnect::StopConnect()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1279", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_run", "label": "UrmaConnect::Run()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1281", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_getstatestr", "label": "UrmaEndpoint::GetStateStr()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1293", "_callable": true}, {"id": "string", "label": "string", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "label": "UrmaEndpoint::DebugInfo()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1313", "_callable": true}, {"id": "ostream", "label": "ostream", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "stringpiece", "label": "StringPiece", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "label": "UrmaEndpoint::WaitCqEvent()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1322", "_callable": true}, {"id": "socketuniqueptr", "label": "SocketUniquePtr", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "urma_jfc_t", "label": "urma_jfc_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "label": "UrmaEndpoint::ReqNotifyCq()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1353", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "label": "UrmaEndpoint::PollingModeInitialize()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "_callable": true}, {"id": "bthread_tag_t", "label": "bthread_tag_t", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "function", "label": "function", "file_type": "code", "source_file": "", "source_location": "", "origin_file": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp"}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "label": "UrmaEndpoint::PollingModeRelease()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1462", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "label": "UrmaEndpoint::PollerAddCqSid()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1476", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "label": "UrmaEndpoint::PollerRemoveCqSid()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1492", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "label": "UrmaEndpoint::GlobalInitialize()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1505", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalrelease", "label": "UrmaEndpoint::GlobalRelease()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1566", "_callable": true}, {"id": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_bringupjetty", "label": "UrmaEndpoint::BringUpJetty()", "file_type": "code", "source_file": "urma_endpoint.cpp", "source_location": "L1581", "_callable": true}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_endpoint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L18", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "algorithm", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L22", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "cstring", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L23", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "iostream", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L24", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "memory", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L25", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "string", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L26", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "unordered_set", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L27", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "utility", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L28", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "vector", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L29", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "resource", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L30", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "unistd", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L31", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "gflags", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L33", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "atomicops", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L35", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "iobuf", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L36", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "logging", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L37", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "macros", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L38", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "sys_byteorder", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L39", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "time", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L40", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "bthread", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L41", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "butex", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L42", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "input_messenger", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L44", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "socket", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L45", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_api", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L46", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_endpoint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L47", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L48", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_handshake", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L49", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_helper", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L50", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "urma_transport", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L51", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L82", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty", "target": "urmaresource", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L83", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjetty_res", "relation": "defines", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L83", "weight": 1.0, "context": "field"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjettycount", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L89", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L125", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L138", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L138", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L151", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L159", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L188", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pushbacktoreadbuf", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L215", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L219", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L239", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L239", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L261", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "target": "hellomessage", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L261", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L282", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "target": "urmahello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L282", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L298", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "target": "urmahello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L298", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L312", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "target": "iobuf", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L312", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L327", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L327", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L360", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L462", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L494", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L494", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L546", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf", "target": "iobuf", "relation": "inherits", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L546", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "relation": "method", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L556", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "target": "urma_sge_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L556", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "target": "iobuf", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L556", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L590", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "target": "iobuf", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L590", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_iswritable", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L664", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_dopostrecv", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L673", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L687", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendimm", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L727", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendack", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L751", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L761", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "target": "urma_cr_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L761", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L847", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L847", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L930", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "target": "parsedhello", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L930", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L953", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L953", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_tryreadontcp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1010", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1016", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1016", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1042", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "target": "urmatransport", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1042", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1051", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "target": "urmatransport", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1051", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1072", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1144", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1240", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1240", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_stopconnect", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1279", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_stopconnect", "target": "socket", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1279", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_run", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1281", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_getstatestr", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1293", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_getstatestr", "target": "string", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1293", "weight": 1.0, "context": "return_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1313", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "target": "ostream", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1313", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "target": "stringpiece", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1313", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1322", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "target": "socketuniqueptr", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1322", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "target": "urma_jfc_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1322", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1353", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "target": "bthread_tag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "target": "function", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1368", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1462", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "target": "bthread_tag_t", "relation": "references", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1462", "weight": 1.0, "context": "parameter_type"}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1476", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1492", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1505", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalrelease", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1566", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_cpp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_bringupjetty", "relation": "contains", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1581", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L622", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1003", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "target": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjettycount", "relation": "calls", "context": "call", "confidence": "EXTRACTED", "source_file": "urma_endpoint.cpp", "source_location": "L1521", "weight": 1.0}], "raw_calls": [{"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjettycount", "callee": "getrlimit", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L97", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_preparedjettycount", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L113", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_unimport_jetty", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L126", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_unimport_seg", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L127", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_delete_jetty", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L128", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_delete_jfr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L129", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_delete_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L130", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaresource_urmaresource", "callee": "urma_delete_jfce", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L131", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "callee": "butex_create_checked>", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L147", "receiver": "bthread", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L148", "receiver": "_read_butex", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "callee": "DeallocateResources", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L152", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_urmaendpoint", "callee": "butex_destroy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L154", "receiver": "bthread", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "DeallocateResources", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L160", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L166", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L167", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L168", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L177", "receiver": "_sbuf", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L178", "receiver": "_rbuf", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L179", "receiver": "_rbuf_data", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reset", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L180", "receiver": "_read_butex", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L192", "receiver": "_read_butex", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "callee": "milliseconds_from_now", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L193", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "callee": "fd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L194", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "callee": "read", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L195", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readfromfd", "callee": "butex_wait", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L198", "receiver": "bthread", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pushbacktoreadbuf", "callee": "append", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L216", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "milliseconds_from_now", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L223", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "fd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L224", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "write", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L225", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "WaitEpollOut", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L228", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "callee": "GetUrmaRecvBlockSize", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L241", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L246", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "callee": "GetPoolSegFor", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L251", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_makelocalparsedhello", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L253", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "callee": "MakeLocalParsedHello", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L267", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L272", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov2", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L275", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "MakeLocalParsedHello", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L284", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_buffer_size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L285", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_recv_buffer_cnt", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L286", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_jetty_id", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L287", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L288", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_uasid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L289", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_tp_type", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L290", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_seg_eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L291", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_seg_uasid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L292", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_seg_va", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L293", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_seg_len", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L294", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_filllocalhellov3", "callee": "set_seg_token_id", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L295", "receiver": "out", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "append", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L300", "receiver": "packet", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "SerializeToString", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L302", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L303", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L306", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L306", "receiver": "body", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "append", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L307", "receiver": "packet", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "append", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L308", "receiver": "packet", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writehellov3", "callee": "WriteToFd", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L309", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L314", "receiver": "data", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "milliseconds_from_now", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L315", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "fd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L316", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "cut_into_file_descriptor", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L317", "receiver": "data", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_writetofd", "callee": "WaitEpollOut", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L320", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "ReadFromFd", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L330", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L331", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "ReadFromFd", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L334", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "ParseFromArray", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L336", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "data", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L336", "receiver": "body", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L336", "receiver": "body", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L339", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L339", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L339", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L339", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "buffer_size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L340", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "recv_buffer_cnt", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L341", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "jetty_id", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L342", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L343", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "data", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L343", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L343", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "uasid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L344", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "tp_type", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L345", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L346", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "data", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L346", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_eid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L346", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_uasid", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L347", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_va", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L348", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_len", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L349", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "seg_token_id", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L350", "receiver": "msg", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_readandparsehellov3", "callee": "ValidHello", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L351", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "GetUrmaContext", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L362", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L371", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "urma_create_jfce", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L385", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L388", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "urma_create_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L396", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L397", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "urma_create_jfr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L405", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L406", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "GetUrmaMaxSge", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L414", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "urma_create_jetty", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L420", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L421", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "resize", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L424", "receiver": "_sbuf", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "resize", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L425", "receiver": "_rbuf", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "resize", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L426", "receiver": "_rbuf_data", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L431", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "ReqNotifyCq", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L435", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "keytable_pool", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L440", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "Create", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L443", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L444", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "keytable_pool", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L451", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "Create", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L453", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L454", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_allocateresources", "callee": "PollerAddCqSid", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L457", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "callee": "PollerRemoveCqSid", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L466", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "callee": "Address", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L472", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "callee": "fd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L473", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "callee": "RemoveConsumer", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L474", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_deallocateresources", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L478", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "GetUrmaContext", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L495", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L502", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "urma_import_seg", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L512", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L514", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "memcpy", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L520", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "urma_import_jetty", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L532", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_importpeer", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L534", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "_ref_num", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L560", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "_ref_at", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L561", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "fetch1", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L562", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "GetPoolSegFor", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L564", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "get_first_data_meta", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L567", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaiobuf_cut_into_sglist", "callee": "cutn", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L582", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "GetUrmaMaxSge", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L595", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "alloca", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L599", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L605", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L606", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "GetUrmaRecvBlockSize", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L617", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L621", "receiver": "data", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "memset", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L631", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "exchange", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L633", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "urma_post_jetty_send_wr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L642", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L644", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L645", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "GetUrmaMaxSge", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L647", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L652", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L655", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "fetch_sub", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L657", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_cutfromiobuflist", "callee": "fetch_sub", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L658", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_iswritable", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L665", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_iswritable", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L666", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_dopostrecv", "callee": "GetPoolSegFor", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L674", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_dopostrecv", "callee": "urma_post_jfr_wr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L681", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "GetUrmaRecvBlockSize", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L689", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L691", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "Next", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L696", "receiver": "zcis", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "DoPostRecv", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L702", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L705", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "Next", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L711", "receiver": "zcos", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_postrecv", "callee": "DoPostRecv", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L718", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendimm", "callee": "memset", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L735", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendimm", "callee": "urma_post_jetty_send_wr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L743", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendimm", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L744", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendack", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L753", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendack", "callee": "SendImm", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L756", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_sendack", "callee": "exchange", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L756", "receiver": "_new_rq_wrs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L763", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L771", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L773", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "SendAck", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L782", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "clear", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L787", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "subtle::MemoryBarrier", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L790", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L791", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L792", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "WakeAsEpollOut", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L794", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L801", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L807", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L810", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "compare_exchange_weak", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L814", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L820", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "WakeAsEpollOut", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L821", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L824", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "GetUrmaRecvBlockSize", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L828", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L829", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "cutn", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L838", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "append", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L840", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "PostRecv", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L842", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_handlecompletion", "callee": "SendAck", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L843", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "user", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L848", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "Address", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L851", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "Failed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L852", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "WaitCqEvent", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L856", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "min", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L866", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "urma_poll_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L868", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L874", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L876", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "Failed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L878", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "HandleCompletion", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L882", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "urma_ack_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L896", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "ReqNotifyCq", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L897", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "Failed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L902", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L903", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "cpuwide_time_us", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L908", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "gettimeofday_us", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L909", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "user", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L910", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "ProcessNewMessage", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L913", "receiver": "messenger", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L913", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L915", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L918", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L920", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollcq", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L921", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "callee": "min", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L934", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L942", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_applyremotehello", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L944", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L954", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "OnNewMessages", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L961", "receiver": "InputMessenger", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L967", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "CreatedByConnect", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L969", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "IsUrmaAvailable", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L971", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "OnNewMessages", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L974", "receiver": "InputMessenger", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "ReAddress", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L978", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "bthread_attr_set_name", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L982", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "bthread_start_background", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L983", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L986", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "release", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L988", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "fetch_add", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L996", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "butex_wake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L997", "receiver": "bthread", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "OnNewMessages", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1000", "receiver": "InputMessenger", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_onnewdatafromtcp", "callee": "MoreReadEvents", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1006", "receiver": "m", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_tryreadontcp", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1011", "receiver": "_state", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_tryreadontcp", "callee": "OnNewMessages", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1012", "receiver": "InputMessenger", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "read", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1020", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "fd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1020", "receiver": "socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1024", "receiver": "socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "berror", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1025", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "MoreReadEvents", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1028", "receiver": "socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "SetEOF", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1032", "receiver": "socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_tryreadontcpduringurmaest", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1035", "receiver": "socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1044", "receiver": "_state", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "callee": "DeallocateResources", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1045", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_fallbacktotcp", "callee": "TryReadOnTcp", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1047", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1053", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "GetStateStr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1053", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1054", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "berror", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1056", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1058", "receiver": "_state", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "DeallocateResources", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1059", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1061", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_failhandshake", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1065", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1075", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1076", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1077", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1078", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "IsUrmaAvailable", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1079", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1080", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "AllocateResources", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1084", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1085", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "PostRecv", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1089", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1090", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1093", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1094", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "ProtocolVersion", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1097", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "SendLocalHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1098", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1100", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1103", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1104", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "ReceiveAndParseRemoteHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1108", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1110", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1114", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1117", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1118", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "ApplyRemoteHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1119", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "ImportPeer", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1121", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1123", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1126", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1127", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "HostToNet32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1130", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "WriteToFd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1131", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1133", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1138", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatclient", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1140", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1147", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1148", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1149", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1150", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1153", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1155", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "PushBackToReadBuf", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1161", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1162", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ProtocolVersion", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1165", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ReceiveAndParseRemoteHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1168", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1170", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1174", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1177", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1178", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "AllocateResources", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1180", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1182", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "PostRecv", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1185", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1187", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1190", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1191", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ApplyRemoteHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1192", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ImportPeer", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1194", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1196", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1199", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1200", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "SendLocalHello", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1202", "receiver": "hs", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1204", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1207", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1208", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "ReadFromFd", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1211", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1213", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "NetToHost32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1216", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1219", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FailHandshake", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1222", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1227", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1229", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_processhandshakeatserver", "callee": "FallbackToTcp", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1231", "receiver": "ep", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "Address", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1243", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1249", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "Run", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1251", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "IsUrmaAvailable", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1254", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "Run", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1260", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "bthread_attr_set_name", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1265", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "bthread_start_background", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1266", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "Run", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1271", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_startconnect", "callee": "release", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1275", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaconnect_run", "callee": "cb", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1285", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_getstatestr", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1294", "receiver": "_state", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "callee": "GetStateStr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1314", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1317", "receiver": "_sq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_debuginfo", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1318", "receiver": "_remote_rq_window_size", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "urma_wait_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1329", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1335", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1336", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1337", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "berror", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1338", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1343", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1343", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1345", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "LOG_IF", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1348", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_waitcqevent", "callee": "description", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1349", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "callee": "urma_rearm_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1358", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "callee": "PLOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1361", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "callee": "SetFailed", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1362", "receiver": "_socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_reqnotifycq", "callee": "berror", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1362", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1374", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1375", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "compare_exchange_strong", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1381", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "init_fn", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1396", "receiver": "poller", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "load", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1398", "receiver": "running", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "Dequeue", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1399", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "emplace", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1401", "receiver": "cq_sids", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "erase", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1403", "receiver": "cq_sids", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "Address", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1408", "receiver": "Socket", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "PollCq", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1409", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1409", "receiver": "s", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "callback", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1413", "receiver": "poller", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1415", "receiver": "cq_sids", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "bthread_yield", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1416", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "release_fn", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1420", "receiver": "poller", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1426", "receiver": "pollers", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1433", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "bthread_join", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1435", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "bthread_attr_set_name", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1445", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "bthread_start_background", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1446", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "get", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1447", "receiver": "args", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1449", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "bthread_join", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1451", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmodeinitialize", "callee": "release", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1457", "receiver": "args", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1463", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "callee": "store", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1467", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollingmoderelease", "callee": "bthread_join", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1470", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1477", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "bthread_self_tag", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1480", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1481", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1485", "receiver": "pollers", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "fmix32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1487", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1487", "receiver": "pollers", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_polleraddcqsid", "callee": "Enqueue", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1488", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1493", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1494", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1498", "receiver": "pollers", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "fmix32", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1500", "receiver": "butil", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1500", "receiver": "pollers", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_pollerremovecqsid", "callee": "Enqueue", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1501", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "empty", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1508", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1510", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "vector", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1516", "receiver": "std", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "GetUrmaContext", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1519", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "urma_create_jfce", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1525", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "urma_create_jfc", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1534", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "urma_create_jfr", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1542", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "GetUrmaMaxSge", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1550", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "urma_create_jetty", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1556", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalinitialize", "callee": "LOG", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1562", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalrelease", "callee": "BAIDU_SCOPED_LOCK", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1568", "receiver": null, "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalrelease", "callee": "size", "is_member_call": true, "source_file": "urma_endpoint.cpp", "source_location": "L1576", "receiver": "_poller_groups", "lang": "cpp"}, {"caller_nid": "c_workspace_code_opensource_brpc_src_brpc_urma_urma_endpoint_urmaendpoint_globalrelease", "callee": "PollingModeRelease", "is_member_call": false, "source_file": "urma_endpoint.cpp", "source_location": "L1577", "receiver": null, "lang": "cpp"}], "cpp_type_table": {"path": "C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp", "table": {"p": "ParsedHello", "packet": "IOBuf", "msg": "UrmaHello", "options": "SocketOptions", "next": "UrmaResource", "s": "SocketUniquePtr", "r": "BlockRef", "to": "IOBuf", "zcos": "IOBufAsZeroCopyOutputStream", "zcis": "IOBufAsZeroCopyOutputStream", "last_msg": "InputMessageClosure", "state": "State", "ep": "UrmaEndpoint", "remote": "ParsedHello", "guard": "RunGuard"}}} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/ast/v0.9.23/f822344e09f50ff082a2ebbaa0f37defc274c585af039c0e7b995bfe7f0bf804.json b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/f822344e09f50ff082a2ebbaa0f37defc274c585af039c0e7b995bfe7f0bf804.json new file mode 100644 index 0000000000..fa3caa7fdb --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/ast/v0.9.23/f822344e09f50ff082a2ebbaa0f37defc274c585af039c0e7b995bfe7f0bf804.json @@ -0,0 +1 @@ +{"nodes": [{"id": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_api_h", "label": "urma_api.h", "file_type": "code", "source_file": "sdk/urma/urma_api.h", "source_location": "L1"}], "edges": [{"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_api_h", "target": "stdbool", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_api.h", "source_location": "L13", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_api_h", "target": "stdint", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_api.h", "source_location": "L14", "weight": 1.0}, {"source": "c_workspace_code_opensource_brpc_src_brpc_urma_sdk_urma_urma_api_h", "target": "urma_types", "relation": "imports", "context": "import", "confidence": "EXTRACTED", "source_file": "sdk/urma/urma_api.h", "source_location": "L16", "weight": 1.0}], "raw_calls": []} \ No newline at end of file diff --git a/src/brpc/urma/graphify-out/cache/stat-index.json b/src/brpc/urma/graphify-out/cache/stat-index.json new file mode 100644 index 0000000000..6e429df537 --- /dev/null +++ b/src/brpc/urma/graphify-out/cache/stat-index.json @@ -0,0 +1 @@ +{"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\mock_urma.cpp":{"size":22422,"mtime_ns":1785291503405746700,"word_count":2055,"hashes":{"mock_urma.cpp":"608feeb18131c6633a1d3bae5ce1bdaf944a337cafc10e12152fa2915751f7d0"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_api.h":{"size":47786,"mtime_ns":1785227626464076200,"word_count":6750,"hashes":{"sdk/urma/urma_api.h":"f822344e09f50ff082a2ebbaa0f37defc274c585af039c0e7b995bfe7f0bf804"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_opcode.h":{"size":10591,"mtime_ns":1785226861704155300,"word_count":1138,"hashes":{"sdk/urma/urma_opcode.h":"01ccfd37e3d64cd110462f1203e0d20642510e3e3d14a570a041257996772a31"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\sdk\\urma\\urma_types.h":{"size":54318,"mtime_ns":1785227626506547800,"word_count":6079,"hashes":{"sdk/urma/urma_types.h":"6870b34881c2bda6a7406307467705c41b2381b7a5af286fab00d3241d6a5eca"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.cpp":{"size":58559,"mtime_ns":1785309099990290300,"word_count":5389,"hashes":{"urma_endpoint.cpp":"bb7775d86173e02925fc786db010956f4dd08aef5a92ffdbffd70a11effd1833"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_endpoint.h":{"size":13432,"mtime_ns":1785309036527955400,"word_count":1577,"hashes":{"urma_endpoint.h":"7899e48f9378edf160c448d2d8eb8cdaa14683461e3f2562a4ce8dedce8721ed"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.cpp":{"size":11297,"mtime_ns":1785291857383725700,"word_count":1138,"hashes":{"urma_handshake.cpp":"3dcbdee4a792ca85149ae0eada9ea3f39bb1c3f972074cfdeb983ed964bc1f54"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_handshake.h":{"size":6762,"mtime_ns":1785291144209111300,"word_count":893,"hashes":{"urma_handshake.h":"9ead6eae6b7ea7f4b18e3757e1e7d33a73a6879dca40078e12765880de1061a1"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.cpp":{"size":24053,"mtime_ns":1785307850782229900,"word_count":2487,"hashes":{"urma_helper.cpp":"5af18e30c1f05aae06e4f45bf09d4d6ab3654daf64631c4821071a362adf2f1e"}},"C:\\workspace\\code\\opensource\\brpc\\src\\brpc\\urma\\urma_helper.h":{"size":3392,"mtime_ns":1785290825559803600,"word_count":452,"hashes":{"urma_helper.h":"1df09f4812201fd3151eb13e804615a74b896364be016d8a28ec657f714e1422"}}} \ No newline at end of file diff --git a/test/brpc_rdma_unittest.cpp b/test/brpc_rdma_unittest.cpp index 9c52acb797..70c27bf37d 100644 --- a/test/brpc_rdma_unittest.cpp +++ b/test/brpc_rdma_unittest.cpp @@ -15,34 +15,35 @@ // specific language governing permissions and limitations // under the License. - +#include +#include #include #include -#include -#include + #if BRPC_WITH_RDMA -#include -#include "butil/endpoint.h" -#include "butil/fd_guard.h" -#include "butil/iobuf.h" -#include "butil/sys_byteorder.h" -#include "butil/files/temp_file.h" #include "brpc/acceptor.h" +#include "brpc/adapter_transport.h" #include "brpc/channel.h" #include "brpc/controller.h" -#include "brpc/server.h" -#include "brpc/socket.h" #include "brpc/errno.pb.h" +#include "brpc/handshake/rdma_handshake.h" +#include "brpc/handshake/rdma_handshake_constants.h" #include "brpc/parallel_channel.h" -#include "brpc/selective_channel.h" -#include "brpc/rdma_transport.h" #include "brpc/rdma/block_pool.h" #include "brpc/rdma/rdma_endpoint.h" -#include "brpc/rdma/rdma_handshake.h" -#include "brpc/rdma/rdma_handshake_constants.h" -#include "brpc/rdma/rdma_handshake.pb.h" #include "brpc/rdma/rdma_helper.h" +#include "brpc/rdma_handshake.pb.h" +#include "brpc/rdma_transport.h" +#include "brpc/selective_channel.h" +#include "brpc/server.h" +#include "brpc/socket.h" +#include "butil/endpoint.h" +#include "butil/fd_guard.h" +#include "butil/files/temp_file.h" +#include "butil/iobuf.h" +#include "butil/sys_byteorder.h" #include "echo.pb.h" +#include static const int PORT = 8713; @@ -57,19 +58,21 @@ DEFINE_bool(rdma_test_enable, false, "Enable tests requring rdma runtime."); namespace rdma { // HELLO_V2_VERSION / IMPL_V2_VERSION come from -// brpc/rdma/rdma_handshake_constants.h (shared wire constants). +// brpc/handshake/rdma_handshake_constants.h (shared wire constants). DECLARE_bool(rdma_trace_verbose); DECLARE_int32(rdma_memory_pool_max_regions); DECLARE_int32(rdma_client_handshake_version); DECLARE_bool(rdma_ece); -extern ibv_cq* (*IbvCreateCq)(ibv_context*, int, void*, ibv_comp_channel*, int); -extern int (*IbvDestroyCq)(ibv_cq*); -extern ibv_qp* (*IbvCreateQp)(ibv_pd*, ibv_qp_init_attr*); -extern int (*IbvModifyQp)(ibv_qp*, ibv_qp_attr*, ibv_qp_attr_mask); -extern int (*IbvQueryQp)(ibv_qp*, ibv_qp_attr*, ibv_qp_attr_mask, ibv_qp_init_attr*); -extern int (*IbvDestroyQp)(ibv_qp*); +extern ibv_cq *(*IbvCreateCq)(ibv_context *, int, void *, ibv_comp_channel *, + int); +extern int (*IbvDestroyCq)(ibv_cq *); +extern ibv_qp *(*IbvCreateQp)(ibv_pd *, ibv_qp_init_attr *); +extern int (*IbvModifyQp)(ibv_qp *, ibv_qp_attr *, ibv_qp_attr_mask); +extern int (*IbvQueryQp)(ibv_qp *, ibv_qp_attr *, ibv_qp_attr_mask, + ibv_qp_init_attr *); +extern int (*IbvDestroyQp)(ibv_qp *); extern butil::atomic g_rdma_available; extern bool g_skip_rdma_init; extern bool g_fail_resource_alloc_for_test; @@ -80,88 +83,85 @@ static std::string g_ip = "127.0.0.1"; static butil::EndPoint g_ep; class MyEchoService : public ::test::EchoService { - void Echo(google::protobuf::RpcController* cntl_base, - const ::test::EchoRequest* req, - ::test::EchoResponse* res, - google::protobuf::Closure* done) { - Controller* cntl = static_cast(cntl_base); - ClosureGuard done_guard(done); - if (req->server_fail()) { - cntl->SetFailed(req->server_fail(), "Server fail1"); - cntl->SetFailed(req->server_fail(), "Server fail2"); - return; - } - if (req->close_fd()) { - usleep(1); - LOG(INFO) << "close fd..."; - cntl->CloseConnection("Close connection according to request"); - return; - } - if (req->sleep_us() > 0) { - LOG(INFO) << "sleep " << req->sleep_us() << "us..."; - bthread_usleep(req->sleep_us()); - } - res->set_message("MyEchoService"); - if (req->code() != 0) { - res->add_code_list(req->code()); - } - cntl->response_attachment().append(cntl->request_attachment()); + void Echo(google::protobuf::RpcController *cntl_base, + const ::test::EchoRequest *req, ::test::EchoResponse *res, + google::protobuf::Closure *done) { + Controller *cntl = static_cast(cntl_base); + ClosureGuard done_guard(done); + if (req->server_fail()) { + cntl->SetFailed(req->server_fail(), "Server fail1"); + cntl->SetFailed(req->server_fail(), "Server fail2"); + return; + } + if (req->close_fd()) { + usleep(1); + LOG(INFO) << "close fd..."; + cntl->CloseConnection("Close connection according to request"); + return; + } + if (req->sleep_us() > 0) { + LOG(INFO) << "sleep " << req->sleep_us() << "us..."; + bthread_usleep(req->sleep_us()); } + res->set_message("MyEchoService"); + if (req->code() != 0) { + res->add_code_list(req->code()); + } + cntl->response_attachment().append(cntl->request_attachment()); + } }; class RdmaTest : public ::testing::Test { protected: - RdmaTest() { - butil::ip_t ip; - EXPECT_EQ(0, butil::str2ip(g_ip.c_str(), &ip)); - butil::EndPoint ep(ip, PORT); - g_ep = ep; - EXPECT_EQ(0, _server_list.save(butil::endpoint2str(g_ep).c_str())); - _naming_url = std::string("File://") + _server_list.fname(); - _server.AddService(&_svc, SERVER_DOESNT_OWN_SERVICE); - } - ~RdmaTest() { } + RdmaTest() { + butil::ip_t ip; + EXPECT_EQ(0, butil::str2ip(g_ip.c_str(), &ip)); + butil::EndPoint ep(ip, PORT); + g_ep = ep; + EXPECT_EQ(0, _server_list.save(butil::endpoint2str(g_ep).c_str())); + _naming_url = std::string("File://") + _server_list.fname(); + _server.AddService(&_svc, SERVER_DOESNT_OWN_SERVICE); + } + ~RdmaTest() {} - virtual void SetUp() { } + virtual void SetUp() {} - virtual void TearDown() { - rdma::DumpMemoryPoolInfo(std::cout); - } + virtual void TearDown() { rdma::DumpMemoryPoolInfo(std::cout); } protected: - void StartServer(bool use_rdma = true) { - ServerOptions options; - options.enabled_protocols = "baidu_std"; - options.socket_mode = use_rdma ? SOCKET_MODE_RDMA : SOCKET_MODE_TCP; - options.idle_timeout_sec = 5; - options.max_concurrency = 0; - options.internal_port = -1; - EXPECT_EQ(0, _server.Start(PORT, &options)); - } - - void StopServer() { - _server.Stop(0); - _server.Join(); + void StartServer(bool use_rdma = true) { + ServerOptions options; + options.enabled_protocols = "baidu_std"; + options.socket_mode = use_rdma ? SOCKET_MODE_RDMA : SOCKET_MODE_TCP; + options.idle_timeout_sec = 5; + options.max_concurrency = 0; + options.internal_port = -1; + EXPECT_EQ(0, _server.Start(PORT, &options)); + } + + void StopServer() { + _server.Stop(0); + _server.Join(); + } + + Socket *GetSocketFromServer(size_t index) { + std::vector sids; + _server._am->ListConnections(&sids); + if (index >= sids.size()) { + return nullptr; } - - Socket* GetSocketFromServer(size_t index) { - std::vector sids; - _server._am->ListConnections(&sids); - if (index >= sids.size()) { - return nullptr; - } - SocketUniquePtr s; - if (Socket::Address(sids[index], &s) == 0) { - return s.get(); - } - return nullptr; + SocketUniquePtr s; + if (Socket::Address(sids[index], &s) == 0) { + return s.get(); } + return nullptr; + } - butil::TempFile _server_list; - std::string _naming_url; + butil::TempFile _server_list; + std::string _naming_url; - Server _server; - MyEchoService _svc; + Server _server; + MyEchoService _svc; }; // Parameterized fixture used by upper-layer RPC tests that have no @@ -170,1298 +170,1358 @@ class RdmaTest : public ::testing::Test { // so every TEST_P below is automatically executed once per supported // version. Add a new version to INSTANTIATE_TEST_SUITE_P at the bottom // of this file and these RPC tests will gain coverage for free. -class RdmaRpcTest : public RdmaTest, - public ::testing::WithParamInterface { +class RdmaRpcTest : public RdmaTest, public ::testing::WithParamInterface { protected: - void SetUp() override { - RdmaTest::SetUp(); - _saved_handshake_version = rdma::FLAGS_rdma_client_handshake_version; - rdma::FLAGS_rdma_client_handshake_version = GetParam(); - } - void TearDown() override { - rdma::FLAGS_rdma_client_handshake_version = _saved_handshake_version; - RdmaTest::TearDown(); - } + void SetUp() override { + RdmaTest::SetUp(); + _saved_handshake_version = rdma::FLAGS_rdma_client_handshake_version; + rdma::FLAGS_rdma_client_handshake_version = GetParam(); + } + void TearDown() override { + rdma::FLAGS_rdma_client_handshake_version = _saved_handshake_version; + RdmaTest::TearDown(); + } private: - int _saved_handshake_version = 2; + int _saved_handshake_version = 2; }; TEST_F(RdmaTest, client_close_before_hello_send) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - Socket* s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + Socket *s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + close(sockfd); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_hello_msg_invalid_magic_str) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - Socket* s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - memcpy(data, "PRPC", 4); // send as normal baidu_std protocol - ASSERT_EQ(4, write(sockfd, data, 4)); - usleep(100000); // wait for server to handle the msg - // A non-RDMA magic makes ParseRdmaHandshake return TRY_OTHERS and hand the - // bytes to other protocols; it does not touch the endpoint state, so it - // stays UNINIT (the old blocking handshake used to set FALLBACK_TCP here). - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + Socket *s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + memcpy(data, "PRPC", 4); // send as normal baidu_std protocol + ASSERT_EQ(4, write(sockfd, data, 4)); + usleep(100000); // wait for server to handle the msg + // A non-RDMA magic makes the transport-handshake parser return TRY_OTHERS + // and hand the bytes to other protocols; it does not touch the endpoint + // state, so it stays UNINIT (the old blocking handshake used to set + // FALLBACK_TCP here). + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + StopServer(); } TEST_F(RdmaTest, client_close_during_hello_send) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - uint8_t data[8]; - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RD", 2); - ASSERT_EQ(2, write(sockfd1, data, 2)); // break in magic str - usleep(100000); // wait for server to handle the msg - // Fewer than 4 magic bytes: ParseRdmaHandshake can't tell yet, returns - // NOT_ENOUGH_DATA and leaves the endpoint UNINIT (the old blocking - // handshake used to set S_HELLO_WAIT before reading the magic). - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RDMA", 4); - ASSERT_EQ(4, write(sockfd2, data, 4)); // break after magic str - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd2); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd3(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd3 >= 0); - ASSERT_EQ(0, connect(sockfd3, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - // Send the 4B magic plus a valid msg_len (=40) but no body, so the server - // recognizes an RDMA v2 hello and waits for the remaining bytes. (A zero - // msg_len would now be rejected up-front as a protocol error.) - memcpy(data, "RDMA", 4); - uint16_t v2_len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); - memcpy(data + 4, &v2_len, sizeof(v2_len)); - ASSERT_EQ(6, write(sockfd3, data, 6)); // magic + msg_len, body missing - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd3); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + uint8_t data[8]; + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RD", 2); + ASSERT_EQ(2, write(sockfd1, data, 2)); // break in magic str + usleep(100000); // wait for server to handle the msg + // Fewer than 4 magic bytes: the transport-handshake parser can't tell yet, + // returns NOT_ENOUGH_DATA and leaves the endpoint UNINIT (the old blocking + // the common handshake state remains uninitialized before reading magic). + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + close(sockfd1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RDMA", 4); + ASSERT_EQ(4, write(sockfd2, data, 4)); // break after magic str + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + close(sockfd2); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd3(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd3 >= 0); + ASSERT_EQ(0, connect(sockfd3, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + // Send the 4B magic plus a valid msg_len (=40) but no body, so the server + // recognizes an RDMA v2 hello and waits for the remaining bytes. (A zero + // msg_len would now be rejected up-front as a protocol error.) + memcpy(data, "RDMA", 4); + uint16_t v2_len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); + memcpy(data + 4, &v2_len, sizeof(v2_len)); + ASSERT_EQ(6, write(sockfd3, data, 6)); // magic + msg_len, body missing + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + close(sockfd3); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_hello_msg_invalid_len) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RDMA", 4); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memset(data + 4, 0, 36); - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); // Write invalid length. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RDMA", 4); - ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - uint16_t len = butil::HostToNet16(35); - memcpy(data + 4, &len, sizeof(len)); - memset(data + 6, 0, 34); - ASSERT_EQ(36, write(sockfd2, data + 4, 36)); // write invalid length - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RDMA", 4); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + memset(data + 4, 0, 36); + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); // Write invalid length. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RDMA", 4); + ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + uint16_t len = butil::HostToNet16(35); + memcpy(data + 4, &len, sizeof(len)); + memset(data + 6, 0, 34); + ASSERT_EQ(36, write(sockfd2, data + 4, 36)); // write invalid length + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_hello_msg_invalid_version) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - uint16_t len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); - uint16_t ver = butil::HostToNet16(1); - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RDMA", 4); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data + 4, &len, 2); - memset(data + 6, 0, 34); - memcpy(data + 6, &ver, 2); // hello_ver == 1, impl_ver == 0 - // Write the 36B base starting at data + 4 (NOT data). Pre-Step-1 this - // UT mistakenly wrote `data, 36` which included the leftover "RDMA" - // magic at data[0..4); the server parsed it as msg_len = 0x5244 and - // happened to fall through to NegotiationValid (which then failed on - // hello_ver). Now that Step 1 enforces a HELLO_V2_MSG_LEN_MAX upper bound, - // such an oversized msg_len would be rejected before reaching the - // version check, breaking the intent of this UT. - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - uint32_t flags = 0; - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - sockfd1.reset(-1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data, "RDMA", 4); - ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - memcpy(data + 4, &len, 2); - memset(data + 6, 0, 32); - memcpy(data + 8, &ver, 2); // hello_ver == 0, impl_ver == 1 - // See comment above on `write(sockfd1, data + 4, 36)` for why we - // write from data + 4 instead of data. - ASSERT_EQ(36, write(sockfd2, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - sockfd2.reset(-1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + uint16_t len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); + uint16_t ver = butil::HostToNet16(1); + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RDMA", 4); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + memcpy(data + 4, &len, 2); + memset(data + 6, 0, 34); + memcpy(data + 6, &ver, 2); // hello_ver == 1, impl_ver == 0 + // Write the 36B base starting at data + 4 (NOT data). Pre-Step-1 this + // UT mistakenly wrote `data, 36` which included the leftover "RDMA" + // magic at data[0..4); the server parsed it as msg_len = 0x5244 and + // happened to fall through to NegotiationValid (which then failed on + // hello_ver). Now that Step 1 enforces a HELLO_V2_MSG_LEN_MAX upper bound, + // such an oversized msg_len would be rejected before reaching the + // version check, breaking the intent of this UT. + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + uint32_t flags = 0; + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + sockfd1.reset(-1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + memcpy(data, "RDMA", 4); + ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + memcpy(data + 4, &len, 2); + memset(data + 6, 0, 32); + memcpy(data + 8, &ver, 2); // hello_ver == 0, impl_ver == 1 + // See comment above on `write(sockfd1, data + 4, 36)` for why we + // write from data + 4 instead of data. + ASSERT_EQ(36, write(sockfd2, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + sockfd2.reset(-1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_hello_msg_invalid_sq_rq_block_size) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - uint32_t flags = butil::HostToNet32(0); - rdma::v2_wire::HelloMessage msg{}; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - - msg.sq_size = 10; - msg.rq_size = 16; - msg.block_size = 8192; - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - sockfd1.reset(-1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - msg.sq_size = 16; - msg.rq_size = 10; - msg.block_size = 8192; - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd2, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - sockfd2.reset(-1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 1000; - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - butil::fd_guard sockfd3(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd3 >= 0); - ASSERT_EQ(0, connect(sockfd3, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd3, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd3, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - ASSERT_EQ(sizeof(flags), write(sockfd3, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - sockfd3.reset(-1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + uint32_t flags = butil::HostToNet32(0); + rdma::v2_wire::HelloMessage msg{}; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + + msg.sq_size = 10; + msg.rq_size = 16; + msg.block_size = 8192; + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + sockfd1.reset(-1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + msg.sq_size = 16; + msg.rq_size = 10; + msg.block_size = 8192; + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd2, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + sockfd2.reset(-1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 1000; + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + butil::fd_guard sockfd3(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd3 >= 0); + ASSERT_EQ(0, connect(sockfd3, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd3, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd3, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + ASSERT_EQ(sizeof(flags), write(sockfd3, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + sockfd3.reset(-1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_close_after_qp_build) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - rdma::v2_wire::HelloMessage msg{}; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(40, write(sockfd1, data, 40)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + rdma::v2_wire::HelloMessage msg{}; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(40, write(sockfd1, data, 40)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + close(sockfd1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_close_during_ack_send) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - rdma::v2_wire::HelloMessage msg{}; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - uint32_t flags = butil::HostToNet32(1); - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + rdma::v2_wire::HelloMessage msg{}; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + uint32_t flags = butil::HostToNet32(1); + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + close(sockfd1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_close_after_ack_send) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - rdma::v2_wire::HelloMessage msg{}; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - close(sockfd1); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd2, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - flags = butil::HostToNet32(1); - ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - close(sockfd2); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + rdma::v2_wire::HelloMessage msg{}; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + close(sockfd1); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd2, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + flags = butil::HostToNet32(1); + ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + close(sockfd2); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, client_send_data_on_tcp_after_ack_send) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - Socket* s = nullptr; - rdma::v2_wire::HelloMessage msg{}; - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - - butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd1 >= 0); - ASSERT_EQ(0, connect(sockfd1, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd1, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd2 >= 0); - ASSERT_EQ(0, connect(sockfd2, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(36, write(sockfd2, data + 4, 36)); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - flags = butil::HostToNet32(1); - ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); - usleep(100000); // wait for server to handle the msg - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + Socket *s = nullptr; + rdma::v2_wire::HelloMessage msg{}; + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + + butil::fd_guard sockfd1(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd1 >= 0); + ASSERT_EQ(0, connect(sockfd1, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd1, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd1, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(sizeof(flags), write(sockfd1, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + butil::fd_guard sockfd2(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd2 >= 0); + ASSERT_EQ(0, connect(sockfd2, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, write(sockfd2, data, 4)); // Write magic string. + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(36, write(sockfd2, data + 4, 36)); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + flags = butil::HostToNet32(1); + ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); + usleep(100000); // wait for server to handle the msg + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(sizeof(flags), write(sockfd2, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, server_miss_before_hello_send) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_close_before_hello_send) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - close(acc_fd); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FAILED, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EEOF, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + close(acc_fd); + usleep(100000); + ASSERT_EQ(handshake::FAILED, AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EEOF, cntl.ErrorCode()); } TEST_F(RdmaTest, server_miss_during_magic_str) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - ASSERT_EQ(2, write(acc_fd, "RD", 2)); - usleep(100000); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + ASSERT_EQ(2, write(acc_fd, "RD", 2)); + usleep(100000); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_close_during_magic_str) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - ASSERT_EQ(2, write(acc_fd, "RD", 2)); - usleep(100000); - close(acc_fd); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FAILED, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EEOF, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + ASSERT_EQ(2, write(acc_fd, "RD", 2)); + usleep(100000); + close(acc_fd); + usleep(100000); + ASSERT_EQ(handshake::FAILED, AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EEOF, cntl.ErrorCode()); } TEST_F(RdmaTest, server_hello_invalid_magic_str) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - ASSERT_EQ(4, write(acc_fd, "ABCD", 4)); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FAILED, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EPROTO, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + ASSERT_EQ(4, write(acc_fd, "ABCD", 4)); + usleep(100000); + ASSERT_EQ(handshake::FAILED, AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EPROTO, cntl.ErrorCode()); } TEST_F(RdmaTest, server_miss_during_hello_msg) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - ASSERT_EQ(4, write(acc_fd, "RDMA", 4)); - ASSERT_EQ(2, write(acc_fd, "00", 2)); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + ASSERT_EQ(4, write(acc_fd, "RDMA", 4)); + ASSERT_EQ(2, write(acc_fd, "00", 2)); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_close_during_hello_msg) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - ASSERT_EQ(4, write(acc_fd, "RDMA", 4)); - ASSERT_EQ(2, write(acc_fd, "00", 2)); - close(acc_fd); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FAILED, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EEOF, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + ASSERT_EQ(4, write(acc_fd, "RDMA", 4)); + ASSERT_EQ(2, write(acc_fd, "00", 2)); + close(acc_fd); + usleep(100000); + ASSERT_EQ(handshake::FAILED, AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EEOF, cntl.ErrorCode()); } TEST_F(RdmaTest, server_hello_invalid_msg_len) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - memcpy(data, "RDMA", 4); - uint16_t len = butil::HostToNet16(35); - memcpy(data + 4, &len, 2); - memset(data + 6, 0, 32); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FAILED, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EPROTO, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + memcpy(data, "RDMA", 4); + uint16_t len = butil::HostToNet16(35); + memcpy(data + 4, &len, 2); + memset(data + 6, 0, 32); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + usleep(100000); + ASSERT_EQ(handshake::FAILED, AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EPROTO, cntl.ErrorCode()); } TEST_F(RdmaTest, server_hello_invalid_version) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - memcpy(data, "RDMA", 4); - uint16_t len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); - memcpy(data + 4, &len, 2); - memset(data + 6, 0, 32); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, read(acc_fd, data, 4)); - uint32_t* tmp = (uint32_t*)data; - ASSERT_EQ(0, butil::NetToHost32(*tmp)); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + memcpy(data, "RDMA", 4); + uint16_t len = butil::HostToNet16(rdma::HELLO_V2_MSG_LEN_MIN); + memcpy(data + 4, &len, 2); + memset(data + 6, 0, 32); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, read(acc_fd, data, 4)); + uint32_t *tmp = (uint32_t *)data; + ASSERT_EQ(0, butil::NetToHost32(*tmp)); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_hello_invalid_sq_rq_size) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = 1; - msg.impl_ver = 1; - msg.sq_size = 0; - msg.rq_size = 0; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, read(acc_fd, data, 4)); - uint32_t* tmp = (uint32_t*)data; - ASSERT_EQ(0, butil::NetToHost32(*tmp)); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = 1; + msg.impl_ver = 1; + msg.sq_size = 0; + msg.rq_size = 0; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, read(acc_fd, data, 4)); + uint32_t *tmp = (uint32_t *)data; + ASSERT_EQ(0, butil::NetToHost32(*tmp)); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_miss_after_ack) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, read(acc_fd, data, 4)); - uint32_t* tmp = (uint32_t*)data; - ASSERT_EQ(1, butil::NetToHost32(*tmp)); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + usleep(100000); + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, read(acc_fd, data, 4)); + uint32_t *tmp = (uint32_t *)data; + ASSERT_EQ(1, butil::NetToHost32(*tmp)); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(ERPCTIMEDOUT, cntl.ErrorCode()); } TEST_F(RdmaTest, server_close_after_ack) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(4, read(acc_fd, data, 4)); - uint32_t* tmp = (uint32_t*)data; - ASSERT_EQ(1, butil::NetToHost32(*tmp)); - close(acc_fd); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EEOF, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + usleep(100000); + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(4, read(acc_fd, data, 4)); + uint32_t *tmp = (uint32_t *)data; + ASSERT_EQ(1, butil::NetToHost32(*tmp)); + close(acc_fd); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EEOF, cntl.ErrorCode()); } TEST_F(RdmaTest, server_send_data_on_tcp_after_ack) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::C_HELLO_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - bthread_id_join(cntl.call_id()); - - ASSERT_EQ(EPROTO, cntl.ErrorCode()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::HELLO_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + usleep(100000); + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + bthread_id_join(cntl.call_id()); + + ASSERT_EQ(EPROTO, cntl.ErrorCode()); } - TEST_F(RdmaTest, v2_client_hello_bytes_baseline) { - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - - // [0..4) magic - ASSERT_EQ(0, memcmp(data, "RDMA", 4)); - // [4..6) msg_len, big-endian uint16 == 40 - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, - (size_t)(((uint16_t)data[4] << 8) | (uint16_t)data[5])); - // [6..8) hello_ver, big-endian uint16 == rdma::HELLO_V2_VERSION - ASSERT_EQ(rdma::HELLO_V2_VERSION, - (uint16_t)(((uint16_t)data[6] << 8) | (uint16_t)data[7])); - // [8..10) impl_ver, big-endian uint16 == rdma::IMPL_V2_VERSION - ASSERT_EQ(rdma::IMPL_V2_VERSION, - (uint16_t)(((uint16_t)data[8] << 8) | (uint16_t)data[9])); - - rdma::v2_wire::HelloMessage msg{}; - msg.Deserialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, msg.msg_len); - ASSERT_EQ(rdma::HELLO_V2_VERSION, msg.hello_ver); - ASSERT_EQ(rdma::IMPL_V2_VERSION, msg.impl_ver); - - bthread_id_join(cntl.call_id()); + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(acc_fd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + + // [0..4) magic + ASSERT_EQ(0, memcmp(data, "RDMA", 4)); + // [4..6) msg_len, big-endian uint16 == 40 + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + (size_t)(((uint16_t)data[4] << 8) | (uint16_t)data[5])); + // [6..8) hello_ver, big-endian uint16 == rdma::HELLO_V2_VERSION + ASSERT_EQ(rdma::HELLO_V2_VERSION, + (uint16_t)(((uint16_t)data[6] << 8) | (uint16_t)data[7])); + // [8..10) impl_ver, big-endian uint16 == rdma::IMPL_V2_VERSION + ASSERT_EQ(rdma::IMPL_V2_VERSION, + (uint16_t)(((uint16_t)data[8] << 8) | (uint16_t)data[9])); + + rdma::v2_wire::HelloMessage msg{}; + msg.Deserialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, msg.msg_len); + ASSERT_EQ(rdma::HELLO_V2_VERSION, msg.hello_ver); + ASSERT_EQ(rdma::IMPL_V2_VERSION, msg.impl_ver); + + bthread_id_join(cntl.call_id()); } TEST_F(RdmaTest, v2_server_hello_bytes_baseline) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Send a well-formed v2 hello so the server enters S_ACK_WAIT. - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(sockfd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Read server's reply hello and assert its byte-level layout. - uint8_t reply[rdma::HELLO_V2_MSG_LEN_MIN]; - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, read(sockfd, reply, rdma::HELLO_V2_MSG_LEN_MIN)); - - ASSERT_EQ(0, memcmp(reply, "RDMA", 4)); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, - (size_t)(((uint16_t)reply[4] << 8) | (uint16_t)reply[5])); - ASSERT_EQ(rdma::HELLO_V2_VERSION, - (uint16_t)(((uint16_t)reply[6] << 8) | (uint16_t)reply[7])); - ASSERT_EQ(rdma::IMPL_V2_VERSION, - (uint16_t)(((uint16_t)reply[8] << 8) | (uint16_t)reply[9])); - - rdma::v2_wire::HelloMessage reply_msg{}; - reply_msg.Deserialize(reply + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, reply_msg.msg_len); - ASSERT_EQ(rdma::HELLO_V2_VERSION, reply_msg.hello_ver); - ASSERT_EQ(rdma::IMPL_V2_VERSION, reply_msg.impl_ver); - - // Drive the server into FALLBACK_TCP via ACK flags=0 so the test ends - // cleanly without requiring real RDMA hardware. - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ(sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + // Send a well-formed v2 hello so the server enters the common ACK_WAIT. + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(sockfd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + usleep(100000); + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + // Read server's reply hello and assert its byte-level layout. + uint8_t reply[rdma::HELLO_V2_MSG_LEN_MIN]; + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + read(sockfd, reply, rdma::HELLO_V2_MSG_LEN_MIN)); + + ASSERT_EQ(0, memcmp(reply, "RDMA", 4)); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + (size_t)(((uint16_t)reply[4] << 8) | (uint16_t)reply[5])); + ASSERT_EQ(rdma::HELLO_V2_VERSION, + (uint16_t)(((uint16_t)reply[6] << 8) | (uint16_t)reply[7])); + ASSERT_EQ(rdma::IMPL_V2_VERSION, + (uint16_t)(((uint16_t)reply[8] << 8) | (uint16_t)reply[9])); + + rdma::v2_wire::HelloMessage reply_msg{}; + reply_msg.Deserialize(reply + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, reply_msg.msg_len); + ASSERT_EQ(rdma::HELLO_V2_VERSION, reply_msg.hello_ver); + ASSERT_EQ(rdma::IMPL_V2_VERSION, reply_msg.impl_ver); + + // Drive the server into FALLBACK_TCP via ACK flags=0 so the test ends + // cleanly without requiring real RDMA hardware. + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ(sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } -TEST_F(RdmaTest, v2_server_drains_tail_then_reads_ack) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Build a v2 hello with msg_len = 48 (40 base + 8B zero tail). - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = 48; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - - uint8_t buf[48]; - memcpy(buf, "RDMA", 4); - msg.Serialize(buf + 4); - memset(buf + 40, 0x00, 8); // 8B zero tail - ASSERT_EQ(48, write(sockfd, buf, 48)); - usleep(100000); - - // Send the real ACK (flags=1 = ACK_MSG_RDMA_OK). - uint32_t flags = butil::HostToNet32(1); - ASSERT_EQ(sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - - ASSERT_EQ(rdma::RdmaEndpoint::ESTABLISHED, static_cast(s->_transport.get())->_rdma_ep->_state); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); +TEST_F(RdmaTest, v2_server_preserves_coalesced_ack_after_extension) { + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != NULL); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + // Build a v2 hello with msg_len = 48 (40 base + 8B zero tail). + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = 48; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + + uint8_t buf[52]; + memcpy(buf, "RDMA", 4); + msg.Serialize(buf + 4); + memset(buf + 40, 0x00, 8); // 8B zero tail + // Coalesce the real ACK with the hello. The v2 parser must consume only + // msg_len bytes and preserve the ACK for the next handshake step. + uint32_t flags = butil::HostToNet32(1); + memcpy(buf + 48, &flags, sizeof(flags)); + ASSERT_EQ(sizeof(buf), write(sockfd, buf, sizeof(buf))); + usleep(100000); + + ASSERT_EQ(handshake::ESTABLISHED, + AdapterTransport::Get(s)->handshake_phase()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, v2_server_rejects_oversized_msg_len) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Build a v2 hello with msg_len = 4097 (HELLO_V2_MSG_LEN_MAX + 1). - // We only send the 40B base; the server must reject before reading - // (and definitely before attempting to drain) any "tail". - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = 4097; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - - uint8_t buf[rdma::HELLO_V2_MSG_LEN_MIN]; - memcpy(buf, "RDMA", 4); - msg.Serialize(buf + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, write(sockfd, buf, rdma::HELLO_V2_MSG_LEN_MIN)); - usleep(100000); - - - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - sockfd.reset(-1); - usleep(100000); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + // Build a v2 hello with msg_len = 4097 (HELLO_V2_MSG_LEN_MAX + 1). + // We only send the 40B base; the server must reject before reading + // (and definitely before attempting to drain) any "tail". + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = 4097; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + + uint8_t buf[rdma::HELLO_V2_MSG_LEN_MIN]; + memcpy(buf, "RDMA", 4); + msg.Serialize(buf + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(sockfd, buf, rdma::HELLO_V2_MSG_LEN_MIN)); + usleep(100000); + + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + sockfd.reset(-1); + usleep(100000); + + StopServer(); } // RAII for FLAGS_rdma_client_handshake_version: lets us flip the @@ -1469,29 +1529,29 @@ TEST_F(RdmaTest, v2_server_rejects_oversized_msg_len) { // scope exit so subsequent tests stay on the v2 default. class HandshakeVersionFlag { public: - explicit HandshakeVersionFlag(int v) - : _saved(rdma::FLAGS_rdma_client_handshake_version) { - rdma::FLAGS_rdma_client_handshake_version = v; - } - ~HandshakeVersionFlag() { - rdma::FLAGS_rdma_client_handshake_version = _saved; - } + explicit HandshakeVersionFlag(int v) + : _saved(rdma::FLAGS_rdma_client_handshake_version) { + rdma::FLAGS_rdma_client_handshake_version = v; + } + ~HandshakeVersionFlag() { + rdma::FLAGS_rdma_client_handshake_version = _saved; + } + private: - int _saved; + int _saved; }; // Build a v3 wire packet from an RdmaHello: "RDM3" + pb_size_be + body. -std::string MakeV3Packet(const rdma::RdmaHello& msg) { - std::string body; - EXPECT_TRUE(msg.SerializeToString(&body)); - std::string packet; - packet.reserve(4 + 4 + body.size()); - packet.append("RDM3", 4); - uint32_t pb_size_be = - butil::HostToNet32(static_cast(body.size())); - packet.append(reinterpret_cast(&pb_size_be), 4); - packet.append(body); - return packet; +std::string MakeV3Packet(const rdma::RdmaHello &msg) { + std::string body; + EXPECT_TRUE(msg.SerializeToString(&body)); + std::string packet; + packet.reserve(4 + 4 + body.size()); + packet.append("RDM3", 4); + uint32_t pb_size_be = butil::HostToNet32(static_cast(body.size())); + packet.append(reinterpret_cast(&pb_size_be), 4); + packet.append(body); + return packet; } // Build a fully-valid RdmaHello: all 6 required fields are set, with @@ -1501,1318 +1561,1316 @@ std::string MakeV3Packet(const rdma::RdmaHello& msg) { // - gid = exactly 16B (sizeof(ibv_gid)) // - qp_num = 0 (allowed because g_skip_rdma_init in UT) rdma::RdmaHello MakeValidV3Hello() { - rdma::RdmaHello msg; - msg.set_block_size(8192); - msg.set_sq_size(16); - msg.set_rq_size(16); - msg.set_lid(0); - ibv_gid gid = rdma::GetRdmaGid(); - msg.set_gid(std::string(reinterpret_cast(gid.raw), - sizeof(gid.raw))); - msg.set_qp_num(0); - return msg; + rdma::RdmaHello msg; + msg.set_block_size(8192); + msg.set_sq_size(16); + msg.set_rq_size(16); + msg.set_lid(0); + ibv_gid gid = rdma::GetRdmaGid(); + msg.set_gid( + std::string(reinterpret_cast(gid.raw), sizeof(gid.raw))); + msg.set_qp_num(0); + return msg; } - TEST_F(RdmaTest, v3_client_hello_bytes_baseline) { - HandshakeVersionFlag _hsv(3); - - butil::fd_guard sockfd(butil::tcp_listen(g_ep)); - EXPECT_TRUE(sockfd >= 0); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); - ASSERT_TRUE(acc_fd >= 0); - - // [0..4) magic "RDM3" - uint8_t magic[4]; - ASSERT_EQ(4, read(acc_fd, magic, 4)); - ASSERT_EQ(0, memcmp(magic, "RDM3", 4)); - - // [4..8) pb_size, big-endian uint32, must be in (0, 4096] - uint8_t size_buf[4]; - ASSERT_EQ(4, read(acc_fd, size_buf, 4)); - uint32_t pb_size = - butil::NetToHost32(*reinterpret_cast(size_buf)); - ASSERT_GT(pb_size, 0u); - ASSERT_LE(pb_size, 4096u); - - // [8..8+pb_size) RdmaHello protobuf body. - std::string body(pb_size, '\0'); - ASSERT_EQ((ssize_t)pb_size, read(acc_fd, &body[0], pb_size)); - rdma::RdmaHello msg; - ASSERT_TRUE(msg.ParseFromString(body)); - - // All 6 required fields must be present (ParseFromString would - // have already returned false otherwise). - ASSERT_TRUE(msg.has_block_size()); - ASSERT_TRUE(msg.has_sq_size()); - ASSERT_TRUE(msg.has_rq_size()); - ASSERT_TRUE(msg.has_lid()); - ASSERT_TRUE(msg.has_gid()); - ASSERT_TRUE(msg.has_qp_num()); - // gid wire encoding must be exactly 16 bytes (sizeof(ibv_gid)). - ASSERT_EQ(sizeof(ibv_gid), msg.gid().size()); - - // Let the RPC time out and release resources. - bthread_id_join(cntl.call_id()); + HandshakeVersionFlag _hsv(3); + + butil::fd_guard sockfd(butil::tcp_listen(g_ep)); + EXPECT_TRUE(sockfd >= 0); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + butil::fd_guard acc_fd(accept(sockfd, nullptr, nullptr)); + ASSERT_TRUE(acc_fd >= 0); + + // [0..4) magic "RDM3" + uint8_t magic[4]; + ASSERT_EQ(4, read(acc_fd, magic, 4)); + ASSERT_EQ(0, memcmp(magic, "RDM3", 4)); + + // [4..8) pb_size, big-endian uint32, must be in (0, 4096] + uint8_t size_buf[4]; + ASSERT_EQ(4, read(acc_fd, size_buf, 4)); + uint32_t pb_size = + butil::NetToHost32(*reinterpret_cast(size_buf)); + ASSERT_GT(pb_size, 0u); + ASSERT_LE(pb_size, 4096u); + + // [8..8+pb_size) RdmaHello protobuf body. + std::string body(pb_size, '\0'); + ASSERT_EQ((ssize_t)pb_size, read(acc_fd, &body[0], pb_size)); + rdma::RdmaHello msg; + ASSERT_TRUE(msg.ParseFromString(body)); + + // All 6 required fields must be present (ParseFromString would + // have already returned false otherwise). + ASSERT_TRUE(msg.has_block_size()); + ASSERT_TRUE(msg.has_sq_size()); + ASSERT_TRUE(msg.has_rq_size()); + ASSERT_TRUE(msg.has_lid()); + ASSERT_TRUE(msg.has_gid()); + ASSERT_TRUE(msg.has_qp_num()); + // gid wire encoding must be exactly 16 bytes (sizeof(ibv_gid)). + ASSERT_EQ(sizeof(ibv_gid), msg.gid().size()); + + // Let the RPC time out and release resources. + bthread_id_join(cntl.call_id()); } TEST_F(RdmaTest, v3_server_hello_bytes_baseline) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Send a valid v3 hello. - std::string packet = MakeV3Packet(MakeValidV3Hello()); - ASSERT_EQ((ssize_t)packet.size(), - write(sockfd, packet.data(), packet.size())); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - - // Read server's reply hello: 4B magic + 4B pb_size + body. - uint8_t reply_magic[4]; - ASSERT_EQ(4, read(sockfd, reply_magic, 4)); - ASSERT_EQ(0, memcmp(reply_magic, "RDM3", 4)); - - uint8_t size_buf[4]; - ASSERT_EQ(4, read(sockfd, size_buf, 4)); - uint32_t pb_size = - butil::NetToHost32(*reinterpret_cast(size_buf)); - ASSERT_GT(pb_size, 0u); - ASSERT_LE(pb_size, 4096u); - - std::string body(pb_size, '\0'); - ASSERT_EQ((ssize_t)pb_size, read(sockfd, &body[0], pb_size)); - rdma::RdmaHello reply; - ASSERT_TRUE(reply.ParseFromString(body)); - ASSERT_TRUE(reply.has_block_size()); - ASSERT_TRUE(reply.has_sq_size()); - ASSERT_TRUE(reply.has_rq_size()); - ASSERT_TRUE(reply.has_gid()); - ASSERT_EQ(sizeof(ibv_gid), reply.gid().size()); - - // Drive the server into FALLBACK_TCP via ACK flags=0 so the test ends - // cleanly without requiring real RDMA hardware. - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ((ssize_t)sizeof(flags), - write(sockfd, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + // Send a valid v3 hello. + std::string packet = MakeV3Packet(MakeValidV3Hello()); + ASSERT_EQ((ssize_t)packet.size(), + write(sockfd, packet.data(), packet.size())); + usleep(100000); + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + // Read server's reply hello: 4B magic + 4B pb_size + body. + uint8_t reply_magic[4]; + ASSERT_EQ(4, read(sockfd, reply_magic, 4)); + ASSERT_EQ(0, memcmp(reply_magic, "RDM3", 4)); + + uint8_t size_buf[4]; + ASSERT_EQ(4, read(sockfd, size_buf, 4)); + uint32_t pb_size = + butil::NetToHost32(*reinterpret_cast(size_buf)); + ASSERT_GT(pb_size, 0u); + ASSERT_LE(pb_size, 4096u); + + std::string body(pb_size, '\0'); + ASSERT_EQ((ssize_t)pb_size, read(sockfd, &body[0], pb_size)); + rdma::RdmaHello reply; + ASSERT_TRUE(reply.ParseFromString(body)); + ASSERT_TRUE(reply.has_block_size()); + ASSERT_TRUE(reply.has_sq_size()); + ASSERT_TRUE(reply.has_rq_size()); + ASSERT_TRUE(reply.has_gid()); + ASSERT_EQ(sizeof(ibv_gid), reply.gid().size()); + + // Drive the server into FALLBACK_TCP via ACK flags=0 so the test ends + // cleanly without requiring real RDMA hardware. + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, v3_server_rejects_zero_pb_size) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - // "RDM3" + pb_size = 0 (4B big-endian zero). - uint8_t buf[8] = {'R', 'D', 'M', '3', 0, 0, 0, 0}; - ASSERT_EQ(8, write(sockfd, buf, 8)); - usleep(100000); - - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - sockfd.reset(-1); - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + // "RDM3" + pb_size = 0 (4B big-endian zero). + uint8_t buf[8] = {'R', 'D', 'M', '3', 0, 0, 0, 0}; + ASSERT_EQ(8, write(sockfd, buf, 8)); + usleep(100000); + + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + sockfd.reset(-1); + StopServer(); } TEST_F(RdmaTest, v3_server_rejects_oversized_pb_size) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - uint8_t buf[8]; - memcpy(buf, "RDM3", 4); - // pb_size just above the allowed maximum -> rejected. - uint32_t pb_size_be = - butil::HostToNet32(static_cast(rdma::HELLO_V3_MAX_PB_SIZE + 1)); - memcpy(buf + 4, &pb_size_be, 4); - ASSERT_EQ(8, write(sockfd, buf, 8)); - usleep(100000); - - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - sockfd.reset(-1); - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + uint8_t buf[8]; + memcpy(buf, "RDM3", 4); + // pb_size just above the allowed maximum -> rejected. + uint32_t pb_size_be = + butil::HostToNet32(static_cast(rdma::HELLO_V3_MAX_PB_SIZE + 1)); + memcpy(buf + 4, &pb_size_be, 4); + ASSERT_EQ(8, write(sockfd, buf, 8)); + usleep(100000); + + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + sockfd.reset(-1); + StopServer(); } TEST_F(RdmaTest, v3_server_rejects_invalid_pb_bytes) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - // "RDM3" + pb_size = 8 + 8 bytes of 0xff (invalid protobuf body). - uint8_t buf[16]; - memcpy(buf, "RDM3", 4); - uint32_t pb_size_be = butil::HostToNet32(8); - memcpy(buf + 4, &pb_size_be, 4); - memset(buf + 8, 0xff, 8); - ASSERT_EQ(16, write(sockfd, buf, 16)); - usleep(100000); - - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - sockfd.reset(-1); - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + // "RDM3" + pb_size = 8 + 8 bytes of 0xff (invalid protobuf body). + uint8_t buf[16]; + memcpy(buf, "RDM3", 4); + uint32_t pb_size_be = butil::HostToNet32(8); + memcpy(buf + 4, &pb_size_be, 4); + memset(buf + 8, 0xff, 8); + ASSERT_EQ(16, write(sockfd, buf, 16)); + usleep(100000); + + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + sockfd.reset(-1); + StopServer(); } TEST_F(RdmaTest, v3_server_invalid_sq_size_falls_back) { - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - rdma::RdmaHello msg = MakeValidV3Hello(); - msg.set_sq_size(0); // invalid: < MIN_QP_SIZE (16) - std::string packet = MakeV3Packet(msg); - ASSERT_EQ((ssize_t)packet.size(), - write(sockfd, packet.data(), packet.size())); - usleep(100000); - - // Server validated the hello as invalid -> _rdma_state = RDMA_OFF, - // but still proceeds to S_ACK_WAIT (sends its own reply hello). - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, static_cast(s->_transport.get())->_rdma_state); - - // Drain server's reply hello (content not asserted here; covered - // by v3_server_hello_bytes_baseline). - uint8_t reply_hdr[8]; - ASSERT_EQ(8, read(sockfd, reply_hdr, 8)); - ASSERT_EQ(0, memcmp(reply_hdr, "RDM3", 4)); - uint32_t reply_pb_size = butil::NetToHost32( - *reinterpret_cast(reply_hdr + 4)); - std::string reply_body(reply_pb_size, '\0'); - ASSERT_EQ((ssize_t)reply_pb_size, - read(sockfd, &reply_body[0], reply_pb_size)); - - // Client ACK flags=0 -> server settles into FALLBACK_TCP. - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ((ssize_t)sizeof(flags), - write(sockfd, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + rdma::RdmaHello msg = MakeValidV3Hello(); + msg.set_sq_size(0); // invalid: < MIN_QP_SIZE (16) + std::string packet = MakeV3Packet(msg); + ASSERT_EQ((ssize_t)packet.size(), + write(sockfd, packet.data(), packet.size())); + usleep(100000); + + // Server validated the hello as invalid -> _rdma_state = RDMA_OFF, + // but still proceeds to the common ACK_WAIT (sends its own reply hello). + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + + // Drain server's reply hello (content not asserted here; covered + // by v3_server_hello_bytes_baseline). + uint8_t reply_hdr[8]; + ASSERT_EQ(8, read(sockfd, reply_hdr, 8)); + ASSERT_EQ(0, memcmp(reply_hdr, "RDM3", 4)); + uint32_t reply_pb_size = + butil::NetToHost32(*reinterpret_cast(reply_hdr + 4)); + std::string reply_body(reply_pb_size, '\0'); + ASSERT_EQ((ssize_t)reply_pb_size, + read(sockfd, &reply_body[0], reply_pb_size)); + + // Client ACK flags=0 -> server settles into FALLBACK_TCP. + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } // RAII guard to toggle FLAGS_rdma_ece for a single test and restore it. class EceFlagGuard { public: - explicit EceFlagGuard(bool v) : _saved(rdma::FLAGS_rdma_ece) { - rdma::FLAGS_rdma_ece = v; - } - ~EceFlagGuard() { - rdma::FLAGS_rdma_ece = _saved; - } + explicit EceFlagGuard(bool v) : _saved(rdma::FLAGS_rdma_ece) { + rdma::FLAGS_rdma_ece = v; + } + ~EceFlagGuard() { rdma::FLAGS_rdma_ece = _saved; } + private: - bool _saved; + bool _saved; }; // Build a valid v3 hello that also carries an ECE block. -rdma::RdmaHello MakeValidV3HelloWithEce(uint32_t vendor_id, - uint32_t options, +rdma::RdmaHello MakeValidV3HelloWithEce(uint32_t vendor_id, uint32_t options, uint32_t comp_mask) { - rdma::RdmaHello msg = MakeValidV3Hello(); - rdma::RdmaEce* ece = msg.mutable_ece(); - ece->set_vendor_id(vendor_id); - ece->set_options(options); - ece->set_comp_mask(comp_mask); - return msg; + rdma::RdmaHello msg = MakeValidV3Hello(); + rdma::RdmaEce *ece = msg.mutable_ece(); + ece->set_vendor_id(vendor_id); + ece->set_options(options); + ece->set_comp_mask(comp_mask); + return msg; } // Read the server's v3 reply hello (4B magic + 4B pb_size + body) and parse // it into `reply`. Asserts the framing along the way. -static void ReadServerV3Reply(int fd, rdma::RdmaHello* reply) { - uint8_t reply_hdr[8]; - ASSERT_EQ(8, read(fd, reply_hdr, 8)); - ASSERT_EQ(0, memcmp(reply_hdr, "RDM3", 4)); - uint32_t reply_pb_size = butil::NetToHost32(*reinterpret_cast(reply_hdr + 4)); - ASSERT_GT(reply_pb_size, 0u); - ASSERT_LE(reply_pb_size, 4096u); - std::string reply_body(reply_pb_size, '\0'); - ASSERT_EQ((ssize_t)reply_pb_size, - read(fd, &reply_body[0], reply_pb_size)); - ASSERT_TRUE(reply->ParseFromString(reply_body)); +static void ReadServerV3Reply(int fd, rdma::RdmaHello *reply) { + uint8_t reply_hdr[8]; + ASSERT_EQ(8, read(fd, reply_hdr, 8)); + ASSERT_EQ(0, memcmp(reply_hdr, "RDM3", 4)); + uint32_t reply_pb_size = + butil::NetToHost32(*reinterpret_cast(reply_hdr + 4)); + ASSERT_GT(reply_pb_size, 0u); + ASSERT_LE(reply_pb_size, 4096u); + std::string reply_body(reply_pb_size, '\0'); + ASSERT_EQ((ssize_t)reply_pb_size, read(fd, &reply_body[0], reply_pb_size)); + ASSERT_TRUE(reply->ParseFromString(reply_body)); } // A client hello carrying ECE must not break the server handshake: with ECE -// enabled the server still parses the hello and advances to S_ACK_WAIT. +// enabled the server still parses the hello and advances to the common +// ACK_WAIT. TEST_F(RdmaTest, v3_server_accepts_client_hello_with_ece) { - EceFlagGuard ece_flag_guard(true); - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); - std::string packet = MakeV3Packet(msg); - ASSERT_EQ((ssize_t)packet.size(), - write(sockfd, packet.data(), packet.size())); - usleep(100000); - - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, - static_cast(s->_transport.get())->_rdma_ep->_state); - - rdma::RdmaHello reply; - ReadServerV3Reply(sockfd, &reply); - - // ACK flags=0 -> clean FALLBACK_TCP so the test ends without hardware. - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, - static_cast(s->_transport.get())->_rdma_ep->_state); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - StopServer(); + EceFlagGuard ece_flag_guard(true); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); + std::string packet = MakeV3Packet(msg); + ASSERT_EQ((ssize_t)packet.size(), + write(sockfd, packet.data(), packet.size())); + usleep(100000); + + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + + rdma::RdmaHello reply; + ReadServerV3Reply(sockfd, &reply); + + // ACK flags=0 -> clean FALLBACK_TCP so the test ends without hardware. + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + StopServer(); } // When ECE negotiation is disabled, the server reply must NOT advertise ECE, // even if the client advertised it (FillLocalRdmaHello degrade branch #1). TEST_F(RdmaTest, v3_server_reply_has_no_ece_when_disabled) { - EceFlagGuard ece_flag_guard(false); - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); - std::string packet = MakeV3Packet(msg); - ASSERT_EQ((ssize_t)packet.size(), - write(sockfd, packet.data(), packet.size())); - usleep(100000); - - rdma::RdmaHello reply; - ReadServerV3Reply(sockfd, &reply); - EXPECT_FALSE(reply.has_ece()); - - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - - sockfd.reset(-1); - usleep(100000); - StopServer(); + EceFlagGuard ece_flag_guard(false); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); + std::string packet = MakeV3Packet(msg); + ASSERT_EQ((ssize_t)packet.size(), + write(sockfd, packet.data(), packet.size())); + usleep(100000); + + rdma::RdmaHello reply; + ReadServerV3Reply(sockfd, &reply); + EXPECT_FALSE(reply.has_ece()); + + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + + sockfd.reset(-1); + usleep(100000); + StopServer(); } // When ECE is enabled but there is no negotiated result (UT skips the real QP // bring-up, so the server never fills _outgoing_ece), the server reply must -// still NOT advertise ECE (FillLocalRdmaHello degrade branch #2 -> degrade-safe). +// still NOT advertise ECE (FillLocalRdmaHello degrade branch #2 -> +// degrade-safe). TEST_F(RdmaTest, v3_server_reply_has_no_ece_without_hw_negotiation) { - EceFlagGuard ece_flag_guard(true); - StartServer(); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - - rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); - std::string packet = MakeV3Packet(msg); - ASSERT_EQ((ssize_t)packet.size(), - write(sockfd, packet.data(), packet.size())); - usleep(100000); - - rdma::RdmaHello reply; - ReadServerV3Reply(sockfd, &reply); - EXPECT_FALSE(reply.has_ece()); - - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - - sockfd.reset(-1); - usleep(100000); - StopServer(); + EceFlagGuard ece_flag_guard(true); + StartServer(); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + + rdma::RdmaHello msg = MakeValidV3HelloWithEce(0x02c9, 0x1, 0x0); + std::string packet = MakeV3Packet(msg); + ASSERT_EQ((ssize_t)packet.size(), + write(sockfd, packet.data(), packet.size())); + usleep(100000); + + rdma::RdmaHello reply; + ReadServerV3Reply(sockfd, &reply); + EXPECT_FALSE(reply.has_ece()); + + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ((ssize_t)sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + + sockfd.reset(-1); + usleep(100000); + StopServer(); } class ResourceAllocFailGuard { public: - explicit ResourceAllocFailGuard(bool v) - : _saved(rdma::g_fail_resource_alloc_for_test) { - rdma::g_fail_resource_alloc_for_test = v; - } - ~ResourceAllocFailGuard() { - rdma::g_fail_resource_alloc_for_test = _saved; - } + explicit ResourceAllocFailGuard(bool v) + : _saved(rdma::g_fail_resource_alloc_for_test) { + rdma::g_fail_resource_alloc_for_test = v; + } + ~ResourceAllocFailGuard() { rdma::g_fail_resource_alloc_for_test = _saved; } + private: - bool _saved; + bool _saved; }; TEST_F(RdmaTest, client_alloc_resource_fail_fallback_tcp) { - StartServer(); - ResourceAllocFailGuard alloc_fail_guard(true); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - req.set_sleep_us(200000); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - usleep(100000); - - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, - static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, - static_cast(s->_transport.get())->_rdma_state); - // The socket must not be failed, otherwise it can no longer carry TCP. - ASSERT_FALSE(s->Failed()); - - // The RPC still completes over TCP. - bthread_id_join(cntl.call_id()); - ASSERT_EQ(0, cntl.ErrorCode()) << cntl.ErrorText(); - - StopServer(); + StartServer(); + ResourceAllocFailGuard alloc_fail_guard(true); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + req.set_sleep_us(200000); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + usleep(100000); + + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + // The socket must not be failed, otherwise it can no longer carry TCP. + ASSERT_FALSE(s->Failed()); + + // The RPC still completes over TCP. + bthread_id_join(cntl.call_id()); + ASSERT_EQ(0, cntl.ErrorCode()) << cntl.ErrorText(); + + StopServer(); } TEST_F(RdmaTest, server_alloc_resource_fail_fallback_tcp) { - StartServer(); - ResourceAllocFailGuard alloc_fail_guard(true); - - sockaddr_in addr; - bzero((char*)&addr, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(PORT); - butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); - ASSERT_TRUE(sockfd >= 0); - ASSERT_EQ(0, connect(sockfd, (sockaddr*)&addr, sizeof(sockaddr))); - usleep(100000); // wait for server to handle the msg - Socket* s = GetSocketFromServer(0); - ASSERT_TRUE(s != nullptr); - ASSERT_EQ(rdma::RdmaEndpoint::UNINIT, - static_cast(s->_transport.get())->_rdma_ep->_state); - - // Send a well-formed v2 hello: the negotiation succeeds - // but the resource allocation does not. - rdma::v2_wire::HelloMessage msg{}; - msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; - msg.hello_ver = rdma::HELLO_V2_VERSION; - msg.impl_ver = rdma::IMPL_V2_VERSION; - msg.sq_size = 16; - msg.rq_size = 16; - msg.block_size = 8192; - msg.qp_num = 0; - msg.gid = rdma::GetRdmaGid(); - - uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; - memcpy(data, "RDMA", 4); - msg.Serialize(data + 4); - ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, - write(sockfd, data, rdma::HELLO_V2_MSG_LEN_MIN)); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::S_ACK_WAIT, - static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_EQ(RdmaTransport::RDMA_OFF, - static_cast(s->_transport.get())->_rdma_state); - ASSERT_FALSE(s->Failed()); - - // Ack without RDMA so that the server finishes the handshake in TCP mode. - uint32_t flags = butil::HostToNet32(0); - ASSERT_EQ(sizeof(flags), write(sockfd, &flags, sizeof(flags))); - usleep(100000); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, - static_cast(s->_transport.get())->_rdma_ep->_state); - ASSERT_FALSE(s->Failed()); - - sockfd.reset(-1); - usleep(100000); - ASSERT_EQ(nullptr, GetSocketFromServer(0)); - - StopServer(); + StartServer(); + ResourceAllocFailGuard alloc_fail_guard(true); + + sockaddr_in addr; + bzero((char *)&addr, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(PORT); + butil::fd_guard sockfd(socket(AF_INET, SOCK_STREAM, 0)); + ASSERT_TRUE(sockfd >= 0); + ASSERT_EQ(0, connect(sockfd, (sockaddr *)&addr, sizeof(sockaddr))); + usleep(100000); // wait for server to handle the msg + Socket *s = GetSocketFromServer(0); + ASSERT_TRUE(s != nullptr); + ASSERT_EQ(handshake::UNINITIALIZED, + AdapterTransport::Get(s)->handshake_phase()); + + // Send a well-formed v2 hello: the negotiation succeeds + // but the resource allocation does not. + rdma::v2_wire::HelloMessage msg{}; + msg.msg_len = rdma::HELLO_V2_MSG_LEN_MIN; + msg.hello_ver = rdma::HELLO_V2_VERSION; + msg.impl_ver = rdma::IMPL_V2_VERSION; + msg.sq_size = 16; + msg.rq_size = 16; + msg.block_size = 8192; + msg.qp_num = 0; + msg.gid = rdma::GetRdmaGid(); + + uint8_t data[rdma::HELLO_V2_MSG_LEN_MIN]; + memcpy(data, "RDMA", 4); + msg.Serialize(data + 4); + ASSERT_EQ(rdma::HELLO_V2_MSG_LEN_MIN, + write(sockfd, data, rdma::HELLO_V2_MSG_LEN_MIN)); + usleep(100000); + ASSERT_EQ(handshake::ACK_WAIT, AdapterTransport::Get(s)->handshake_phase()); + ASSERT_EQ(RdmaTransport::RDMA_OFF, RdmaTransport::Get(s)->_rdma_state); + ASSERT_FALSE(s->Failed()); + + // Ack without RDMA so that the server finishes the handshake in TCP mode. + uint32_t flags = butil::HostToNet32(0); + ASSERT_EQ(sizeof(flags), write(sockfd, &flags, sizeof(flags))); + usleep(100000); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + ASSERT_FALSE(s->Failed()); + + sockfd.reset(-1); + usleep(100000); + ASSERT_EQ(nullptr, GetSocketFromServer(0)); + + StopServer(); } TEST_F(RdmaTest, try_global_disable_rdma) { - StartServer(); - rdma::g_rdma_available.store(false, butil::memory_order_relaxed); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - - req.set_message(__FUNCTION__); - req.set_sleep_us(200000); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - usleep(100000); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ASSERT_EQ(rdma::RdmaEndpoint::FALLBACK_TCP, static_cast(s->_transport.get())->_rdma_ep->_state); - bthread_id_join(cntl.call_id()); - ASSERT_EQ(0, cntl.ErrorCode()); - - StopServer(); - rdma::g_rdma_available.store(true, butil::memory_order_relaxed); + StartServer(); + rdma::g_rdma_available.store(false, butil::memory_order_relaxed); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + + req.set_message(__FUNCTION__); + req.set_sleep_us(200000); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + usleep(100000); + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ASSERT_EQ(handshake::FALLBACK_TCP, + AdapterTransport::Get(s)->handshake_phase()); + bthread_id_join(cntl.call_id()); + ASSERT_EQ(0, cntl.ErrorCode()); + + StopServer(); + rdma::g_rdma_available.store(true, butil::memory_order_relaxed); } TEST_F(RdmaTest, server_option_invalid) { - Server server; - ServerOptions options; - options.socket_mode = SOCKET_MODE_RDMA; - - // rtmp and rdma are incompatible - options.rtmp_service = (RtmpService*)1; - ASSERT_EQ(-1, server.Start(PORT, &options)); - - // nshead and rdma are incompatible - options.rtmp_service = nullptr; - options.nshead_service = (NsheadService*)1; - ASSERT_EQ(-1, server.Start(PORT, &options)); - - // mongo and rdma are incompatible - options.nshead_service = nullptr; - options.mongo_service_adaptor = (MongoServiceAdaptor*)1; - ASSERT_EQ(-1, server.Start(PORT, &options)); - - // ssl and rdma are incompatible - options.mongo_service_adaptor = nullptr; - options.mutable_ssl_options()->default_cert.certificate = "test"; - ASSERT_EQ(-1, server.Start(PORT, &options)); + Server server; + ServerOptions options; + options.socket_mode = SOCKET_MODE_RDMA; + + // rtmp and rdma are incompatible + options.rtmp_service = (RtmpService *)1; + ASSERT_EQ(-1, server.Start(PORT, &options)); + + // nshead and rdma are incompatible + options.rtmp_service = nullptr; + options.nshead_service = (NsheadService *)1; + ASSERT_EQ(-1, server.Start(PORT, &options)); + + // mongo and rdma are incompatible + options.nshead_service = nullptr; + options.mongo_service_adaptor = (MongoServiceAdaptor *)1; + ASSERT_EQ(-1, server.Start(PORT, &options)); + + // ssl and rdma are incompatible + options.mongo_service_adaptor = nullptr; + options.mutable_ssl_options()->default_cert.certificate = "test"; + ASSERT_EQ(-1, server.Start(PORT, &options)); } TEST_F(RdmaTest, channel_option_invalid) { - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - - // rtmp and rdma are incompatible - chan_options.protocol = "rtmp"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - chan_options.protocol = "streaming_rpc"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // nshead and rdma are incompatible - chan_options.protocol = "nshead"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - chan_options.protocol = "nshead_mcpack"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // nova_pbrpc and rdma are incompatible - chan_options.protocol = "nova_pbrpc"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // public_pbrpc and rdma are incompatible - chan_options.protocol = "public_pbrpc"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // redis and rdma are incompatible - chan_options.protocol = "redis"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // memcache and rdma are incompatible - chan_options.protocol = "memcache"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // ubrpc and rdma are incompatible - chan_options.protocol = "ubrpc_compack"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // itp and rdma are incompatible - chan_options.protocol = "itp"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // esp and rdma are incompatible - chan_options.protocol = "esp"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // hulu_pbrpc and rdma are incompatible - chan_options.protocol = "hulu_pbrpc"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // sofa_pbrpc and rdma are incompatible - chan_options.protocol = "sofa_pbrpc"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // http and rdma are incompatible - chan_options.protocol = "http"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); - - // ssl and rdma are incompatible - chan_options.protocol = "baidu_std"; - chan_options.mutable_ssl_options()->sni_name = "test"; - ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + + // rtmp and rdma are incompatible + chan_options.protocol = "rtmp"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + chan_options.protocol = "streaming_rpc"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // nshead and rdma are incompatible + chan_options.protocol = "nshead"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + chan_options.protocol = "nshead_mcpack"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // nova_pbrpc and rdma are incompatible + chan_options.protocol = "nova_pbrpc"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // public_pbrpc and rdma are incompatible + chan_options.protocol = "public_pbrpc"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // redis and rdma are incompatible + chan_options.protocol = "redis"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // memcache and rdma are incompatible + chan_options.protocol = "memcache"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // ubrpc and rdma are incompatible + chan_options.protocol = "ubrpc_compack"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // itp and rdma are incompatible + chan_options.protocol = "itp"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // esp and rdma are incompatible + chan_options.protocol = "esp"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // hulu_pbrpc and rdma are incompatible + chan_options.protocol = "hulu_pbrpc"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // sofa_pbrpc and rdma are incompatible + chan_options.protocol = "sofa_pbrpc"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // http and rdma are incompatible + chan_options.protocol = "http"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); + + // ssl and rdma are incompatible + chan_options.protocol = "baidu_std"; + chan_options.mutable_ssl_options()->sni_name = "test"; + ASSERT_EQ(-1, channel.Init(g_ep, &chan_options)); } TEST_P(RdmaRpcTest, rdma_client_to_rdma_server) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - // usleep(100000); - bthread_id_join(cntl.call_id()); - ASSERT_EQ(0, cntl.ErrorCode()); - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + // usleep(100000); + bthread_id_join(cntl.call_id()); + ASSERT_EQ(0, cntl.ErrorCode()); + + StopServer(); } TEST_P(RdmaRpcTest, tcp_client_to_tcp_server) { - StartServer(false); - - Channel channel; - ChannelOptions chan_options; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - usleep(100000); - bthread_id_join(cntl.call_id()); - ASSERT_EQ(0, cntl.ErrorCode()); - - StopServer(); + StartServer(false); + + Channel channel; + ChannelOptions chan_options; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + usleep(100000); + bthread_id_join(cntl.call_id()); + ASSERT_EQ(0, cntl.ErrorCode()); + + StopServer(); } TEST_P(RdmaRpcTest, tcp_client_to_rdma_server) { - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - usleep(100000); - bthread_id_join(cntl.call_id()); - ASSERT_EQ(0, cntl.ErrorCode()); - - StopServer(); + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + usleep(100000); + bthread_id_join(cntl.call_id()); + ASSERT_EQ(0, cntl.ErrorCode()); + + StopServer(); } TEST_P(RdmaRpcTest, rdma_client_to_tcp_server) { - StartServer(false); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - usleep(100000); - bthread_id_join(cntl.call_id()); - ASSERT_FALSE(cntl.Failed()); - - StopServer(); + StartServer(false); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + usleep(100000); + bthread_id_join(cntl.call_id()); + ASSERT_FALSE(cntl.Failed()); + + StopServer(); } static const int RPC_NUM = 1024; -void DumpRdmaEndpointInfo(Socket* client, Socket* server) { - std::cout << std::endl << "client:"; - static_cast(client->_transport.get())->_rdma_ep->DebugInfo(std::cout); - std::cout << std::endl << "server:"; - static_cast(server->_transport.get())->_rdma_ep->DebugInfo(std::cout); +void DumpRdmaEndpointInfo(Socket *client, Socket *server) { + std::cout << std::endl << "client:"; + RdmaTransport::Get(client)->_rdma_ep->DebugInfo(std::cout); + std::cout << std::endl << "server:"; + RdmaTransport::Get(server)->_rdma_ep->DebugInfo(std::cout); } TEST_P(RdmaRpcTest, send_rpcs_in_one_qp) { - if (!FLAGS_rdma_test_enable) { - return; + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 50000; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + LOG(INFO) << "send 0 attachment"; + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 50000; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - LOG(INFO) << "send 0 attachment"; - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } + + LOG(INFO) << "send 4KB attachment"; + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + cntl[i].Reset(); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - } - ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } + + LOG(INFO) << "send 1MB attachment"; + attach.resize(1048576); + for (int i = 0; i < RPC_NUM; ++i) { + cntl[i].Reset(); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); } + ASSERT_TRUE(0 == cntl[i].ErrorCode() || EOVERCROWDED == cntl[i].ErrorCode()) + << "req[" << i << "] " << berror(cntl[i].ErrorCode()); + } - LOG(INFO) << "send 4KB attachment"; - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - cntl[i].Reset(); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - } - ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; - } - - LOG(INFO) << "send 1MB attachment"; - attach.resize(1048576); - for (int i = 0; i < RPC_NUM; ++i) { - cntl[i].Reset(); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - } - ASSERT_TRUE(0 == cntl[i].ErrorCode() || - EOVERCROWDED == cntl[i].ErrorCode()) << "req[" << i << "] " << berror(cntl[i].ErrorCode()); - } + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[0]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[0]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - - StopServer(); + StopServer(); } TEST_P(RdmaRpcTest, send_rpc_in_many_qp) { - if (!FLAGS_rdma_test_enable) { - return; - } - - butil::ip_t ip; - ASSERT_EQ(0, butil::str2ip(g_ip.c_str(), &ip)); - - Server server[100]; - MyEchoService svc[100]; - int num = 100; - butil::EndPoint server_eps[100]; - for (int i = 0; i < num; ++i) { - ServerOptions options; - options.socket_mode = SOCKET_MODE_RDMA; - options.idle_timeout_sec = 1; - options.max_concurrency = 0; - options.internal_port = -1; - server[i].AddService(&svc[i], SERVER_DOESNT_OWN_SERVICE); - ASSERT_EQ(0, server[i].Start(0, &options)); - server_eps[i] = butil::EndPoint(ip, server[i].listen_address().port); - } - - int port = 0; - butil::IOBuf attach; - attach.resize(4096); - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 100000; - chan_options.max_retry = 0; - Channel channel[RPC_NUM]; - Server* svr[RPC_NUM]; - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - for (int i = 0; i < RPC_NUM; ++i) { - svr[i] = &server[i % num]; - ASSERT_EQ(0, channel[i].Init(server_eps[(port++) % num], &chan_options)); - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel[i]).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - EXPECT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - if (s && svr[i] && svr[i]->_am) { - std::vector sids; - svr[i]->_am->ListConnections(&sids); - for (size_t j = 0; j < sids.size(); ++j) { - SocketUniquePtr m; - if (Socket::AddressFailedAsWell(sids[j], &m) == 0) { - DumpRdmaEndpointInfo(s.get(), m.get()); - } - } - } + if (!FLAGS_rdma_test_enable) { + return; + } + + butil::ip_t ip; + ASSERT_EQ(0, butil::str2ip(g_ip.c_str(), &ip)); + + Server server[100]; + MyEchoService svc[100]; + int num = 100; + butil::EndPoint server_eps[100]; + for (int i = 0; i < num; ++i) { + ServerOptions options; + options.socket_mode = SOCKET_MODE_RDMA; + options.idle_timeout_sec = 1; + options.max_concurrency = 0; + options.internal_port = -1; + server[i].AddService(&svc[i], SERVER_DOESNT_OWN_SERVICE); + ASSERT_EQ(0, server[i].Start(0, &options)); + server_eps[i] = butil::EndPoint(ip, server[i].listen_address().port); + } + + int port = 0; + butil::IOBuf attach; + attach.resize(4096); + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 100000; + chan_options.max_retry = 0; + Channel channel[RPC_NUM]; + Server *svr[RPC_NUM]; + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + for (int i = 0; i < RPC_NUM; ++i) { + svr[i] = &server[i % num]; + ASSERT_EQ(0, channel[i].Init(server_eps[(port++) % num], &chan_options)); + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel[i]) + .Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + EXPECT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + if (s && svr[i] && svr[i]->_am) { + std::vector sids; + svr[i]->_am->ListConnections(&sids); + for (size_t j = 0; j < sids.size(); ++j) { + SocketUniquePtr m; + if (Socket::AddressFailedAsWell(sids[j], &m) == 0) { + DumpRdmaEndpointInfo(s.get(), m.get()); + } } - EXPECT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } } + EXPECT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } - for (int i = 0; i < num; ++i) { - server[i].Stop(0); - server[i].Join(); - } + for (int i = 0; i < num; ++i) { + server[i].Stop(0); + server[i].Join(); + } } TEST_P(RdmaRpcTest, send_rpcs_as_pooled_connection) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 30000; // it may very slow - chan_options.timeout_ms = 30000; - chan_options.max_retry = 0; - chan_options.connection_type = "pooled"; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - } - ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 30000; // it may very slow + chan_options.timeout_ms = 30000; + chan_options.max_retry = 0; + chan_options.connection_type = "pooled"; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); } + ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } - StopServer(); + StopServer(); } TEST_P(RdmaRpcTest, send_rpcs_as_short_connection) { - if (!FLAGS_rdma_test_enable) { - return; + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 30000; // it may very slow + chan_options.timeout_ms = 30000; + chan_options.max_retry = 0; + chan_options.connection_type = "short"; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); + Socket *m = GetSocketFromServer(0); + DumpRdmaEndpointInfo(s.get(), m); } + ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + } - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 30000; // it may very slow - chan_options.timeout_ms = 30000; - chan_options.max_retry = 0; - chan_options.connection_type = "short"; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (cntl[i].ErrorCode() == ERPCTIMEDOUT) { - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl[i]._single_server_id, &s)); - Socket* m = GetSocketFromServer(0); - DumpRdmaEndpointInfo(s.get(), m); - } - ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; - } - - StopServer(); + StopServer(); } TEST_P(RdmaRpcTest, server_stop_during_rpc) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 3000; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - if (i == 0) StopServer(); - int error_code = cntl[i].ErrorCode(); - ASSERT_TRUE(error_code == 0 || - error_code == EEOF || - error_code == ELOGOFF || - error_code == EHOSTDOWN) << "req[" << i << "]: " << error_code; - } + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 3000; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + if (i == 0) + StopServer(); + int error_code = cntl[i].ErrorCode(); + ASSERT_TRUE(error_code == 0 || error_code == EEOF || + error_code == ELOGOFF || error_code == EHOSTDOWN) + << "req[" << i << "]: " << error_code; + } } TEST_P(RdmaRpcTest, server_close_during_rpc) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 3000; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - if (i == RPC_NUM / 2) { - req[i].set_close_fd(true); - } - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 3000; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + if (i == RPC_NUM / 2) { + req[i].set_close_fd(true); } - - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - int error_code = cntl[i].ErrorCode(); - ASSERT_TRUE(error_code == 0 || - error_code == EEOF || - error_code == EFAILEDSOCKET || - error_code == EHOSTDOWN) << "req[" << i << "]: " << error_code; - } - - StopServer(); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + int error_code = cntl[i].ErrorCode(); + ASSERT_TRUE(error_code == 0 || error_code == EEOF || + error_code == EFAILEDSOCKET || error_code == EHOSTDOWN) + << "req[" << i << "]: " << error_code; + } + + StopServer(); } TEST_P(RdmaRpcTest, client_close_during_rpc) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 3000; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - attach.resize(4096); - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - - cntl[0].CloseConnection("Close connection"); - - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - int error_code = cntl[i].ErrorCode(); - ASSERT_TRUE(error_code == 0 || - error_code == ECLOSE || - error_code == EHOSTDOWN) << "req[" << i << "]: " << error_code; - } - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 3000; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + attach.resize(4096); + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + + cntl[0].CloseConnection("Close connection"); + + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + int error_code = cntl[i].ErrorCode(); + ASSERT_TRUE(error_code == 0 || error_code == ECLOSE || + error_code == EHOSTDOWN) + << "req[" << i << "]: " << error_code; + } + + StopServer(); } TEST_P(RdmaRpcTest, verbs_error_handling) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - req.set_sleep_us(200000); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); - - usleep(100000); // wait for rdma handshake complete - - SocketUniquePtr s; - ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); - ibv_send_wr wr; - memset(&wr, 0, sizeof(wr)); - ibv_sge sge; - void* buf = malloc(8192); - sge.addr = (uint64_t)buf; - sge.length = 8192; - sge.lkey = 1; // incorrect lkey - wr.sg_list = &sge; - wr.num_sge = 1; - ibv_send_wr* bad = nullptr; - auto rdma_transport = static_cast(s->_transport.get()); - ibv_post_send(rdma_transport->_rdma_ep->_resource->qp, &wr, &bad); - bthread_id_join(cntl.call_id()); - ASSERT_EQ(ERDMA, cntl.ErrorCode()); - free(buf); - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + req.set_sleep_us(200000); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, done); + + usleep(100000); // wait for rdma handshake complete + + SocketUniquePtr s; + ASSERT_EQ(0, Socket::Address(cntl._single_server_id, &s)); + ibv_send_wr wr; + memset(&wr, 0, sizeof(wr)); + ibv_sge sge; + void *buf = malloc(8192); + sge.addr = (uint64_t)buf; + sge.length = 8192; + sge.lkey = 1; // incorrect lkey + wr.sg_list = &sge; + wr.num_sge = 1; + ibv_send_wr *bad = nullptr; + auto rdma_transport = RdmaTransport::Get(s); + ibv_post_send(rdma_transport->_rdma_ep->_resource->qp, &wr, &bad); + bthread_id_join(cntl.call_id()); + ASSERT_EQ(ERDMA, cntl.ErrorCode()); + free(buf); + + StopServer(); } TEST_P(RdmaRpcTest, rdma_use_parallel_channel) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - const size_t NCHANS = 8; - Channel subchans[NCHANS]; - ParallelChannel channel; - ChannelOptions opts; - opts.socket_mode = SOCKET_MODE_RDMA; - for (size_t i = 0; i < NCHANS; ++i) { - ASSERT_EQ(0, subchans[i].Init(_naming_url.c_str(), "rR", &opts)); - ASSERT_EQ(0, channel.AddChannel( - &subchans[i], DOESNT_OWN_CHANNEL, - nullptr, nullptr)); - } - ASSERT_EQ(0, channel.Init(nullptr)); - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, nullptr); - - ASSERT_EQ(0, cntl.ErrorCode()); - ASSERT_EQ(NCHANS, (size_t)cntl.sub_count()); - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + const size_t NCHANS = 8; + Channel subchans[NCHANS]; + ParallelChannel channel; + ChannelOptions opts; + opts.socket_mode = SOCKET_MODE_RDMA; + for (size_t i = 0; i < NCHANS; ++i) { + ASSERT_EQ(0, subchans[i].Init(_naming_url.c_str(), "rR", &opts)); + ASSERT_EQ(0, channel.AddChannel(&subchans[i], DOESNT_OWN_CHANNEL, nullptr, + nullptr)); + } + ASSERT_EQ(0, channel.Init(nullptr)); + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, nullptr); + + ASSERT_EQ(0, cntl.ErrorCode()); + ASSERT_EQ(NCHANS, (size_t)cntl.sub_count()); + + StopServer(); } TEST_P(RdmaRpcTest, rdma_use_selective_channel) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - const size_t NCHANS = 8; - SelectiveChannel channel; - ChannelOptions opts; - opts.socket_mode = SOCKET_MODE_RDMA; - ASSERT_EQ(0, channel.Init("rr", &opts)); - for (size_t i = 0; i < NCHANS; ++i) { - Channel* subchan = new Channel; - ASSERT_EQ(0, subchan->Init(_naming_url.c_str(), "rR", &opts)); - ASSERT_EQ(0, channel.AddChannel(subchan, nullptr)); - } - - Controller cntl; - test::EchoRequest req; - test::EchoResponse res; - req.set_message(__FUNCTION__); - ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, nullptr); - - ASSERT_EQ(0, cntl.ErrorCode()) << cntl.ErrorText(); - ASSERT_EQ(1, cntl.sub_count()); - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + const size_t NCHANS = 8; + SelectiveChannel channel; + ChannelOptions opts; + opts.socket_mode = SOCKET_MODE_RDMA; + ASSERT_EQ(0, channel.Init("rr", &opts)); + for (size_t i = 0; i < NCHANS; ++i) { + Channel *subchan = new Channel; + ASSERT_EQ(0, subchan->Init(_naming_url.c_str(), "rR", &opts)); + ASSERT_EQ(0, channel.AddChannel(subchan, nullptr)); + } + + Controller cntl; + test::EchoRequest req; + test::EchoResponse res; + req.set_message(__FUNCTION__); + ::test::EchoService::Stub(&channel).Echo(&cntl, &req, &res, nullptr); + + ASSERT_EQ(0, cntl.ErrorCode()) << cntl.ErrorText(); + ASSERT_EQ(1, cntl.sub_count()); + + StopServer(); } -static void MockFree(void* buf) { } +static void MockFree(void *buf) {} TEST_P(RdmaRpcTest, send_rpcs_with_user_defined_iobuf) { - if (!FLAGS_rdma_test_enable) { - return; - } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 500; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf attach; - void* data = malloc(4096);; - attach.append_user_data(data, 4096, nullptr); - req[0].set_message(__FUNCTION__); - cntl[0].request_attachment().append(attach); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[0], &req[0], &res[0], done); - bthread_id_join(cntl[0].call_id()); - ASSERT_EQ(ERDMAMEM, cntl[0].ErrorCode()); - attach.clear(); - sleep(2); // wait for client recover from EHOSTDOWN - cntl[0].Reset(); - - char* mr[2 * RPC_NUM]; - uint32_t lkey[2 * RPC_NUM]; - for (size_t i = 0; i < RPC_NUM; ++i) { - mr[2 * i] = (char*)malloc(4096); - memset(mr[2 * i], i % 100, 4096); - lkey[2 * i] = rdma::RegisterMemoryForRdma(mr[2 * i], 4096); - ASSERT_TRUE(lkey[2 * i] != 0); - cntl[i].request_attachment().append_user_data_with_meta(mr[2 * i] + i, 4096 - i, MockFree, lkey[2 * i]); - mr[2 * i + 1] = (char*)malloc(4096); - memset(mr[2 * i + 1], i % 100, 4096); - lkey[2 * i + 1] = rdma::RegisterMemoryForRdma(mr[2 * i + 1], 4096); - ASSERT_TRUE(lkey[2 * i + 1] != 0); - cntl[i].request_attachment().append_user_data_with_meta(mr[2 * i + 1] + i, 4096 - i, MockFree, lkey[2 * i + 1]); - req[i].set_message(__FUNCTION__); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (size_t i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; - rdma::DeregisterMemoryForRdma(mr[i]); - ASSERT_EQ(2 * (4096 - i), cntl[i].response_attachment().size()); - char tmp[8192]; - cntl[i].response_attachment().copy_to(tmp, 2 * (4096 - i)); - ASSERT_EQ(0, memcmp(mr[2 * i] + i, tmp, 4096 - i)); - ASSERT_EQ(0, memcmp(mr[2 * i + 1] + i, tmp + 4096 - i, 4096 - i)); - free(mr[2 * i]); - free(mr[2 * i + 1]); - } - - StopServer(); + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 500; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf attach; + void *data = malloc(4096); + ; + attach.append_user_data(data, 4096, nullptr); + req[0].set_message(__FUNCTION__); + cntl[0].request_attachment().append(attach); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[0], &req[0], &res[0], done); + bthread_id_join(cntl[0].call_id()); + ASSERT_EQ(ERDMAMEM, cntl[0].ErrorCode()); + attach.clear(); + sleep(2); // wait for client recover from EHOSTDOWN + cntl[0].Reset(); + + char *mr[2 * RPC_NUM]; + uint32_t lkey[2 * RPC_NUM]; + for (size_t i = 0; i < RPC_NUM; ++i) { + mr[2 * i] = (char *)malloc(4096); + memset(mr[2 * i], i % 100, 4096); + lkey[2 * i] = rdma::RegisterMemoryForRdma(mr[2 * i], 4096); + ASSERT_TRUE(lkey[2 * i] != 0); + cntl[i].request_attachment().append_user_data_with_meta( + mr[2 * i] + i, 4096 - i, MockFree, lkey[2 * i]); + mr[2 * i + 1] = (char *)malloc(4096); + memset(mr[2 * i + 1], i % 100, 4096); + lkey[2 * i + 1] = rdma::RegisterMemoryForRdma(mr[2 * i + 1], 4096); + ASSERT_TRUE(lkey[2 * i + 1] != 0); + cntl[i].request_attachment().append_user_data_with_meta( + mr[2 * i + 1] + i, 4096 - i, MockFree, lkey[2 * i + 1]); + req[i].set_message(__FUNCTION__); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (size_t i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + ASSERT_EQ(0, cntl[i].ErrorCode()) << "req[" << i << "]"; + rdma::DeregisterMemoryForRdma(mr[i]); + ASSERT_EQ(2 * (4096 - i), cntl[i].response_attachment().size()); + char tmp[8192]; + cntl[i].response_attachment().copy_to(tmp, 2 * (4096 - i)); + ASSERT_EQ(0, memcmp(mr[2 * i] + i, tmp, 4096 - i)); + ASSERT_EQ(0, memcmp(mr[2 * i + 1] + i, tmp + 4096 - i, 4096 - i)); + free(mr[2 * i]); + free(mr[2 * i + 1]); + } + + StopServer(); } TEST_P(RdmaRpcTest, try_memory_pool_empty) { - if (!FLAGS_rdma_test_enable) { - return; + if (!FLAGS_rdma_test_enable) { + return; + } + + StartServer(); + + Channel channel; + ChannelOptions chan_options; + chan_options.socket_mode = SOCKET_MODE_RDMA; + chan_options.connect_timeout_ms = 500; + chan_options.timeout_ms = 60000; + chan_options.max_retry = 0; + ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); + Controller cntl[RPC_NUM]; + test::EchoRequest req[RPC_NUM]; + test::EchoResponse res[RPC_NUM]; + + butil::IOBuf iobuf[RPC_NUM]; + for (int i = 0; i < 1024; ++i) { + if (iobuf[i].resize(1048576 * 8)) { + // 8MB for each iobuf + break; } - - StartServer(); - - Channel channel; - ChannelOptions chan_options; - chan_options.socket_mode = SOCKET_MODE_RDMA; - chan_options.connect_timeout_ms = 500; - chan_options.timeout_ms = 60000; - chan_options.max_retry = 0; - ASSERT_EQ(0, channel.Init(g_ep, &chan_options)); - Controller cntl[RPC_NUM]; - test::EchoRequest req[RPC_NUM]; - test::EchoResponse res[RPC_NUM]; - - butil::IOBuf iobuf[RPC_NUM]; - for (int i = 0; i < 1024; ++i) { - if (iobuf[i].resize(1048576 * 8)) { - // 8MB for each iobuf - break; - } - } - - for (int i = 0; i < RPC_NUM; ++i) { - req[i].set_message(__FUNCTION__); - cntl[i].request_attachment().append(iobuf[i]); - google::protobuf::Closure* done = DoNothing(); - ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); - } - for (int i = 0; i < RPC_NUM; ++i) { - bthread_id_join(cntl[i].call_id()); - } - - StopServer(); + } + + for (int i = 0; i < RPC_NUM; ++i) { + req[i].set_message(__FUNCTION__); + cntl[i].request_attachment().append(iobuf[i]); + google::protobuf::Closure *done = DoNothing(); + ::test::EchoService::Stub(&channel).Echo(&cntl[i], &req[i], &res[i], done); + } + for (int i = 0; i < RPC_NUM; ++i) { + bthread_id_join(cntl[i].call_id()); + } + + StopServer(); } // Run every TEST_P(RdmaRpcTest, ...) above twice: once with the @@ -2821,27 +2879,25 @@ TEST_P(RdmaRpcTest, try_memory_pool_empty) { // The server always accepts both via magic-byte dispatch, so this // proves the upper-layer RPC paths behave identically under either // wire format. -INSTANTIATE_TEST_SUITE_P( - HandshakeVersion, RdmaRpcTest, - ::testing::Values(2, 3), - [](const ::testing::TestParamInfo& info) { - return std::string("v") + std::to_string(info.param); - }); - -#endif // if BRPC_WITH_RDMA - -int main(int argc, char* argv[]) { - testing::InitGoogleTest(&argc, argv); - GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); +INSTANTIATE_TEST_SUITE_P(HandshakeVersion, RdmaRpcTest, ::testing::Values(2, 3), + [](const ::testing::TestParamInfo &info) { + return std::string("v") + std::to_string(info.param); + }); + +#endif // if BRPC_WITH_RDMA + +int main(int argc, char *argv[]) { + testing::InitGoogleTest(&argc, argv); + GFLAGS_NAMESPACE::ParseCommandLineFlags(&argc, &argv, true); #if BRPC_WITH_RDMA - rdma::FLAGS_rdma_trace_verbose = true; - rdma::FLAGS_rdma_memory_pool_max_regions = 2; - FLAGS_log_idle_connection_close = true; - if (!FLAGS_rdma_test_enable) { - // skip UT requiring rdma runtime environment - rdma::g_rdma_available.store(true, butil::memory_order_relaxed); - rdma::g_skip_rdma_init = true; - } -#endif // if BRPC_WITH_RDMA - return RUN_ALL_TESTS(); + rdma::FLAGS_rdma_trace_verbose = true; + rdma::FLAGS_rdma_memory_pool_max_regions = 2; + FLAGS_log_idle_connection_close = true; + if (!FLAGS_rdma_test_enable) { + // skip UT requiring rdma runtime environment + rdma::g_rdma_available.store(true, butil::memory_order_relaxed); + rdma::g_skip_rdma_init = true; + } +#endif // if BRPC_WITH_RDMA + return RUN_ALL_TESTS(); } diff --git a/test/brpc_transport_handshake_unittest.cpp b/test/brpc_transport_handshake_unittest.cpp new file mode 100644 index 0000000000..5aabed5322 --- /dev/null +++ b/test/brpc_transport_handshake_unittest.cpp @@ -0,0 +1,463 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include + +#include +#include +#include +#include +#include + +#include "butil/fd_guard.h" +#include "butil/sys_byteorder.h" +#include "brpc/adapter_transport.h" +#include "brpc/policy/transport_handshake_protocol.h" +#include "brpc/socket.h" +#include "brpc/transport_handshake.h" + +namespace brpc { +namespace handshake { + +class MemoryHandshakeIO : public HandshakeIO { +public: + explicit MemoryHandshakeIO(const std::string& input = std::string()) + : _input(input), _offset(0) {} + + int ReadExact(void* data, size_t len) override { + if (_input.size() - _offset < len) { + errno = EIO; + return -1; + } + memcpy(data, _input.data() + _offset, len); + _offset += len; + return 0; + } + + int WriteAll(const void* data, size_t len) override { + _output.append(static_cast(data), len); + return 0; + } + + int PushBack(const void* data, size_t len) override { + _pushed_back.append(static_cast(data), len); + return 0; + } + + const std::string& output() const { return _output; } + const std::string& pushed_back() const { return _pushed_back; } + +private: + std::string _input; + size_t _offset; + std::string _output; + std::string _pushed_back; +}; + +static FrameSpec FixedSpec(const char* magic, size_t magic_len, + size_t total_len) { + return FrameSpec(magic, magic_len, total_len, total_len, + FrameSpec::FIXED); +} + +static HandshakeCodec MakeTestCodec(std::string* calls = NULL) { + HandshakeCodec codec{}; + codec.protocol_version = 7; + codec.hello_frame = FixedSpec("HS", 2, 4); + codec.ack_frame = FixedSpec(NULL, 0, 1); + codec.build_hello = [calls](bool enabled, std::string* payload) { + if (calls) *calls += "build "; + *payload = enabled ? "LO" : "NO"; + return STEP_OK; + }; + codec.parse_hello = [calls](const std::string& payload) { + if (calls) *calls += "parse "; + return payload == "OK" ? STEP_OK : STEP_FALLBACK; + }; + codec.build_ack = [calls](bool enabled, std::string* payload) { + if (calls) *calls += enabled ? "ack1 " : "ack0 "; + *payload = enabled ? "1" : "0"; + return STEP_OK; + }; + codec.parse_ack = [calls](const std::string& payload, bool* enabled) { + if (calls) *calls += "parse_ack "; + *enabled = payload == "1"; + return payload == "1" || payload == "0" ? STEP_OK : STEP_ERROR; + }; + return codec; +} + +static std::string MakeUBShmHello() { + std::string frame(64, '\0'); + memcpy(&frame[0], "UB", 2); + const uint16_t msg_len = butil::HostToNet16(64); + const uint16_t hello_ver = butil::HostToNet16(2); + const uint16_t impl_ver = butil::HostToNet16(1); + memcpy(&frame[2], &msg_len, sizeof(msg_len)); + memcpy(&frame[4], &hello_ver, sizeof(hello_ver)); + memcpy(&frame[6], &impl_ver, sizeof(impl_ver)); + return frame; +} + +TEST(HandshakeFrameTest, supports_two_byte_fixed_magic) { + const FrameSpec spec = FixedSpec("UB", 2, 6); + std::string frame; + ASSERT_EQ(FRAME_OK, FrameCodec::Encode(spec, "data", &frame)); + ASSERT_EQ("UBdata", frame); +} + +TEST(HandshakeFrameTest, encodes_u16_total_length) { + const FrameSpec spec( + "RDMA", 4, 8, 64, FrameSpec::U16_TOTAL_LENGTH); + std::string frame; + ASSERT_EQ(FRAME_OK, FrameCodec::Encode(spec, "xy", &frame)); + ASSERT_EQ(8UL, frame.size()); + uint16_t total_be = 0; + memcpy(&total_be, frame.data() + 4, sizeof(total_be)); + ASSERT_EQ(8, butil::NetToHost16(total_be)); + ASSERT_EQ("xy", frame.substr(6)); +} + +TEST(HandshakeFrameTest, encodes_u32_body_length) { + const FrameSpec spec( + "RDM3", 4, 9, 32, FrameSpec::U32_BODY_LENGTH); + std::string frame; + ASSERT_EQ(FRAME_OK, FrameCodec::Encode(spec, "abc", &frame)); + uint32_t body_be = 0; + memcpy(&body_be, frame.data() + 4, sizeof(body_be)); + ASSERT_EQ(3U, butil::NetToHost32(body_be)); + ASSERT_EQ("abc", frame.substr(8)); +} + +TEST(HandshakeFrameTest, buffered_partial_frame_is_not_consumed) { + const FrameSpec spec( + "RDMA", 4, 8, 64, FrameSpec::U16_TOTAL_LENGTH); + std::string frame; + ASSERT_EQ(FRAME_OK, FrameCodec::Encode(spec, "payload", &frame)); + butil::IOBuf source; + source.append(frame.data(), frame.size() - 1); + IOBufHandshakeInput input(&source); + std::string payload; + ASSERT_EQ(FRAME_NEED_MORE, + FrameCodec::ParseBufferedFrame(&input, spec, &payload)); + ASSERT_EQ(frame.size() - 1, source.size()); + + source.append(frame.data() + frame.size() - 1, 1); + ASSERT_EQ(FRAME_OK, + FrameCodec::ParseBufferedFrame(&input, spec, &payload)); + ASSERT_EQ("payload", payload); + ASSERT_TRUE(source.empty()); +} + +TEST(HandshakeFrameTest, buffered_magic_mismatch_is_not_consumed) { + const FrameSpec spec = FixedSpec("UB", 2, 6); + butil::IOBuf source; + source.append("XXdata", 6); + IOBufHandshakeInput input(&source); + std::string payload; + ASSERT_EQ(FRAME_NOT_MINE, + FrameCodec::ParseBufferedFrame(&input, spec, &payload)); + ASSERT_EQ(6UL, source.size()); +} + +TEST(HandshakeFrameTest, blocking_magic_mismatch_is_pushed_back) { + MemoryHandshakeIO io("XX"); + const FrameSpec spec = FixedSpec("UB", 2, 6); + std::string payload; + ASSERT_EQ(FRAME_NOT_MINE, + FrameCodec::ReadFrame(&io, spec, true, &payload)); + ASSERT_EQ("XX", io.pushed_back()); +} + +TEST(HandshakeFrameTest, rejects_lengths_outside_bounds) { + const FrameSpec spec( + "RDMA", 4, 8, 16, FrameSpec::U16_TOTAL_LENGTH); + std::string header("RDMA", 4); + const uint16_t total_be = butil::HostToNet16(17); + header.append(reinterpret_cast(&total_be), sizeof(total_be)); + butil::IOBuf source; + source.append(header); + IOBufHandshakeInput input(&source); + std::string payload; + ASSERT_EQ(FRAME_PROTOCOL_ERROR, + FrameCodec::ParseBufferedFrame(&input, spec, &payload)); + ASSERT_EQ(header.size(), source.size()); +} + +TEST(TransportHandshakeTest, publish_fallback_after_tcp_state) { + HandshakeSession session; + int tcp_active = 0; + session.SetPhase(NEGOTIATING); + session.PublishFallback([&tcp_active]() { tcp_active = 1; }); + ASSERT_EQ(1, tcp_active); + ASSERT_EQ(FALLBACK_TCP, session.phase()); +} + +TEST(TransportHandshakeTest, client_runs_codec_and_resource_sequence) { + MemoryHandshakeIO io("HSOK"); + HandshakeSession session; + session.SetIOForTest(&io); + std::string calls; + + ClientHandshakeCallbacks callbacks{}; + callbacks.codec = MakeTestCodec(&calls); + callbacks.transport.prepare_resources = [&]() { + calls += "prepare "; + return STEP_OK; + }; + callbacks.transport.negotiate_resources = [&]() { + calls += "negotiate "; + return STEP_OK; + }; + callbacks.transport.set_high_speed_active = [&]() { calls += "activate"; }; + callbacks.transport.set_tcp_active = []() {}; + callbacks.transport.on_failed = []() {}; + + ASSERT_EQ(STEP_OK, session.RunClient(callbacks)); + ASSERT_EQ("prepare build parse negotiate ack1 activate", calls); + ASSERT_EQ("HSLO1", io.output()); + ASSERT_EQ(ESTABLISHED, session.phase()); + ASSERT_EQ(7, session.protocol_version()); +} + +TEST(TransportHandshakeTest, client_resource_failure_falls_back_before_io) { + MemoryHandshakeIO io; + HandshakeSession session; + session.SetIOForTest(&io); + bool tcp_active = false; + + ClientHandshakeCallbacks callbacks{}; + callbacks.codec = MakeTestCodec(); + callbacks.transport.prepare_resources = []() { return STEP_FALLBACK; }; + callbacks.transport.negotiate_resources = []() { return STEP_ERROR; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = [&]() { tcp_active = true; }; + callbacks.transport.on_failed = []() {}; + + ASSERT_EQ(STEP_FALLBACK, session.RunClient(callbacks)); + ASSERT_TRUE(tcp_active); + ASSERT_TRUE(io.output().empty()); + ASSERT_EQ(FALLBACK_TCP, session.phase()); +} + +TEST(TransportHandshakeTest, server_resumes_at_buffered_ack) { + MemoryHandshakeIO io; + HandshakeSession session; + session.SetIOForTest(&io); + butil::IOBuf source; + source.append("HSOK", 4); + IOBufHandshakeInput input(&source); + std::string calls; + + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.codecs.push_back(MakeTestCodec(&calls)); + callbacks.input = &input; + callbacks.transport.prepare_resources = [&]() { + calls += "prepare "; + return STEP_OK; + }; + callbacks.transport.negotiate_resources = [&]() { + calls += "negotiate "; + return STEP_OK; + }; + callbacks.validate_established = [&]() { + calls += "validate "; + return STEP_OK; + }; + callbacks.transport.set_high_speed_active = [&]() { calls += "activate"; }; + callbacks.transport.set_tcp_active = []() {}; + callbacks.transport.on_failed = []() {}; + + ASSERT_EQ(STEP_NEED_MORE, session.RunServer(callbacks)); + ASSERT_EQ(16, session.phase()); + ASSERT_EQ("HSLO", io.output()); + ASSERT_TRUE(source.empty()); + + source.append("1", 1); + ASSERT_EQ(STEP_OK, session.RunServer(callbacks)); + ASSERT_EQ("parse prepare negotiate build parse_ack validate activate", + calls); + ASSERT_EQ(ESTABLISHED, session.phase()); +} + +TEST(TransportHandshakeTest, server_resource_failure_falls_back_after_ack) { + MemoryHandshakeIO io; + HandshakeSession session; + session.SetIOForTest(&io); + butil::IOBuf source; + source.append("HSOK0", 5); + IOBufHandshakeInput input(&source); + bool tcp_active = false; + + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.codecs.push_back(MakeTestCodec()); + callbacks.input = &input; + callbacks.transport.prepare_resources = []() { return STEP_FALLBACK; }; + callbacks.transport.negotiate_resources = []() { return STEP_ERROR; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = [&]() { tcp_active = true; }; + callbacks.transport.on_failed = []() {}; + + ASSERT_EQ(STEP_FALLBACK, session.RunServer(callbacks)); + ASSERT_EQ("HSNO", io.output()); + ASSERT_TRUE(source.empty()); + ASSERT_TRUE(tcp_active); + ASSERT_EQ(FALLBACK_TCP, session.phase()); +} + +TEST(TransportHandshakeTest, server_falls_back_without_consuming_other_magic) { + MemoryHandshakeIO io; + HandshakeSession session; + session.SetIOForTest(&io); + butil::IOBuf source; + source.append("XXok", 4); + IOBufHandshakeInput input(&source); + bool tcp_active = false; + + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = true; + callbacks.codecs.push_back(MakeTestCodec()); + callbacks.input = &input; + callbacks.transport.prepare_resources = []() { return STEP_ERROR; }; + callbacks.transport.negotiate_resources = []() { return STEP_ERROR; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = [&]() { tcp_active = true; }; + callbacks.transport.on_failed = []() {}; + + ASSERT_EQ(STEP_FALLBACK, session.RunServer(callbacks)); + ASSERT_TRUE(tcp_active); + ASSERT_EQ(4UL, source.size()); + ASSERT_EQ(FALLBACK_TCP, session.phase()); + + ASSERT_EQ(STEP_NOT_MINE, session.RunServer(callbacks)); + ASSERT_EQ(4UL, source.size()); + ASSERT_EQ(FALLBACK_TCP, session.phase()); +} + +TEST(TransportHandshakeTest, server_enters_hello_phase_after_magic_matches) { + MemoryHandshakeIO io; + HandshakeSession session; + session.SetIOForTest(&io); + butil::IOBuf source; + IOBufHandshakeInput input(&source); + + ServerHandshakeCallbacks callbacks{}; + callbacks.fallback_on_not_mine = false; + callbacks.codecs.push_back(MakeTestCodec()); + callbacks.input = &input; + callbacks.transport.prepare_resources = []() { return STEP_OK; }; + callbacks.transport.negotiate_resources = []() { return STEP_OK; }; + callbacks.transport.set_high_speed_active = []() {}; + callbacks.transport.set_tcp_active = []() {}; + callbacks.transport.on_failed = []() {}; + + source.append("H", 1); + ASSERT_EQ(STEP_NEED_MORE, session.RunServer(callbacks)); + ASSERT_EQ(UNINITIALIZED, session.phase()); + + source.append("S", 1); + ASSERT_EQ(STEP_NEED_MORE, session.RunServer(callbacks)); + ASSERT_EQ(13, session.phase()); + ASSERT_EQ(7, session.protocol_version()); + ASSERT_EQ(2UL, source.size()); +} + +TEST(TransportHandshakeTest, + plain_tcp_server_incrementally_rejects_ubshm_upgrade) { + int fds[2]; + ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); + butil::fd_guard peer_fd(fds[1]); + SocketOptions options; + options.fd = fds[0]; + SocketId id; + ASSERT_EQ(0, Socket::Create(options, &id)); + SocketUniquePtr socket; + ASSERT_EQ(0, Socket::Address(id, &socket)); + + const std::string hello = MakeUBShmHello(); + butil::IOBuf source; + source.append(hello.data(), 1); + ParseResult result = policy::ParseTransportHandshake( + &source, socket.get(), false, NULL); + ASSERT_FALSE(result.is_ok()); + ASSERT_EQ(PARSE_ERROR_NOT_ENOUGH_DATA, result.error()); + ASSERT_EQ(1UL, source.size()); + ASSERT_EQ(UNINITIALIZED, + AdapterTransport::Get(socket.get())->handshake_phase()); + + source.append(hello.data() + 1, hello.size() - 1); + result = policy::ParseTransportHandshake( + &source, socket.get(), false, NULL); + ASSERT_FALSE(result.is_ok()); + ASSERT_EQ(PARSE_ERROR_NOT_ENOUGH_DATA, result.error()); + ASSERT_TRUE(source.empty()); + ASSERT_NE(NULL, socket->parsing_context()); + + char reply[64]; + ASSERT_EQ(sizeof(reply), read(peer_fd, reply, sizeof(reply))); + EXPECT_EQ(0, memcmp(reply, "UB", 2)); + uint16_t reply_len = 0; + memcpy(&reply_len, reply + 2, sizeof(reply_len)); + EXPECT_EQ(64, butil::NetToHost16(reply_len)); + EXPECT_EQ(0, reply[4]); + EXPECT_EQ(0, reply[5]); + EXPECT_EQ(0, reply[6]); + EXPECT_EQ(0, reply[7]); + + const uint32_t ack = 0; + source.append(&ack, sizeof(ack)); + result = policy::ParseTransportHandshake( + &source, socket.get(), false, NULL); + ASSERT_FALSE(result.is_ok()); + ASSERT_EQ(PARSE_ERROR_TRY_OTHERS, result.error()); + ASSERT_TRUE(source.empty()); + ASSERT_EQ(FALLBACK_TCP, + AdapterTransport::Get(socket.get())->handshake_phase()); + ASSERT_EQ(NULL, socket->parsing_context()); + socket->SetFailed(); +} + +TEST(TransportHandshakeTest, plain_tcp_server_consumes_coalesced_ubshm_ack) { + int fds[2]; + ASSERT_EQ(0, socketpair(AF_UNIX, SOCK_STREAM, 0, fds)); + butil::fd_guard peer_fd(fds[1]); + SocketOptions options; + options.fd = fds[0]; + SocketId id; + ASSERT_EQ(0, Socket::Create(options, &id)); + SocketUniquePtr socket; + ASSERT_EQ(0, Socket::Address(id, &socket)); + + butil::IOBuf source; + source.append(MakeUBShmHello()); + const uint32_t ack = 0; + source.append(&ack, sizeof(ack)); + const ParseResult result = policy::ParseTransportHandshake( + &source, socket.get(), false, NULL); + ASSERT_FALSE(result.is_ok()); + ASSERT_EQ(PARSE_ERROR_TRY_OTHERS, result.error()); + ASSERT_TRUE(source.empty()); + ASSERT_EQ(FALLBACK_TCP, + AdapterTransport::Get(socket.get())->handshake_phase()); + ASSERT_EQ(NULL, socket->parsing_context()); + socket->SetFailed(); +} + +} // namespace handshake +} // namespace brpc diff --git a/test/brpc_ubring_unittest.cpp b/test/brpc_ubring_unittest.cpp index 14b2ef1b71..60ded9dd88 100644 --- a/test/brpc_ubring_unittest.cpp +++ b/test/brpc_ubring_unittest.cpp @@ -22,6 +22,7 @@ #include "brpc/socket.h" #if BRPC_WITH_UBRING +#include "brpc/handshake/ubshm_handshake.h" #include "brpc/ubshm/ub_endpoint.h" #include "brpc/ubshm/shm/shm_def.h" #include "brpc/ubshm/shm/shm_mgr.h" @@ -135,6 +136,45 @@ TEST_F(HelloMessageTest, toString_contains_fields) { EXPECT_NE(std::string::npos, s.find("UBRING_test")); } +TEST(UBShmHandshakeAdapterTest, codec_preserves_v2_wire_format) { + brpc::ubring::UBShmHandshakeAdapter adapter; + char shm_name[SHM_MAX_NAME_BUFF_LEN] = {0}; + memcpy(shm_name, "UBRING_test_C", 14); + + std::string payload; + ASSERT_EQ(brpc::handshake::STEP_OK, + adapter.BuildHello(true, 4 * 1024 * 1024, + shm_name, &payload)); + brpc::ubring::HelloMessage decoded{}; + ASSERT_EQ(brpc::handshake::STEP_OK, + adapter.ParseHello(payload, &decoded)); + EXPECT_EQ(64, decoded.msg_len); + EXPECT_EQ(2, decoded.hello_ver); + EXPECT_EQ(1, decoded.impl_ver); + EXPECT_EQ(4 * 1024 * 1024, decoded.len); + EXPECT_EQ(0, memcmp(shm_name, decoded.shm_name, + SHM_MAX_NAME_BUFF_LEN)); + + std::string frame; + const brpc::handshake::HandshakeCodec codec = adapter.MakeCodec(); + ASSERT_EQ(brpc::handshake::FRAME_OK, + brpc::handshake::FrameCodec::Encode( + codec.hello_frame, payload, &frame)); + ASSERT_EQ(64, frame.size()); + EXPECT_EQ("UB", frame.substr(0, 2)); +} + +TEST(UBShmHandshakeAdapterTest, disabled_hello_requests_tcp_fallback) { + brpc::ubring::UBShmHandshakeAdapter adapter; + std::string payload; + ASSERT_EQ(brpc::handshake::STEP_OK, + adapter.BuildHello(false, 0, NULL, &payload)); + brpc::ubring::HelloMessage decoded{}; + EXPECT_EQ(brpc::handshake::STEP_FALLBACK, + adapter.ParseHello(payload, &decoded)); + EXPECT_EQ(64, decoded.msg_len); +} + namespace brpc { namespace ubring { class UBShmEndpointTest : public ::testing::Test {