- 博客(11)
- 资源 (6)
- 收藏
- 关注
原创 RocketMQ源码初识一 NameServer源码
名字服务 Name Server官方doc中描述nameServer大概用到的模块源码总结代码流程图源代码mai方法createNamesrvControllerOptions与PosixParserNamesrvController构造函数RouteInfoManager构造函数start(controller);初始化controller.initializeDefaultRequestProcessorNettyRemotingServer构造函数(remoting模块)scanNotActiveBr
2020-12-18 15:09:02 572
原创 Redis源码初识七 intset数据结构
intset-整数集合介绍数据结构源码字段含义升级 介绍 有序的整数集合,可存储int16_t、int32_t、int64_t类型数据,数据不会重复 数据结构 源码 typedef struct intset { uint32_t encoding; uint32_t length; int8_t contents[]; } intset; 字段含义 字段 含义 encoding 数组中的值的编码方式INTSET_ENC_INT16:2^15 -1 (最小-327
2020-12-15 14:09:57 141
原创 Redis源码初识六 跳表(skiplist)数据结构
skiplist普通链表优化,提取一层索引层出来继续提取,第二层索引redis实际使用源码定义 普通链表 如图所示,链表从小到大排序 缺点:如果想在链表中查询到44,需要从头开始遍历,时间复杂度是o(n) 优化,提取一层索引层出来 如图所示,每隔一个元素,提取一个索引 第一层索引数=N/2,搜索次数缩小一半 继续提取,第二层索引 第二层索引数=N/2^2 搜索次数再次缩小一半 增加索引后查找效果与平衡树相同,时间复杂度O(logN) 缺点:每次添加新的元素,需要全部重新提取索引 redis实际使用 不
2020-12-15 11:06:23 161
原创 Redis源码初识一 常用函数介绍
类型 常用操作 作用 应用场景 字符串string set key value 保存键值 键值对 mset key value [key value ...] 批量保存键值 键值对 setnx key value 没有键时才存入 分布式锁 get key 根据key获取值 mget key [key ...] 批量获取值 incr key key存储的值加1 ...
2020-12-15 10:25:37 135
原创 Redis源码初识五 dict数据结构
字典(dict)数据结构源码字段含义 数据结构 源码 字典 typedef struct dict { dictType *type; void *privdata; dictht ht[2]; long rehashidx; /* rehashing not in progress if rehashidx == -1 */ unsigned long iterators; /* number of iterators currently running */ }
2020-12-14 18:12:24 149
原创 Redis源码初识三 RedisObject
RedisObjectRedisObjectserver.h(源码)字段含义不同类型,用到的数据结构扩展(字符串embstr)object.c源码 RedisObject redis所有类型,key都是sds存储,value都是对应redisOjbect server.h(源码) typedef struct redisObject { unsigned type:4; unsigned encoding:4; unsigned lru:LRU_BITS; /* LRU time (
2020-12-14 16:50:27 179
原创 Redis源码初识二 字符串数据结构
SDSsdssds.h(源码)sds存储结构如图字段含义总结redis为什么使用sds而不使用c语言自带的字符串: sds 名称:简单动态字符串(simple dynamic string,SDS ) 所有数据类型中都有用到此数据结构 所有类型的key,都是此类型数据结构 sds.h(源码) struct __attribute__ ((__packed__)) sdshdr5 { unsigned char flags; /* 3 lsb of type, and 5 msb of string
2020-12-14 14:26:20 67
原创 Spring源码初识三 Spring开始源码阶段
Spring源码使用JavaConfig方式运行Spring构造函数代码分析前两行代码无参构造函数创建bean定义读取器register(componentClasses)方法refres方法,spring核心方法1、2、3、4、5、6、7、8、9、10、11、12、13、 使用JavaConfig方式运行Spring 代码如下 public class SpringApplication { public static void main(String[] args) { //注解方式启
2020-12-11 18:25:17 121
原创 Spring源码初识二 Spring体系与各个模块含义
Spring体系架构(基于4.x) rg.springframework.beans 和 org.springframework.context 是实现Spring IOC容器框架的基础. BeanFactory 接口提供了一种更先进的配置机制来管理任意类型的对象. ApplicationContext 是BeanFactory的子接口. 他提供了: 更容易与Spring的AOP特性集成 消息资源处理(用于国际化) 事件发布 应用层特定的上下文,如用于web应用程序的WebApplicationContex
2020-12-10 18:02:25 134 1
原创 Spring源码初识一 Spring项目搭建与使用
官网地址:https://github.com/spring-projects/spring-framework 中文文档:https://github.com/DocsHome/spring-docs/blob/master/SUMMARY.md 家族清单:https://spring.io/projects Spring项目搭建与使用一、第一个spring项目(Xml方式)1、引入pom文件2、添加bean对应类3、在resources下添加services.xml4、写main方法5、查看运行效果二、
2020-12-08 14:04:42 182
使用Microsoft.Office.Interop.PowerPoint调用代码操作PPT
2023-06-19
maven+spring mvc+hibernate+dubbo+velocity+mysql的demo源码
2017-12-11
maven+spring mvc+hibernate+dubbo+mysql的demo源码
2017-12-11
maven+spring mvc+hibernate+dubbo的demo
2017-12-11
ViewFlow,一个滑动效果库,类似于标题切换,导航切换
2014-03-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人