predis client class分析
来源:互联网 发布:深圳飞扬数码通讯淘宝 编辑:程序博客网 时间:2024/05/29 09:37
Client-> construct
construct -> options, connection, profile, getClientFor->getConnectionById
connection-> connections->create, getConnectionInitializerWrapper/initializer, connections->aggregate->Factory
_call -> executeRaw , createCommand/executeCommand->parseResponse,onErrorResponse(重试逻辑)
ClientContextInterface
pipeline, transaction -> sharedContextFactory, createPipeline / createTransaction
pubSubLoop -> sharedContextFactory, createPubSub->PubSubConsumer
monitor -> MonitorConsumer
重点类
Client 客户端封装类
Options 配置封装类
AbstractConnection 连接类(StreamConnection)->NodeConnectionInterface
AggregateConnectionInterface 组合交互连接
集群交互类(aggregate)
RedisCluster->ClusterStrategy->RedisStrategy(Command->Slot)
PredisCluster->ClusterStrategy->PredisStrategy
SentinelReplication->MaterSlaveReplication->ReplicationStrategy
命令抽象类
Command
功能特性类
Pipeline
Transaction
PubSub
Monitor
辅助类
Cluster Replication 集群策略类
Collection Redis数据结构辅助类
Profile Redis版本信息类
Response 结果处理工具类
协议扩展类
Protocol
RedisCluster类分析
负责处理Redis集群节点的连接管理
sentinel重点关注
SentinelReplication
ReplicationStrategy
接口数据结构分析
client 初始化: options->connections->ReplicationOption->SentinelReplication
建立连接:client->connection(=>SentinelReplication)
->current(getmaster/pickslave=>StreamConnection)->connect()->stream_socket_client();
普通命令:createCommand : client->profile(redisprofile)->createCommand=>Command
executeCommand: client->connection(=>SentinelReplication)
->getConnection(=>StreamConnection)->writeRequest/readResponse
组合命令:pipeline/transaction/PubSubConsumer/MonitorConsumer 共同继承ClientContextInterface
pipeline(callback)-> [pipeline->enqueue()] / executePipeline-> for(writeRequest) / for(readResponse)
哨兵模式:
SentinelReplication:参数sentinels(哨兵地址)和service(实例名称)
工厂类Factory用于创建连接类StreamConnection
策略类ReplicationStrategy用于选择连接节点,辅助判断读写分离
sentinel参数-》sentinel连接-》current/master/slave信息-》校验ROLE-》node连接-》访问数据
- predis client class分析
- laravel 问题 Class 'Predis\Client' not found
- predis
- Predis
- zookeeper client分析
- Zookeeper C Client分析
- openstack client代码分析
- MR2 client 代码分析
- zookeeper client分析 ***********************8
- neutron client源码分析
- OpenStack client 调用分析
- zookeeper源码分析-client分析
- A simple IOCP Server/Client Class
- A simple IOCP Server/Client Class
- A simple IOCP Server/Client Class
- 《A Simple IOCP Server/Client Class》整改
- 《A Simple IOCP Server/Client Class》整改
- A simple IOCP Server/Client Class
- 单例模式的5种JAVA实现
- 微博@传媒老跟班 年度资源汇总(2014已更新完毕,2015持续更新中,网盘资源除外)
- mfc list control 用法
- JVM-类型的生命周期
- JVM-对象的生命周期
- predis client class分析
- JVM-线程同步
- JVM-典型的垃圾收集器
- 103. Binary Tree Zigzag Level Order Traversal
- JVM-常量池
- JVM-java字符编码
- 专利
- 如何判断网站被百度降权?
- JS异步执行