Class EngineContext
java.lang.Object
org.epics.archiverappliance.engine.pv.EngineContext
the context for the Archiver Engine
- Author:
- Luofeng Li
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classGo thru all the contexts and return channels whose names match this This is to be used for for testing purposes only. -
Constructor Summary
ConstructorsConstructorDescriptionEngineContext(ConfigService configService) This EngineContext should always be singleton -
Method Summary
Modifier and TypeMethodDescriptionbooleanabortComputeMetaInfo(String pvName) intassignJCACommandThread(String pvName, String iocHostName) Use this to assign JCA command threads to PV'svoidcomputeMetaInfo(PubSubEvent pubSubEvent) booleandoesChannelContextMatchThreadContext(gov.aps.jca.Channel channel, int jcaCommandThreadId) getAllChannelsForPV(String pvName) doubleintGet the total channel count as CAJ sees it.Return some details on the CAJ contexts for the metrics page.getJCACommandThread(int jcaCommandThreadId) intGet the number of tasks pending in the main scheduler.intorg.epics.pva.client.PVAClientdoublePer FRIB/PSI, we have a configuration knob to increase/decrease the sample buffer size used by the engine for all PV's.Get the scheduler used for SCAN PV'sdoublebooleanvoidpvTypeInfoChanged(PVTypeInfoEvent event) voidsetDisconnectCheckTimeoutInSecondsForTestingPurposesOnly(int newDisconnectCheckTimeoutSeconds) voidsetSecondsConsumedByWriter(double secondsConsumedByWriter) set the time consumed by writer to write the sample buffer oncevoidstartWriteThread(ConfigService configservice) start the write thread of the engine and this is actually called by the first pv when creating channel
-
Constructor Details
-
EngineContext
This EngineContext should always be singleton- Parameters:
configService- the config service to initialize the engine context- Throws:
ConfigException
-
-
Method Details
-
getControlingPVList
- Returns:
- the list of pvs controlling other pvs
-
setSecondsConsumedByWriter
public void setSecondsConsumedByWriter(double secondsConsumedByWriter) set the time consumed by writer to write the sample buffer once- Parameters:
secondsConsumedByWriter- the time in second consumed by writer to write the sample buffer once
-
getAverageSecondsConsumedByWriter
public double getAverageSecondsConsumedByWriter()- Returns:
- the average time in second consumed by writer
-
getJCACommandThread
-
assignJCACommandThread
Use this to assign JCA command threads to PV's- Parameters:
pvName- The name of PViocHostName- Note this can and will often be null.- Returns:
- threadId
-
doesChannelContextMatchThreadContext
public boolean doesChannelContextMatchThreadContext(gov.aps.jca.Channel channel, int jcaCommandThreadId) -
getChannelList
- Returns:
- the channel list of pvs, without the pvs for meta fields
-
getScheduler
- Returns:
- the scheduler for the whole engine
-
getScanScheduler
Get the scheduler used for SCAN PV's- Returns:
- scanScheduler
-
getWriteThead
- Returns:
- the WriterRunnable for the engines
-
startWriteThread
start the write thread of the engine and this is actually called by the first pv when creating channel- Parameters:
configservice- configservice used by this writer
-
getWritePeriod
public double getWritePeriod()- Returns:
- the writing period in second
-
isWriteThreadStarted
public boolean isWriteThreadStarted()- Returns:
- the status of the writing thread. return true, if it is started.Otherwise, return false;
-
computeMetaInfo
-
pvTypeInfoChanged
-
setDisconnectCheckTimeoutInSecondsForTestingPurposesOnly
public void setDisconnectCheckTimeoutInSecondsForTestingPurposesOnly(int newDisconnectCheckTimeoutSeconds) - Parameters:
newDisconnectCheckTimeoutSeconds- This is to be used only for unit testing purposes... There are no guarantees that using this on a running server will be benign.
-
abortComputeMetaInfo
-
getAllChannelsForPV
-
getSampleBufferCapacityAdjustment
public double getSampleBufferCapacityAdjustment()Per FRIB/PSI, we have a configuration knob to increase/decrease the sample buffer size used by the engine for all PV's. This comes from archappl.properties and is a double - by default 1.0 which means we leave the buffer size computation as is. If you want to increase buffer size globally to 150% of what is normally computed, set this to 1.5- Returns:
- sampleBufferCapacityAdjustment
-
getCAJChannelCount
public int getCAJChannelCount()Get the total channel count as CAJ sees it.- Returns:
- totalCAJChannelCount
-
getPVAClient
public org.epics.pva.client.PVAClient getPVAClient() -
getMiscTasksScheduler
-
getMainSchedulerPendingTasks
public int getMainSchedulerPendingTasks()Get the number of tasks pending in the main scheduler. This is the one that powers the write thread.- Returns:
-
getCAJContextDetails
Return some details on the CAJ contexts for the metrics page.- Returns:
-
getPausedPVCount
public int getPausedPVCount() -
getCommandThreadDetails
-