<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>后端 on haifeiWu</title><link>https://haifeiWu.github.io/categories/%E5%90%8E%E7%AB%AF/</link><description>Recent content in 后端 on haifeiWu</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>whfstudio@163.com (haifeiWu)</managingEditor><webMaster>whfstudio@163.com (haifeiWu)</webMaster><copyright>© 2016～2026 haifeiWu</copyright><lastBuildDate>Tue, 18 Jun 2024 18:32:24 +0800</lastBuildDate><atom:link href="https://haifeiWu.github.io/categories/%E5%90%8E%E7%AB%AF/index.xml" rel="self" type="application/rss+xml"/><item><title>Hadoop MapReduce：一个十年回顾与未来趋势（论文综述）</title><link>https://haifeiWu.github.io/posts/hadoop-mapreduce-yigeshinianhuiguyuweilaiqushi-lunwenzongshu/</link><pubDate>Tue, 18 Jun 2024 18:32:24 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/hadoop-mapreduce-yigeshinianhuiguyuweilaiqushi-lunwenzongshu/</guid><description>在过去的十年中，Hadoop MapReduce 成为了处理大规模数据集的主流框架。它通过简化复杂数据处理任务，并提供了高度可扩展、容错性强且成本效益高的计算解决方案而获得成功。</description></item><item><title>基于 WebSocket 的长连接服务的设计与实践</title><link>https://haifeiWu.github.io/posts/jiyu-websocket-dezhanglianjiefuwudeshejiyushijian/</link><pubDate>Tue, 18 Jun 2024 18:29:44 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/jiyu-websocket-dezhanglianjiefuwudeshejiyushijian/</guid><description>业务场景 在常见的 pk 游戏的场景下，pk 双方需要实时感知双方的做题状态，因此长连接在这种场景下的应用极为常见，本文将基于此来讨论下长连接服务的设计与实现。</description></item><item><title>千万级消息推送系统的设计与实践</title><link>https://haifeiWu.github.io/posts/qianwanjixiaoxituisongxitongdeshejiyushijian/</link><pubDate>Mon, 17 Jun 2024 20:40:01 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/qianwanjixiaoxituisongxitongdeshejiyushijian/</guid><description>推送平台支持千万级的通知/消息推送，透传消息，快速触达用户，能够有效提升用户留存率、活跃度。推送平台提供了全链路的移动推送能力，只需接入推送平台的 API 就可以立即将推送消息送达到用户的移动设备。</description></item><item><title>golang 项目中的全链路追踪（tracing）</title><link>https://haifeiWu.github.io/posts/golang-xiangmuzhongdequanlianluzhuizong-tracing/</link><pubDate>Sat, 30 Mar 2024 18:01:24 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/golang-xiangmuzhongdequanlianluzhuizong-tracing/</guid><description>链路追踪（Tracing）是一种技术，用于监视和记录计算机程序或系统的运行情况。在分布式系统中，追踪可以帮助开发者和运维人员理解多个组件是如何协同工作的，以及在处理请求时它们之间的交互情况。</description></item><item><title>MySQL 的存储结构-页</title><link>https://haifeiWu.github.io/posts/mysql-decunchujiegou-ye/</link><pubDate>Wed, 20 Dec 2023 16:05:02 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/mysql-decunchujiegou-ye/</guid><description>先从几个问题开始 innodb 引擎下 varchar 类型的最大长度？什么情况下我们需要水平分表？为什么？</description></item><item><title>如何使用 Redis 实现分布式锁</title><link>https://haifeiWu.github.io/posts/ruheshiyong-redis-shixianfenbushisuo/</link><pubDate>Tue, 19 Dec 2023 11:18:09 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/ruheshiyong-redis-shixianfenbushisuo/</guid><description>锁是我们在设计和实现大多数系统时绕不过的话题。一旦有竞争条件出现，在没有保护的操作的前提下，可能会出现不可预知的问题。</description></item><item><title>单元测试之 gomock</title><link>https://haifeiWu.github.io/posts/danyuanceshizhigomock/</link><pubDate>Tue, 08 Aug 2023 20:48:49 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/danyuanceshizhigomock/</guid><description>简介 gomock 的由来和概述 gomock 是 Uber 公司开源的一个 mock 框架，于 2015 年开源。它是基于 Go 语言中的反射机制实现的，可以自动生成接口的 mock 对象。</description></item><item><title>MapReduce 论文阅读</title><link>https://haifeiWu.github.io/posts/mapreducelunwenyuedu/</link><pubDate>Wed, 08 Mar 2023 15:33:34 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/mapreducelunwenyuedu/</guid><description>概述 这篇论文主要介绍了 MapReduce 编程模型和相关实现，用于处理和生成大型数据集。它隐藏了并行化、容错、本地性优化和负载平衡等细节，使得即使对于没有并行和分布式系统经验的程序员也很容易使用。</description></item><item><title>GFS 论文阅读</title><link>https://haifeiWu.github.io/posts/gfslunwenyuedu/</link><pubDate>Wed, 08 Mar 2023 15:32:18 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/gfslunwenyuedu/</guid><description>概述 这篇论文主要讲述了 Google 文件系统（GFS）的设计和实现。它介绍了 GFS 的目标、架构、组件、数据流和一些关键技术，如租约、快照和恢复等。</description></item><item><title>配送特征平台</title><link>https://haifeiWu.github.io/posts/peisongtezhengpingtai/</link><pubDate>Mon, 21 Jun 2021 16:02:12 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/peisongtezhengpingtai/</guid><description>现实世界中，一个运单的完成过程是从用户下单开始到用户收餐骑手离客为止，需经历一系列室内室外的场景——用户下单，系统派单，骑手室外骑行到目的地然后下车步行到商家，等待取餐驻留室内，商家出餐，骑手取餐离店</description></item><item><title>Kafka 的 Replica 机制</title><link>https://haifeiWu.github.io/posts/kafkadereplicajizhi/</link><pubDate>Wed, 12 May 2021 12:19:58 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/kafkadereplicajizhi/</guid><description>Kafka 是一个分布式的发布-订阅消息系统。它最初是在 LinkedIn 开发的，2011年7月成为一个 Apache 项目。</description></item><item><title>ZooKeeper 与分布式锁</title><link>https://haifeiWu.github.io/posts/zookeeper-yufenbushisuo/</link><pubDate>Wed, 13 Jan 2021 11:15:16 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/zookeeper-yufenbushisuo/</guid><description>在上篇文章中讨论了基于 Redis 的单机分布式锁与集群分布式锁的方案，在数据一致性要求不是很高的情况下，Redis 实现的分布式锁可以满足我们的要求。最近在拜读了 ZooKeeper 的论文之后，对于 ZooKeeper 实现的分布式锁，也是有必要了解一下的。使用 Zook…</description></item><item><title>基于 Redis 的分布式锁到底安全吗？</title><link>https://haifeiWu.github.io/posts/jiyu-redis-defenbushisuodaodianquanma/</link><pubDate>Tue, 11 Feb 2020 13:18:42 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/jiyu-redis-defenbushisuodaodianquanma/</guid><description>4，那么部署 Redis 的主从可以保证吗？主要原因是 Redis 主节点与从节点之间的数据同步是异步的。Redlock 算法是基于 N 个完全独立的 Redis 节点（通常情况下 N 可以设置成 5）。1，获取当前时间（毫秒数）。2，按顺序依次向 N 个 Redis 节…</description></item><item><title>MapReduce 的简单实现</title><link>https://haifeiWu.github.io/posts/mapreduce-shixiandejiandanshixian/</link><pubDate>Sat, 18 Jan 2020 23:37:50 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/mapreduce-shixiandejiandanshixian/</guid><description>相信用过 Hadoop 的同学在等待结果输出的时候会出现类似于这样的 INFO : 2020-01-17 11:44:14,132 Stage-11 map = 0%, reduce = 0% 的日志，它展示了 MapReduce 的执行过程，下面我们也将就 MapReduce…</description></item><item><title>使用 Go 优化我们的接口</title><link>https://haifeiWu.github.io/posts/shiyong-go-youhuawomendejiekou/</link><pubDate>Mon, 30 Dec 2019 19:47:34 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shiyong-go-youhuawomendejiekou/</guid><description>特征数据暴增，导致获取一个城市下所有的特征的接口延时高，下面是监控上看到的接口响应耗时，最慢的时候接口响应时间能达到 5s 多。1，使用缓存。分析业务需求，当前需要存储起来的数据是 ObjectId，ObjectId 是一个长度为 14 左右的字符串，我们假设平均下来 Object…</description></item><item><title>我理解的 TCP 连接</title><link>https://haifeiWu.github.io/posts/wolijiede-tcp-lianjie/</link><pubDate>Wed, 27 Nov 2019 12:01:51 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/wolijiede-tcp-lianjie/</guid><description>TCP 是面向连接的协议。运输连接是用来传输 TCP 报文的。TCP 运输连接的建立和释放是每一次面向连接通信中必不可少的过程。因此，运输连接有三个阶段，即：连接建立，数据传输和连接释放。在 TCP 连接建立过程中要解决一下三个问题。（1）要使一方明确知道对方的存在。（2）要…</description></item><item><title>Kafka Consumer 的 Rebalance 机制</title><link>https://haifeiWu.github.io/posts/kafka-consumer-de-rebalance-jizhi/</link><pubDate>Tue, 19 Nov 2019 16:22:34 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/kafka-consumer-de-rebalance-jizhi/</guid><description>如上图所示，Consumer 使用 Consumer Group 名称标记自己，并且发布到主题的每条记录都会传递到每个订阅消费者组中的一个 Consumer 实例。Consumer 实例可以在单独的进程中或在单独的机器上。如果所有 Consumer 实例都属于同一个 Con…</description></item><item><title>双重检查锁定与单例</title><link>https://haifeiWu.github.io/posts/shuangchongjianchasuodingyudanli/</link><pubDate>Wed, 13 Nov 2019 14:47:53 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shuangchongjianchasuodingyudanli/</guid><description>对于单例模式，相信大多数人都可以写出好几种实现方法，懒汉，饿汉等等，然而小小单例真要写好，写的完全正确也并非易事。下面是我们经常使用的一种单例的实现，也就是双重检查所的实现方案。让我们来看一下这个代码是如何工作的：首先当一个线程发出请求后，会先检查 instance 是否为 nu…</description></item><item><title>实时数据并发写入 Redis 优化</title><link>https://haifeiWu.github.io/posts/shishishujubingfaxieru-redis-youhua/</link><pubDate>Tue, 12 Nov 2019 10:57:02 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shishishujubingfaxieru-redis-youhua/</guid><description>当前架构的逻辑是将并发请求数据写入队列中，然后起一个单独的异步线程对数据进行串行处理。这种方式的好处就是不用考虑并发的问题，当然其弊端也是显而易见的~ 根据当前业务的数据更新在秒级，key 的碰撞率较低的情况。笔者打算采用使用 CAS 乐观锁方案：使用 Lua 脚本实现 Red…</description></item><item><title>Redis 与 Lua 使用中的小问题</title><link>https://haifeiWu.github.io/posts/redis-yu-lua-shiyongzhongdexiaowenti/</link><pubDate>Fri, 08 Nov 2019 13:35:42 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/redis-yu-lua-shiyongzhongdexiaowenti/</guid><description>通过上面的脚本可以看到，当 Redis 返回的结果为 (nil) 时候，其真实的数据类型为 boolean，因此我们直接判断 nil 是有问题的。Redis to Lua conversion table. Lua to Redis conversion table. Lua…</description></item><item><title>lang3 的 split 方法误用</title><link>https://haifeiWu.github.io/posts/lang3-de-split-fangfawuyong/</link><pubDate>Wed, 07 Aug 2019 13:53:17 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/lang3-de-split-fangfawuyong/</guid><description>apache 的 lang3 是我们开发常用到的三方工具包，然而对这个包不甚了解的话，会产生莫名其秒的 bug，在这里做下记录。通过分析字符串的拆分结果，发现该方法并不是将分隔符去截取字符串，而是将分隔符的每一个字符都当成分隔符去截取字符串，当我们的分隔符是一个字符的时候一…</description></item><item><title>实现自己的 RPC 框架（二）</title><link>https://haifeiWu.github.io/posts/shixianzijide-rpc-kuangjia-er/</link><pubDate>Tue, 06 Aug 2019 14:13:41 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shixianzijide-rpc-kuangjia-er/</guid><description>前段时间自己搞了个 RPC 的轮子，不过相对来说比较简单，最近在原来的基础上加以改造，使用 ZooKeeper 实现了 provider 自动寻址以及消费者的简单负载均衡，对之前的感兴趣的请转 造个轮子&amp;mdash;RPC 动手实现。在原来使用 TCP 直连的基础上实现基于 Zooke…</description></item><item><title>Docker 快速上手指南</title><link>https://haifeiWu.github.io/posts/docker-kuaisushangshouzhinan/</link><pubDate>Mon, 03 Dec 2018 14:09:51 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/docker-kuaisushangshouzhinan/</guid><description>Docker 听其大名已久，但总是疏于操练，今天准备好好搞一下。</description></item><item><title>散列表</title><link>https://haifeiWu.github.io/posts/sanliebiao/</link><pubDate>Fri, 23 Nov 2018 14:54:25 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/sanliebiao/</guid><description>是根据键 (Key) 而直接访问在内存存储位置的数据结构。也就是说，它通过计算一个关于键值的函数，将所需查询的数据映射到表中一个位置来访问记录，这加快了查找速度。</description></item><item><title>Nginx 不停机升级 及 gzip 压缩优化</title><link>https://haifeiWu.github.io/posts/nginx-butingjishengji-ji-gzip-yasuoyouhua/</link><pubDate>Wed, 14 Nov 2018 10:04:53 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/nginx-butingjishengji-ji-gzip-yasuoyouhua/</guid><description>好久不写博客手都生了，不过这个习惯不能丢，仅以一篇水文记录一下 Nginx 不停机版本升级及配置 gzip 压缩优化网站访问体验过程。何为水文，楼主对水文的定义就是百度一搜一大把，但是始终比较杂乱，需要自己仔细甄别才能真正解决问题，这也是楼主写这篇文章的原因，记录一下这个过程…</description></item><item><title>聊聊 volatile 关键字</title><link>https://haifeiWu.github.io/posts/liaoliao-volatile-guanjianzi/</link><pubDate>Mon, 22 Oct 2018 10:07:21 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/liaoliao-volatile-guanjianzi/</guid><description>我们知道 volatile 关键字的作用是保证变量在多线程之间的可见性，它是 java.util.concurrent 包的核心，没有 volatile 就没有这么多的并发类给我们使用。本文将简单介绍一下 volatile 这个东东。CAS(compare-and-swap)…</description></item><item><title>Filter 设计模式编码实践</title><link>https://haifeiWu.github.io/posts/filter-shejimoshibianmashijian/</link><pubDate>Fri, 21 Sep 2018 10:55:49 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/filter-shejimoshibianmashijian/</guid><description>最近项目中遇到各种输出数据监控，数据校验等逻辑，一个个实现很是麻烦。项目是中途接手的，不是很熟悉，偶然一天发现项目中对 Filter 的使用扩展起来很是方便，所以，今天楼主来分享下，也为自己学习做个记录。下面我们从三方面来阐述。Filter 在设计模式里面被称为责任链设计模式…</description></item><item><title>造个轮子之基于 Netty 实现自己的 RPC 框架</title><link>https://haifeiWu.github.io/posts/zaogelunzizhijiyu-netty-shixianzijide-rpc-kuangjia/</link><pubDate>Tue, 04 Sep 2018 08:31:11 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/zaogelunzizhijiyu-netty-shixianzijide-rpc-kuangjia/</guid><description>服务端开发都会或多或少的涉及到 RPC 的使用，当然如果止步于会用，对自己的成长很是不利，所以楼主今天本着知其然，且知其所以然的精神来探讨一下 RPC 这个东西。child-rpc 采用 socket 直连的方式来实现服务的远程调用，然后使用 jdk 动态代理的方式让调用者感…</description></item><item><title>高性能无锁队列 Disruptor 初体验</title><link>https://haifeiWu.github.io/posts/gaoxingnengwusuoduilie-disruptor-chutiyan/</link><pubDate>Thu, 16 Aug 2018 08:26:03 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/gaoxingnengwusuoduilie-disruptor-chutiyan/</guid><description>最近一直在研究队列的一些问题，今天楼主要分享一个高性能的队列 Disruptor。它是英国外汇交易公司 LMAX 开发的一个高性能队列，研发的初衷是解决内存队列的延迟问题。基于 Disruptor 开发的系统单线程能支撑每秒600万订单。目前，包括 Apache Stor…</description></item><item><title>炮打 TCP – 关于一而再再而三的粘包拆包问题的大字报</title><link>https://haifeiWu.github.io/posts/paodatcp-guanyuyierzaizaiersandezhanbaochaibaowentidedazibao/</link><pubDate>Fri, 10 Aug 2018 16:44:00 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/paodatcp-guanyuyierzaizaiersandezhanbaochaibaowentidedazibao/</guid><description>TCP 所谓的粘包和拆包问题，是技术圈里最奇葩的问题之一！一而再，再而三，就跟傻逼的中国球迷支持中国足球队一样，前赴后继。有时候同一个人多次在犯同一个错误，有时候是前脚一个犯错了后脚又来一个还犯同样的错。</description></item><item><title>Netty 源码中对 Redis 协议的实现</title><link>https://haifeiWu.github.io/posts/netty-yuanmazhongdui-redis-xieyideshixian/</link><pubDate>Thu, 09 Aug 2018 08:13:02 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/netty-yuanmazhongdui-redis-xieyideshixian/</guid><description>近期一直在做网络协议相关的工作，所以博客也就与之相关的比较多，今天楼主结合 Redis 的协议 RESP 看看在 Netty 源码中是如何实现的。RESP 是 Redis 序列化协议的简写。它是一种直观的文本协议，优势在于实现非常简单，解析性能极好。Redis 协议将传输的结…</description></item><item><title>Redis 协议规范（译文）</title><link>https://haifeiWu.github.io/posts/redisxieyiguifan-yiwen/</link><pubDate>Wed, 08 Aug 2018 00:57:50 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/redisxieyiguifan-yiwen/</guid><description>Redis 客户端使用名为 RESP（Redis 序列化协议）的协议与 Redis 服务器进行通信。虽然该协议是专为 Redis 设计的，但它可以用于其他 CS 软件项目的通讯协议。RESP 可以序列化不同的数据类型，如整型，字符串，数组。还有一种特定的错误类型。请求将要执行的命令作为字符…</description></item><item><title>线上 ELK 集群健康值 red 状态问题排查与解决</title><link>https://haifeiWu.github.io/posts/xianshang-elk-jiqunjiankangzhi-red-zhuangtaiwentipaichayujie/</link><pubDate>Tue, 07 Aug 2018 12:31:09 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/xianshang-elk-jiqunjiankangzhi-red-zhuangtaiwentipaichayujie/</guid><description>之前一直运行正常的数据分析平台，最近一段时间没有注意发现日志索引数据一直未生成，大概持续了 n 多天，当前状态：单台机器，Elasticsearch（下面称 ES）单节点(空集群),1000+shrads, 约 200G 大小。查看 ES 集群健康值，发现 status 为 red，这…</description></item><item><title>聊聊 JDK 非阻塞队列源码（CAS 实现）</title><link>https://haifeiWu.github.io/posts/liaoliao-jdk-feizuseduilieyuanma-casshixian/</link><pubDate>Thu, 02 Aug 2018 14:23:33 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/liaoliao-jdk-feizuseduilieyuanma-casshixian/</guid><description>正如上篇文章聊聊 JDK 阻塞队列源码（ReentrantLock 实现）所说，队列在我们现实生活中队列随处可见，最经典的就是去银行办理业务，超市买东西排队等。今天楼主要讲的就是 JDK 中安全队列的另一种实现使用 CAS 算法实现的安全队列。</description></item><item><title>聊聊 JDK 阻塞队列源码（ReentrantLock 版）</title><link>https://haifeiWu.github.io/posts/liaoliao-jdk-zuseduilieyuanma-reentrantlockban/</link><pubDate>Wed, 01 Aug 2018 10:14:44 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/liaoliao-jdk-zuseduilieyuanma-reentrantlockban/</guid><description>项目中用到了一个叫做 Disruptor 的队列，今天楼主并不是要介绍 Disruptor 而是想巩固一下基础扒一下 JDK 中的阻塞队列，听到队列相信大家对其并不陌生，在我们现实生活中队列随处可见，最经典的就是去银行办理业务等。</description></item><item><title>JDK 定时任务 Timer 与 ScheduledExecutorService 排坑记录</title><link>https://haifeiWu.github.io/posts/jdk-dingshirenwu-timer-yu-scheduledexecutorservice-paikengji/</link><pubDate>Wed, 18 Jul 2018 19:12:40 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/jdk-dingshirenwu-timer-yu-scheduledexecutorservice-paikengji/</guid><description>正在认真敲代码的楼主，突然收到数据维护系统发过来的报警邮件说楼主凌晨跑的定时任务没有成功，于是便开始了楼主今天的找坑填坑的过程。</description></item><item><title>TCP 粘包问题浅析及其解决方案</title><link>https://haifeiWu.github.io/posts/tcp-zhanbaowentiqianxijiqijiejuefangan/</link><pubDate>Mon, 16 Jul 2018 18:58:07 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/tcp-zhanbaowentiqianxijiqijiejuefangan/</guid><description>最近一直在做中间件相关的东西，所以接触到的各种协议比较多，总的来说有 TCP，UDP，HTTP 等各种网络传输协议，因此楼主想先从协议最基本的 TCP 粘包问题搞起，把计算机网络这部分基础夯实一下。</description></item><item><title>I-team 博客全文检索 Elasticsearch 实战</title><link>https://haifeiWu.github.io/posts/i-team-bokequanwenjiansuo-elasticsearch-shizhan/</link><pubDate>Thu, 12 Jul 2018 16:26:02 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/i-team-bokequanwenjiansuo-elasticsearch-shizhan/</guid><description>一直觉得博客缺点东西，最近还是发现了，当博客慢慢多起来的时候想要找一篇之前写的博客很是麻烦，于是作为后端开发的楼主觉得自己动手丰衣足食，也就有了这次博客全文检索功能 Elasticsearch 实战，这里还要感谢一下‘辉哥’赞助的一台服务器。</description></item><item><title>阿里云离线同步工具 DataX 源码略读</title><link>https://haifeiWu.github.io/posts/aliyunlixiantongbugongjudataxyuanmalvedu/</link><pubDate>Fri, 06 Jul 2018 10:47:57 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/aliyunlixiantongbugongjudataxyuanmalvedu/</guid><description>最近在做一些数据迁移相关工作，并最终采用了 DataX，楼主也本着知其然，也要知其所以然的精神粗略的看一看 Datax 的源码。</description></item><item><title>阿里离线数据同步工具 DataX 踩坑记录</title><link>https://haifeiWu.github.io/posts/alilixianshujutongbugongju-datax-caikengjilu/</link><pubDate>Wed, 04 Jul 2018 22:33:38 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/alilixianshujutongbugongju-datax-caikengjilu/</guid><description>最近在做一些数据迁移相关工作，调研了一些工具，发现 DataX 是个不错的东西，所以安利给大家。那么 DataX 是什么呢？DataX 是阿里巴巴集团内被广泛使用的离线数据同步工具，实现包括 MySQL、SQL Server、Oracle、PostgreSQL 等各种异构数据源的同步</description></item><item><title>golang 重构博客统计服务</title><link>https://haifeiWu.github.io/posts/golangzhonggouboketongjifuwu/</link><pubDate>Mon, 25 Jun 2018 18:13:12 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/golangzhonggouboketongjifuwu/</guid><description>作为一个后端开发，在 Docker，etcd，k8s 等新技术不断涌现的今天，其背后的功臣 golang 在语言排行榜上持续走高，因此楼主也就开了这次使用 golang 自己开发的基础功能的二次装逼之旅。</description></item><item><title>Netty 实战之第一个应用</title><link>https://haifeiWu.github.io/posts/nettyshizhanzhidiyigeyingyong/</link><pubDate>Thu, 21 Jun 2018 20:09:37 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/nettyshizhanzhidiyigeyingyong/</guid><description>作为一个正在 Java 路上摸爬滚打的小菜鸡，之前在项目中也用过 Netty，也因为 Netty 报名阿里的中间件大赛，但终究功力太浅，最终不了了之，最近工作中又遇到了 Netty 的小姐妹 Mina。此时楼主觉得 Netty 还是需要潜心深入学习一下。</description></item><item><title>使用 Spring Boot 实现博客统计服务</title><link>https://haifeiWu.github.io/posts/shiyongspring-bootshixianboketongjifuwu/</link><pubDate>Tue, 19 Jun 2018 14:53:42 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/shiyongspring-bootshixianboketongjifuwu/</guid><description>作为一个后端开发，在微服务，server mesh 等概念满天飞的时代，持续学习能力是不能丢的。此外，楼主博客的阅读统计功能是用的是与 HEXO 相匹配的第三方的数量统计功能，也就诞生了楼主这次更换成自己开发的基础功能的装逼之旅。</description></item><item><title>I-team 博客的 gitlab-runner 持续集成实践</title><link>https://haifeiWu.github.io/posts/i-teambokedegitlab-runnerchixujichengshijian/</link><pubDate>Sun, 10 Jun 2018 23:34:27 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/i-teambokedegitlab-runnerchixujichengshijian/</guid><description>作为一个略微看过 nodejs 语法，但又不懂 nodejs 的攻城狮，搭建 Hexo 环境很是麻烦，要考虑到翻墙、版本兼容等问题。于是乎，博主每换一个电脑，为了能继续发博客，都需要在新电脑上花一天时间重新搞一下 Hexo 环境，楼主感觉还是有简洁的方案来实现我一提交代码就可以自动发布博客。</description></item><item><title>阿里 RPC 框架 Dubbo 初体验</title><link>https://haifeiWu.github.io/posts/ali-rpc-kuangjia-dubbo-chutiyan/</link><pubDate>Thu, 07 Jun 2018 23:11:29 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/ali-rpc-kuangjia-dubbo-chutiyan/</guid><description>最近研究了一下阿里开源的分布式 RPC 框架 Dubbo，楼主写了一个 demo，体验了一下 Dubbo 的功能。</description></item><item><title>死磕 Java 之聊聊 HashMap 源码(基于 JDK1.8)</title><link>https://haifeiWu.github.io/posts/sikejavazhiliaoliaohashmapyuanma-jiyujdk1-8/</link><pubDate>Mon, 04 Jun 2018 23:07:24 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/sikejavazhiliaoliaohashmapyuanma-jiyujdk1-8/</guid><description>HashMap 是 Java 程序员使用频率最高的数据结构之一。另外，JDK1.8 对 HashMap 底层的实现进行了优化，如引入红黑树的数据结构以及扩容的优化等等来提高性能。本文结合 JDK1.8 的源码，探讨 HashMap 的结构实现和功能原理。</description></item><item><title>聊聊 HashSet 源码</title><link>https://haifeiWu.github.io/posts/liaoliaohashsetyuanma/</link><pubDate>Tue, 29 May 2018 23:18:49 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/liaoliaohashsetyuanma/</guid><description>今天聊一下 HashSet 源码，HashSet 内部基本使用 HashMap 来实现，本博客将通过一下几个方向讲解。</description></item><item><title>classpath* 和 classpath 使用遇到的问题</title><link>https://haifeiWu.github.io/posts/classpath-he-classpathshiyongyudaodewenti/</link><pubDate>Thu, 24 May 2018 22:00:41 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/classpath-he-classpathshiyongyudaodewenti/</guid><description>在 Spring 配置 mybatis 的时候需要加载 mybatis 的多个相关配置文件，其中 mybatis 的 mapper 对应的 XML 通常放在其他的 jar 包中，mybatis-conf 文件通常在当前工程中，so，也就引出了今天遇到的问题，那么 classpath* 和 classpath 到底</description></item><item><title>死磕 Java 之聊聊 ThreadLocal 源码(基于 JDK1.8)</title><link>https://haifeiWu.github.io/posts/sikejavazhiliaoliaothreadlocalyuanma-jiyujdk1-8/</link><pubDate>Wed, 09 May 2018 22:15:42 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/sikejavazhiliaoliaothreadlocalyuanma-jiyujdk1-8/</guid><description>记得在一次面试中被问到 ThreadLocal，答得马马虎虎，所以打算研究一下 ThreadLocal 的源码 面试官：用过 ThreadLocal 吗？楼主答：用过，当时使用 ThreadLocal 的时候，使用 Spring 实现横切整个 Controller 层，使用 ThreadL…</description></item><item><title>多应用配置管理平台 LIGHTCONF</title><link>https://haifeiWu.github.io/posts/duoyingyongpeizhiguanlipingtailightconf/</link><pubDate>Mon, 07 May 2018 20:42:14 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/duoyingyongpeizhiguanlipingtailightconf/</guid><description>LIGHTCONF 是一个配置管理平台，其核心设计目标是“为业务提供统一的配置管理服务”。</description></item><item><title>死磕 Java 之聊聊 LinkedList 源码(基于 JDK1.8)</title><link>https://haifeiWu.github.io/posts/sikejavazhiliaoliaolinkedlistyuanma-jiyujdk1-8/</link><pubDate>Sun, 06 May 2018 23:09:50 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/sikejavazhiliaoliaolinkedlistyuanma-jiyujdk1-8/</guid><description>工作快一年了，近期打算研究一下 JDK 的源码，也就因此有了死磕 Java 系列</description></item><item><title>聊聊 ArrayList 源码(基于 JDK1.8)</title><link>https://haifeiWu.github.io/posts/liaoliaoarraylistyuanma-jiyujdk1-8/</link><pubDate>Fri, 04 May 2018 21:44:37 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/liaoliaoarraylistyuanma-jiyujdk1-8/</guid><description>工作快一年了，近期打算研究一下 JDK 的源码 ArrayList 是一个数组队列，相当于动态数组。与 Java 中的数组相比，它的容量能动态增长。它继承于 AbstractList，实现了 List, RandomAccess, Cloneable, java.io.Serializab…</description></item><item><title>复杂业务下向 MySQL 导入 30万条数据代码优化的踩坑记录</title><link>https://haifeiWu.github.io/posts/fuzayewuxiaxiangmysqldaoru30wantiaoshujudaimayouhuadecaikeng/</link><pubDate>Mon, 23 Apr 2018 21:37:17 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/fuzayewuxiaxiangmysqldaoru30wantiaoshujudaimayouhuadecaikeng/</guid><description>另外，在 information_schema 下面有三张表：INNODB_TRX、INNODB_LOCKS、INNODB_LOCK_WAITS（解决问题方法），通过这三张表，可以更简单地监控当前的事务并分析可能存在的问题。kill 进程 ID，发生上面错误的根本原因在业务逻辑代码…</description></item><item><title>自建脚手架之配置中心--LightConf 的实现</title><link>https://haifeiWu.github.io/posts/zijianjiaoshoujiazhipeizhizhongxin-lightconfdeshixian/</link><pubDate>Sun, 22 Apr 2018 18:39:29 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/zijianjiaoshoujiazhipeizhizhongxin-lightconfdeshixian/</guid><description>在经历了一个多月的开发后，项目的第一个稳定版本终于完成，开源地址https://github.com/haifeiWu/lightconf，欢迎各路大神star，拍砖。 LIGHTCONF 使用了 Netty 实现底层通讯，保证配置的实时生效。接入 LIGHTCONF 事只需要添加 mav…</description></item><item><title>测试环境服务器硬盘塞满问题排查</title><link>https://haifeiWu.github.io/posts/ceshihuanjingfuwuqiyingpansaimanwentipaicha/</link><pubDate>Mon, 12 Mar 2018 18:06:57 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/ceshihuanjingfuwuqiyingpansaimanwentipaicha/</guid><description>某天下午测试环境服务器出现 tab 无法补全命令，给出的提示大概意思就是说，无可用空间无法创建临时文件，不过这次跟上次出现的问题比较像，上次服务器出现的问题，因此楼主判断可能是服务器数据盘被占满，果不其然，使用 df -h 命令看到服务器数据盘出现 100%被占用的情况。楼主首先想到的…</description></item><item><title>Java 命令之 javap 初探</title><link>https://haifeiWu.github.io/posts/javaminglingzhijavapchutan/</link><pubDate>Mon, 26 Feb 2018 13:27:15 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/javaminglingzhijavapchutan/</guid><description>下面列举 javap 命令的常用 options 及其功能描述，更多功能的使用请自行 Google，楼主不做赘述。javap 命令分解一个 class 文件，它根据 options 来决定到底输出什么。如果没有使用 options,那么 javap 将会输出该 class 文件中的包，类里的 protect…</description></item><item><title>Java 实现终止线程池中正在运行的定时任务</title><link>https://haifeiWu.github.io/posts/javashixianzhongzhixianchengchizhongzhengzaiyunxingdedingshi/</link><pubDate>Wed, 17 Jan 2018 20:35:01 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/javashixianzhongzhixianchengchizhongzhengzaiyunxingdedingshi/</guid><description>最近项目中遇到了一个新的需求，就是实现一个可以动态添加定时任务的功能。说到这里，有人可能会说简单啊，使用 quartz 就好了，简单粗暴。然而 quartz 框架太重了，小项目根本不好操作啊。当然，也有人会说，jdk 提供了 timer 的接口啊，完全够用啊。但是我们项目的需求完全是多线程的…</description></item><item><title>线上问题解决及 shell 脚本实现自动保留最近 n 次备份记录</title><link>https://haifeiWu.github.io/posts/xianshangwentijiejuejishelljiaobenshixianzidongbaoliuzuijinn/</link><pubDate>Fri, 08 Dec 2017 20:12:19 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/xianshangwentijiejuejishelljiaobenshixianzidongbaoliuzuijinn/</guid><description>某天上午服务器出现卡顿特别严重，页面加载速度奇慢，并且某些页面刷新出现 404 的问题，就连服务器的 tab 命令的自动提示都出现了问题，楼主费了九牛二虎之力，根据服务器排查发现，服务器数据盘出现 100%被占用的问题，导致该问题出现的原因是，Jenkins 每次部署服务器的时候，都会自动…</description></item><item><title>Spring aop 实现权限管理</title><link>https://haifeiWu.github.io/posts/spring-aopshixianquanxianguanli/</link><pubDate>Wed, 06 Dec 2017 19:45:36 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/spring-aopshixianquanxianguanli/</guid><description>最近项目中需要做一个权限管理模块，按照之前同事的做法是在 controller 层的每个接口调用之前上做逻辑判断，这样做也没有不妥，但是代码重复率太高，而且是体力劳动，so，便有了如题所说的使用 Spring aop 做一个切点来实现通用功能的权限管理，这样也就降低了项目后期开发的可扩…</description></item><item><title>基于 JMeter 的压测工具的实现</title><link>https://haifeiWu.github.io/posts/jiyu-jmeterdeyacegongjudeshixian/</link><pubDate>Sun, 05 Nov 2017 19:54:39 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/jiyu-jmeterdeyacegongjudeshixian/</guid><description>在界面中选择对应的选项卡：（目前只支持 HTTP 模板，自定义脚本上传，测试相应结果两个选项卡），HTTP 模板是根据页面选择的参数生成 jmx 文件，自定义脚本是用户直接上传 jmx 脚本。下图是执行脚本的页面，在页面中可以选择在本地执行与在远程机执行（远程机执行是指在 3 台机器上同步执行…</description></item><item><title>扒一扒 Spring，dom4j 实现模拟实现读取 XML</title><link>https://haifeiWu.github.io/posts/bayibaspring-dom4jshixianmonishixianduquxml/</link><pubDate>Wed, 23 Aug 2017 20:38:56 +0800</pubDate><author>whfstudio@163.com (haifeiWu)</author><guid>https://haifeiWu.github.io/posts/bayibaspring-dom4jshixianmonishixianduquxml/</guid><description>今天 leadr 提出需求，原来公司项目中读取解析 XML 文件的代码效率太低，考虑切换一种 XML 为数据封装格式与读取方式以提高效率。我这灵机一动 Spring 对 bean 的依赖注入就是读取 XML 文件，可以尝试扒一扒 Spring 的源码，来实现一个轻量级的方案。重构 XML 文件，向 sprin…</description></item></channel></rss>