文章目录
1 DataStore相关概念
- ODL社区实现的内存数据库,其存储的数据结构是由YANG定义的树状的结构
- 基于事务的访问与操作
- 支持数据变更通知
- 支持事务链
- DataStore is an intelligent in-memory cache with tree-like structures that would be able to track dependencies, calculate change sets and maintain the relationships between commit handlers, notification listeners and the actual data.)
几个基本概念
- Data Tree-All state-related data are modeled and represented as data tree, with possibility to address any element / subtree
- Operational Data Tree - Reported state of the system, published by the providers using MD-SAL. Represents a feedback loop for applications to observe state of the network / system.
- Configuration Data Tree - Intended state of the system or network, populated by consumers, which expresses their intention.
- Instance Identifier
- Unique identifier of node / subtree in data tree, which provides unambiguous information, how to reference and retrieve node / subtree from conceptual data trees.
- Transaction - MD-SAL Data Broker provides transactional access to conceptual data trees representing configuration and operational state.
2 DataStore基于简单事务的读写操作
2.1 访问DataStore
<reference id="dataBroker"
interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"
odl:type="default" />
获取到OSGI的DataBroker服务接口
2.2 DataBroker服务接口
public interface DataBroker extends DataTreeChangeService {
ReadOnlyTransaction newReadOnlyTransaction(

本文档详细介绍了OpenDaylight中的DataStore概念,包括DataTree、OperationalDataTree和ConfigurationDataTree等。文章重点阐述了基于事务的读写操作,如ReadOnlyTransaction和WriteTransaction的使用,并讨论了DataStore的数据变更通知机制。此外,还探讨了事务链的设计初衷、实现原理及其实现接口。最后,提供了实践练习,涉及监听网络设备状态和通过写库方式下发流表规则。
最低0.47元/天 解锁文章
&spm=1001.2101.3001.5002&articleId=120787461&d=1&t=3&u=31c1ae3d133f4c0ab2ba8a814351b04c)
1142

被折叠的 条评论
为什么被折叠?



