public interface MaintenanceOperation
Represents a maintenance operation performed on a HyperGraph database. Such operations are presumed potentially very long and therefore should run in isolation, while there's no other activity being performed on the database. In addition, such operations must be resilient in case of interruption. They are like long, high-level transactions that are expected to eventually complete. Completion doesn't necessarily mean success, but the operation should guarantee a consistent, non-corrupted data once it's finished.
MaintenanceOperations are created and scheduled to run upon the next time
the HyperGraph is opened. This is done simply by adding an instance of this interface
as a HyperGraph atom. HyperGraph will detect and run all maintenance operations the next
time it is open. It is also possible to skip and/or cancel scheduled maintenance operations
by setting the appropriate startup flags in the
to open a database.
In case of interruption (an abrupt program exit) that occurs during a maintenance operation, the implementation is responsible to resume work where it left before. HyperGraph will ensure that multiple scheduled maintenance operations are executed in the same order as they were added.
It is possible to force execution of all scheduled maintenance operation at any point in time
by calling the
HyperGraph.runMaintenance() method. However, an application must
make sure that no other threads are accessing the database and potentially causing inconsistent
or corrupted data.
Copyright © 2015. All rights reserved.