Class ArchiveEngine
- java.lang.Object
-
- org.epics.archiverappliance.engine.ArchiveEngine
-
public class ArchiveEngine extends Object
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 Constructor Description ArchiveEngine()
-
Method Summary
Modifier and Type Method Description static void
archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp lastKnownEventTimeStamp, boolean usePVAccess, boolean useDBEProperties)
static void
archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp lastKnownEventTimeStamp, String[] metaFieldNames, boolean usePVAccess, boolean useDBEProperties)
static void
archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp lastKnownEventTimeStamp, String controllingPVName, boolean usePVAccess, boolean useDBEProperties)
static void
archivePV(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp lastKnownEventTimeStamp, String controllingPVName, String[] metaFieldNames, String iocHostName, boolean usePVAccess, boolean useDBEProperties)
Create a new channel in monitor mode or in scan modestatic void
changeArchivalParameters(String pvName, float samplingPeriod, PolicyConfig.SamplingMethod mode, ConfigService configservice, Writer writer, boolean usePVAccess, boolean useDBEPropeties)
change pv's sample period or sample modestatic void
destoryPv(String pvName, ConfigService configservice)
destroy the pvstatic void
getArchiveInfo(String pvName, ConfigService configservice, String[] metadatafields, boolean usePVAccess, MetaCompletedListener metaListener)
Get the meta data for pv - used for policy computation.static void
getLowLevelStateInfo(String pvName, ConfigService configservice, LinkedList<Map<String,String>> statuses)
Return info from CAJstatic PVMetrics
getMetricsforPV(String pvName, ConfigService configservice)
get the pv's info and statusstatic void
pauseArchivingPV(String pvName, ConfigService configservice)
pause the pvstatic void
resumeArchivingPV(String pvName, ConfigService configservice)
restart the pvstatic void
startChannelsForPV(String pvName, ConfigService configservice)
Start up the channels for a PV.
-
-
-
Method Detail
-
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, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp 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 monitorsecondstoBuffer
- Not really usedwriter
- 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, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp 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 monitorsecondstoBuffer
- Not really usedwriter
- 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, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp 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 monitorsecondstoBuffer
- Not really usedwriter
- 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, int secondstoBuffer, Writer writer, ConfigService configservice, ArchDBRTypes archdbrtype, Timestamp 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 monitorsecondstoBuffer
- - Not really usedwriter
- 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
public static void pauseArchivingPV(String pvName, ConfigService configservice) throws Exception
pause the pv- Parameters:
pvName
- Name of the channel (PV)configservice
- ConfigService- Throws:
Exception
- error in pausing the channel .
-
resumeArchivingPV
public static void resumeArchivingPV(String pvName, ConfigService configservice) 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
-
-
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 Exception
Return 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
public static void destoryPv(String pvName, ConfigService configservice) throws Exception
destroy the pv- Parameters:
pvName
- the pv's name to destroyconfigservice
- the configSerivice of the application- Throws:
Exception
- error when destroy the PV
-
-