es 笔记

本文详细探讨了Elasticsearch的网络层处理,包括HTTP和TCP通信,超时处理,数据节点的健康检查,集群状态的更新与选举机制。还涉及了后台同步、备机checkpoint线程、Retention Lease同步以及Translog修剪等核心操作。
摘要由CSDN通过智能技术生成

网络层

plugins/transport-nio

  • Node 初始化 ActionModule,NetworkModule, ActionModule 初始化 RestController + ActionHandler , NetworkModule 初始化 NioHttpServerTransport NioTcpTransport 网络层lifecycle ,
  • NioHttpServerTransport 注册es nio网络通道 处理器 HttpReadWriteHandler
  • RestController 注册的patch 上的 RestHandler 处理rest请求
  • NodeClient Map<Action, TransportAction> 处理返回response

action

1.请求超时处理 线程 线程池 执行ContextPreservingRunnable::run

  • TimeoutHandler::run
    public void run() {
    if (responseHandlers.contains(requestId)) {
    long timeoutTime = threadPool.relativeTimeInMillis();
    timeoutInfoHandlers.put(requestId, new TimeoutInfoHolder(node, action, sentTime, timeoutTime));
    // now that we have the information visible via timeoutInfoHandlers, we try to remove the request id
    final Transport.ResponseContext holder = respons
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值