The Archiver class in archiver.py defines the methods to manage the device attributes archiving allowed by Tango.
The main components (and the relative Docker containers) are:
- Configuration Manager (container: hdbpp-cm): Device server that assists in adding, modifying, moving, deleting an Attribute to/from the archiving system
- Event Subscriber (container: hdbpp-es): The EventSubscriber TANGO device server, is the archiving system engine. On typical usage, it will subscribe to archive events on request by the ConfigurationManager device. The EventSubscriber is designed to start archiving all the already configured Attributes, even if the ConfigurationManager is not running. Moreover, being a TANGO device, the EventSubscriber configuration can be managed with Jive.
- Archiving DBMS (container: archiver-maria-db): Specific Database devoted to storing attribute values.
- (Optional) HDB++ Viewer (container: hdbpp-viewer): Standalone JAVA application designed to monitor signals coming from database
## Archiver creation
When an Archiver object is created, we can define three of its properties:
- the ConfigurationManager name (Tango namespace)
- at least one EventSubscriber name (Tango namespace)
- the default context archiving for the subscribers. This means that a default archiving strategy will be applied to
all the attributes. Of course this strategy can be tuned individually for each attribute if needed.
Archiving strategies are ['ALWAYS','RUN','SHUTDOWN','SERVICE']
- ALWAYS:always stored
- RUN:stored during run
- SHUTDOWN:stored during shutdown
- SERVICE:stored during maintenance activities
## Add an attribute
When adding an attribute to the archiving framework, we must define the following properties:
- the EventSubscriber name that will take charge of the attribute
- the archiving strategy (4 options defined above)
- the attribute polling period (it should have been already defined in TangoDB)
- the archive event period (MOST IMPORTANT, it defines the frequency rate at which an attribute is archived in the DBMS)
It is important to understand that, when an attribute is successfully added to the EventSubscriber list, the archiving begins without an explicit 'Start' command, rather it follows the archiving strategy already defined.
The 'Start' command is used instead during a session when an attribute has been paused/stopped for any reason, or it has raised some kind of issue.
## Difference between Stop and Remove an attribute
When stopping an attribute archiving, the framework does not remove it from the list.
This means that archiving is stopped for the current session, but if the device is restarted, the attribute archiving will be restarted as well.
In order to definitely stop the archiving, the attribute must be removed from the attribute list.
## Update an attribute
If we want to update the archiving properties of an attribute (e.g. the archive event period), there is a relative method.
It must be noted that the updating is not istantaneous because, following the framework architecture, an attribute must be first removed from the EventSubscriber list and then re-added with the new properties.