AnY11
码龄13年
关注
提问 私信
  • 博客:194,564
    194,564
    总访问量
  • 109
    原创
  • 1,689,833
    排名
  • 21
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:北京市
  • 加入CSDN时间: 2011-11-13
博客简介:

AnY11的专栏

查看详细资料
个人成就
  • 获得19次点赞
  • 内容获得22次评论
  • 获得89次收藏
创作历程
  • 16篇
    2021年
  • 60篇
    2019年
  • 80篇
    2018年
成就勋章
TA的专栏
  • Spring Cloud Netflix
    14篇
  • Netty
    27篇
  • RabbitMQ
    16篇
  • Spring Amqp
    9篇
  • SpringCloud
    2篇
  • MQTT
    3篇
  • HBase
    1篇
  • springboot
    29篇
  • JAVA多线程
    1篇
  • spring
    25篇
  • Spring Session
    1篇
  • Spring Data Redis
    1篇
  • jvm
    4篇
  • Docker
    10篇
  • 设计模式
    18篇
  • elasticsearch
    11篇
创作活动更多

超级创作者激励计划

万元现金补贴,高额收益分成,专属VIP内容创作者流量扶持,等你加入!

去参加
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

PooledByteBuf分配及回收之十六AdaptiveRecvByteBufAllocator源码解析

AdaptiveRecvByteBufAllocator 决定了要分配的ByteBuf的容量。RecvByteBufAllocatorpublic interface RecvByteBufAllocator { //创建一个新的句柄。句柄提供实际操作并保留内部信息,这是预测最佳缓冲区容量所必需的。 Handle newHandle(); @Deprecated interface Handle { //创建一个新的接
原创
发布博客 2021.02.20 ·
398 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

PooledByteBuf分配及回收之十五PooledByteBuf的回收

父类AbstractReferenceCountedByteBuf初始化属性 static final long REFCNT_FIELD_OFFSET ReferenceCountUpdater.getUnsafeOffset(AbstractReferenceCountedByteBuf.class, "refCnt") AbstractReferenceCountedByteBuf类refCnt属性的偏移量 stat..
原创
发布博客 2021.02.03 ·
521 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之十四Recycler.Stack<T> 弹出对象

弹出对象 DefaultHandle<T> pop() { int size = this.size; //先判断size是否==0 if (size == 0) { //从WeakOrderQueue中扫出对象放入elements数组中 if (!scavenge()) { return null
原创
发布博客 2021.01.29 ·
212 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之十三Recycler.Stack<T> 压入对象

压入对象 void push(DefaultHandle<?> item) { Thread currentThread = Thread.currentThread(); if (threadRef.get() == currentThread) { // The current Thread is the thread that belongs to the Stack, we can tr
原创
发布博客 2021.01.29 ·
266 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之十二Recycler及基内部类初始化

Recycler属性属性 值 含义 static final Handle NOOP_HANDLE new Handle() { @Override public void recycle(Object object) { // NOOP }} static final AtomicInteger ID_GENERATOR new A..
原创
发布博客 2021.01.28 ·
246 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之十一ReferenceCountUpdater源码解析

对于更新的int字段:偶数=>“实际”引用计数为(refCnt >>> 1) 奇数=>“真实”引用计数为0(x&y)似乎相对于(x == y)昂贵。因此,此类在检查实时(偶数)引用计数时,在某些地方使用快速路径获取最常见的低值,例如:if (rawCnt == 2 || rawCnt == 4 || (rawCnt & 1) == 0) { ...构造方法与抽象方法protected ReferenceCountUpdater()...
原创
发布博客 2021.01.26 ·
489 阅读 ·
0 点赞 ·
1 评论 ·
1 收藏

PooledByteBuf分配及回收之十PoolChunkList源码解析

属性属性 含义 值 static final Iterator<PoolChunkMetric> EMPTY_METRICS 一个空的Iterator Collections.<PoolChunkMetric>emptyList().iterator() final PoolArena<T> arena PoolChunkList所属的PoolArena fi..
原创
发布博客 2021.02.03 ·
277 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之九分配普通型PooledByteBuf(未命中缓存场景)

先看分配微小型PooledByteBuf(未命中缓存场景)PoolArena的allocate(PoolThreadCache cache, PooledByteBuf<T> buf, final int reqCapacity)方法 private void allocate(PoolThreadCache cache, PooledByteBuf<T> buf, final int reqCapacity) { final int normCa.
原创
发布博客 2021.01.24 ·
234 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之八分配小型PooledByteBuf(未命中缓存场景)

先看上一篇分配微小型PooledByteBuf(未命中缓存场景)小型Capacity 大于等于512 并且小于 8192(pageSize) ~(8192 - 1) == -8192小型与微小型的差别在于获取PoolSubpage的不同,小型是从PoolArena的smallSubpagePools数组中获取smallSubpagePools数组长度为4private void allocate(PoolThreadCache cache, PooledByteBuf<...
原创
发布博客 2021.01.24 ·
223 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之七分配微小型PooledByteBuf(未命中缓存场景)

微小型Capacity 小于512 Capacity & -512 == 0 代表微小型小型Capacity 大于512 并且小于 8192(pageSize) ~(8192 - 1) == -8192 Capacity & -8192 == 0 代表小型PooledByteBufAllocator的newDirectBuffer方法 @Override protected ByteBuf newDirectBuffer(int init...
原创
发布博客 2021.01.24 ·
393 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之六PooledUnsafeDirectByteBuf初始化

final class PooledUnsafeDirectByteBuf extends PooledByteBuf<ByteBuffer>PooledByteBuf的属性属性 含义 值 private final Handle<PooledByteBuf<T>> recyclerHandle 回收处理句柄 这里的T是ByteBuffer protected...
原创
发布博客 2021.01.24 ·
6399 阅读 ·
0 点赞 ·
2 评论 ·
0 收藏

PooledByteBuf分配及回收之五PoolSubpage初始化

属性属性 含义 值 final PoolChunk<T> chunk 所属chunk private final int memoryMapIdx 在chunk的memoryMap数组中的下标 通过下标能确认在memoryMap这个堆的哪个节点 private final int runOffset 相对于chunk offset的偏移量 标明...
原创
发布博客 2021.01.24 ·
233 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之四PoolChunk初始化

属性属性 含义 值 private static final int INTEGER_SIZE_MINUS_ONE 32-1 Integer.SIZE - 1 = 31 final PoolArena<T> arena 所属的区域 final T memory 申请的内存,根据HAS_UNSAFE的结果可分为ByteBuffer和byte[] ...
原创
发布博客 2021.01.24 ·
314 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之三PoolAerna初始化

属性含义及初始值 属性 含义 值 static final boolean HAS_UNSAFE 是否有UNSAFE PlatformDependent.hasUnsafe() static final int numTinySubpagePools 微小子页池中页的数量 512 >>> 4 也就是32 final PooledByteBufAllocator p.
原创
发布博客 2021.01.24 ·
296 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之二PoolThreadCache初始化

构造方法PoolThreadCache(PoolArena<byte[]> heapArena, PoolArena<ByteBuffer> directArena, int tinyCacheSize, int smallCacheSize, int normalCacheSize, int maxCachedBufferCapacity, int freeSweepAllocationThres
原创
发布博客 2021.01.24 ·
291 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

PooledByteBuf分配及回收之一PooledByteBufAllocator初始化

接口ByteBufAllocator中定义了一个默认的ByteBufAllocator DEFAULT =ByteBufUtil.DEFAULT_ALLOCATOR,跟进去:​static final ByteBufAllocator DEFAULT_ALLOCATOR;static { //非安卓返回pooled String allocType = SystemPropertyUtil.get( "io.netty.allocator.type", ...
原创
发布博客 2021.01.24 ·
1109 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

自定义BeanDefinitionRegistryPostProcessor

转自:https://blog.csdn.net/liyantianmin/article/details/81047373
转载
发布博客 2019.07.15 ·
263 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

class.forname和classloader区别

转自:https://blog.csdn.net/m0_37284598/article/details/82950779Java中class是如何加载到JVM中的:1.class加载到JVM中有三个步骤 装载:(loading)找到class对应的字节码文件。 连接:(linking)将对应的字节码文件读入到JVM中。初始化:(initializing)对clas...
转载
发布博客 2019.07.12 ·
282 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

关于spring中的BeanDefinitionRegistryPostProcessor和ImportBeanDefinitionRegistrar接口

转自:https://blog.csdn.net/lichuangcsdn/article/details/89930945这两个接口都可以用于动态注册bean到容器中。BeanDefinitionRegistryPostProcessor实现了BeanFactoryPostProcessor接口,是Spring框架的BeanDefinitionRegistry的后处理器,用来注册额外的B...
转载
发布博客 2019.07.09 ·
732 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

EMQTT(EMQX) SSL/TLS单向认证及JAVA代码

采用部署架构安装NGINX安装EMQX引入JAR<dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.2...
原创
发布博客 2019.07.08 ·
3344 阅读 ·
0 点赞 ·
1 评论 ·
1 收藏
加载更多