Class ArchiveEngine
java.lang.Object
org.epics.archiverappliance.engine.ArchiveEngine
This class provides the static methods:
- create channel
- get pv meta data before archiving this pv
- pause archiving pv
- resume archiving pv
- get metics of one pv
- change the archival parameter of one pv
- destory pv
- Author:
- Luofeng Li
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidarchivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, boolean usePVAccess, boolean useDBEProperties) static voidarchivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String[] metaFieldNames, boolean usePVAccess, boolean useDBEProperties) static voidarchivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String controllingPVName, boolean usePVAccess, boolean useDBEProperties) static voidarchivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String controllingPVName, String[] metaFieldNames, String iocHostName, boolean usePVAccess, boolean useDBEProperties) Create a new channel in monitor mode or in scan modestatic voidchangeArchivalParameters(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, ConfigService configservice, Writer writer, boolean usePVAccess, boolean useDBEPropeties) change pv's sample period or sample modestatic voiddestoryPv(String pvName, ConfigService configservice) destroy the pvstatic voidgetArchiveInfo(String pvName, ConfigService configservice, String[] metadatafields, boolean usePVAccess, MetaCompletedListener metaListener) Get the meta data for pv - used for policy computation.static voidgetLowLevelStateInfo(String pvName, ConfigService configservice, LinkedList<Map<String, String>> statuses) Return info from CAJstatic PVMetricsgetMetricsforPV(String pvName, ConfigService configservice) get the pv's info and statusstatic voidpauseArchivingPV(String pvName, ConfigService configservice) pause the pvstatic voidresumeArchivingPV(String pvName, ConfigService configservice) restart the pvstatic voidresumeArchivingPV(String pvName, ConfigService configservice, Writer writer) restart the pvstatic voidstartChannelsForPV(String pvName, ConfigService configservice) Start up the channels for a PV.static voidstartChannelsForPV(String pvName, ConfigService configservice, PVTypeInfo typeInfo, Writer writer) Start up the channels for a PV.
-
Constructor Details
-
ArchiveEngine
public ArchiveEngine()
-
-
Method Details
-
getArchiveInfo
public static void getArchiveInfo(String pvName, ConfigService configservice, String[] metadatafields, boolean usePVAccess, MetaCompletedListener metaListener) throws Exception Get the meta data for pv - used for policy computation.- Parameters:
pvName- Name of the channel (PV)configservice- ConfigServicemetadatafields- other field such as MDEL,ADEL, except basical info in DBR_CTRLusePVAccess- Should we use PV access to connect to this PV.metaListener- the callback interface where you handle the info.- Throws:
Exception- On error in getting pv's info
-
archivePV
public static void archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String controllingPVName, boolean usePVAccess, boolean useDBEProperties) throws Exception - Parameters:
pvName- Name of the channel (PV)samplingPeriod- The minimal sample period for channel in scan mode. Attention: the same data with same value and timestamp is not saved again in scan mode. This period is meanlingless for channel in monitor mode.mode- scan or monitorwriter- First destinationconfigservice- ConfigServicearchdbrtype- Expected DBR type.lastKnownEventTimeStamp- Last known event from all the stores.controllingPVName- The PV that controls archiving for this PVusePVAccess- Should we use PVAccess to connect to this PV.useDBEProperties-- Throws:
Exception-
-
archivePV
public static void archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, boolean usePVAccess, boolean useDBEProperties) throws Exception - Parameters:
pvName- Name of the channel (PV)samplingPeriod- The minimal sample period for channel in scan mode. Attention: the same data with same value and timestamp is not saved again in scan mode. This period is meanlingless for channel in monitor mode.mode- scan or monitorwriter- First destinationconfigservice- ConfigServicearchdbrtype- Expected DBR type.lastKnownEventTimeStamp- Last known event from all the stores.usePVAccess- Should we use PVAccess to connect to this PV.useDBEProperties-- Throws:
Exception-
-
archivePV
public static void archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String[] metaFieldNames, boolean usePVAccess, boolean useDBEProperties) throws Exception - Parameters:
pvName- Name of the channel (PV)samplingPeriod- The minimal sample period for channel in scan mode. Attention: the same data with same value and timestamp is not saved again in scan mode. This period is meanlingless for channel in monitor mode.mode- scan or monitorwriter- First destinationconfigservice- ConfigServicearchdbrtype- Expected DBR type.lastKnownEventTimeStamp- Last known event from all the stores.metaFieldNames- An array of EPICS fields that gets stored along with the stream. Needs rethinking once we have EPICS V4usePVAccess- Should we use PVAccess to connect to this PV.useDBEProperties-- Throws:
Exception-
-
archivePV
public static void archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Instant lastKnownEventTimeStamp, String controllingPVName, String[] metaFieldNames, String iocHostName, boolean usePVAccess, boolean useDBEProperties) throws Exception Create a new channel in monitor mode or in scan mode- Parameters:
pvName- Name of the channel (PV)samplingPeriod- The minimal sample period for channel in scan mode. Attention: the same data with same value and timestamp is not saved again in scan mode. This period is meanlingless for channel in monitor mode.mode- scan or monitorwriter- First destinationconfigservice- ConfigServicearchdbrtype- Expected DBR type.lastKnownEventTimeStamp- Last known event from all the stores.controllingPVName- The PV that controls archiving for this PVmetaFieldNames- An array of EPICS fields that gets stored along with the stream. Needs rethinking once we have EPICS V4iocHostName- IOC hosting this PV; this is used for some optimization. This will often be null.usePVAccess- Should we use PVAccess to connect to this PV.useDBEProperties-- Throws:
Exception-
-
pauseArchivingPV
pause the pv- Parameters:
pvName- Name of the channel (PV)configservice- ConfigService- Throws:
Exception- error in pausing the channel .
-
resumeArchivingPV
restart the pv- Parameters:
pvName- Name of the channel (PV)configservice- ConfigService- Throws:
Exception- error in restarting the channel .
-
resumeArchivingPV
public static void resumeArchivingPV(String pvName, ConfigService configservice, Writer writer) throws Exception restart the pv- Parameters:
pvName- Name of the channel (PV)configservice- ConfigService- Throws:
Exception- error in restarting the channel .
-
startChannelsForPV
public static void startChannelsForPV(String pvName, ConfigService configservice) throws IOException, Exception Start up the channels for a PV. Should be called on startup or on resume of a PV that was paused on startup.- Parameters:
pvName- The Name of PV.configservice- ConfigService- Throws:
IOException-Exception-
-
startChannelsForPV
public static void startChannelsForPV(String pvName, ConfigService configservice, PVTypeInfo typeInfo, Writer writer) throws IOException, Exception Start up the channels for a PV. Should be called on startup or on resume of a PV that was paused on startup.- Parameters:
pvName- The Name of PV.configservice- ConfigService- Throws:
IOException-Exception-
-
getMetricsforPV
public static PVMetrics getMetricsforPV(String pvName, ConfigService configservice) throws Exception get the pv's info and status- Parameters:
pvName- Name of the channel (PV)configservice- ConfigService- Returns:
- PVMetrics
- Throws:
Exception- On error in getting the pv info and status .
-
getLowLevelStateInfo
public static void getLowLevelStateInfo(String pvName, ConfigService configservice, LinkedList<Map<String, String>> statuses) throws ExceptionReturn info from CAJ- Parameters:
pvName- The name of PV.configservice- ConfigServicestatuses- Add a list of key value pairs to the status- Throws:
Exception-
-
changeArchivalParameters
public static void changeArchivalParameters(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, ConfigService configservice, Writer writer, boolean usePVAccess, boolean useDBEPropeties) throws Exception change pv's sample period or sample mode- Parameters:
pvName- Name of the channel (PV)samplingPeriod- new sampling Period of the channel (PV)mode- scan or monitorconfigservice- ConfigServicewriter- the writer to protocol bufferusePVAccess- Should we use PVAccess to connect to this PV.useDBEPropeties-- Throws:
Exception- On error in getting the pv info and status .
-
destoryPv
destroy the pv- Parameters:
pvName- the pv's name to destroyconfigservice- the configSerivice of the application- Throws:
Exception- error when destroy the PV
-