# Specify arbitrary name value pairs here; names and values are strings...

# The PlainPB plugin replaces the characters specified in this list with the "/" character to generate path names.
# This has the effect of distributing the files containing data into multiple folders
# Getting a good distribution is important for good performance; most file systems do not perform well if they have 10000's of files in a folder.
# This is passed into java's String.replaceAll; so watch out for regex issues.
org.epics.archiverappliance.config.ConvertPVNameToKey.siteNameSpaceSeparators = [\\:\\-]
# To avoid substring issues, each pathname is terminated with a character that is guaranteed not to be in the path name (because of said replacement above)
org.epics.archiverappliance.config.ConvertPVNameToKey.siteNameSpaceTerminator = :

# We enforce a site specific minimum sampling period (read maximum rate) using this value
#org.epics.archiverappliance.mgmt.bpl.ArchivePVAction.minimumSamplingPeriod = 0.1
# J-PARC MR
org.epics.archiverappliance.mgmt.bpl.ArchivePVAction.minimumSamplingPeriod = 0.01

# We have a system wide buffer size (specified in seconds) for buffering the data in engine memory
# This is a compromise between various factors including garbage collection, IOPS of the short term store and memory availability.
org.epics.archiverappliance.config.PVTypeInfo.secondsToBuffer = 10

# Per FRIB/PSI, we have a configuration knob to increase/decrease the sample buffer size used by the engine for all PV's.
# This 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
#org.epics.archiverappliance.config.PVTypeInfo.sampleBufferCapacityAdjustment = 1.0

# Increase buffer capacity adjustment in order to avoid buffer overflow in J-PARC MR.
org.epics.archiverappliance.config.PVTypeInfo.sampleBufferCapacityAdjustment = 5.0


# The getData retrieval calls support a usereduced parameter which is the entry into sparsification.
# It is possible for sites to configure their default sparsification post processor using this parameter.
# For example, at SLAC we will probably use divide the request into two parts, data less than two weeks old is raw data while data older than two weeks old is sparsified using FirstSamplePP
org.epics.archiverappliance.retrieval.DefaultUseReducedPostProcessor=org.epics.archiverappliance.retrieval.postprocessors.TwoWeekRaw


# If a PV used to be archived by the appliance but has since been retired, data does not get returned from the request even though data might exist in the
# datastores. Setting this option to 'true' means that if a request is received for a PV that is not currently being archived (i.e. the PVTypeInfo is null),
# it will automatically then run a search in the datastores to see if there is any data available for this PV within the timeframe and return it.
# org.epics.archiverappliance.retrieval.SearchStoreForRetiredPvs=true


# This propery has been deprecated as it can easily lead to data loss.
# The maximum number of datastores/stages/lifetimeids in this installation.
# Specifically, this returns the maximum length of the datastores element across all  PVTypeInfo's in this installation.
# For example, in an typical installation with a short term store, a medium term store and a long term store, this should return 3.
# Various optimizations are based on the maximum number of stages data goes thru in the archiver appliance.
# We create one ETL thread per lifetime transition
# org.epics.archiverappliance.config.PVTypeInfo.maximumNumberOfLifetimesInInstallation=5


# Use this property to control whether you want to use CAJ or the JNI implementation in JCA.
org.epics.archiverappliance.engine.epics.JCAConfigGen.useCAJ=true
# This controls the dispatcher used to dispatch ChannelAccess events.
org.epics.archiverappliance.engine.epics.JCAConfigGen.dispatcher=org.epics.archiverappliance.engine.epics.JCAEventDispatcherBasedOnPVName
#org.epics.archiverappliance.engine.epics.JCAConfigGen.dispatcher=gov.aps.jca.event.QueuedEventDispatcher
# For faster reconnect times, we may want to use more than one JCAContext/CAJContext. This controls the number of JCACommandThreads and thus the number of JCAContext/CAJContext.
# Each JCACommandThread launches aprox 4 threads in all in CAJ - one CAJ search thread (UDP); a couple of TCP threads and the JCACommand thread that controls them.
# Routing all PVs thru fewer contexts seems to result in larger reconnect times.
org.epics.archiverappliance.engine.epics.commandThreadCount=10

# The SCAN sampling method establishes camonitors and skips samples that are less than the sampling method.
# However, the IOC itself could have some jitter and this will cause the SCAN'ed PV to miss samples that arrive a few milliseconds early.
# Use this to control how much jitter you want to accommodate.
# This is a multiplier; so if your sampling method if 1.0 seconds and the jitter factor is 0.95, then the final sampling method is 950 milliseconds.
# Alternatively, to establish a jitter of 5%, use 0.95; to establish a jitter of 10%, use 0.9 etc...
#org.epics.archiverappliance.engine.epics.scanJitterFactor=0.95

# J-PARC MR
org.epics.archiverappliance.engine.epics.scanJitterFactor=1.00


# We use a ScheduledThreadPoolExecutor for implementing SCAN PV's.
# If you have a lot of PV's under SCAN and some of these take time; it is possible to miss some SCAN samples because we just don't get to the PV in time.
# In this case, you can increase the number of SCAN threads used; the need for this is probably pretty rare
org.epics.archiverappliance.engine.epics.scanThreadCount=1


# How should ETL handle out of space situations.
# See the javadoc of org.epics.archiverappliance.etl.common.OutOfSpaceHandling for some options
org.epics.archiverappliance.etl.common.OutOfSpaceHandling=DELETE_SRC_STREAMS_IF_FIRST_DEST_WHEN_OUT_OF_SPACE


# A list of fields for PVs that are monitored and maintained in the engine.
# These are used when displaying the PV in visualization tools like the ArchiveViewer as additional information for the PV.
# Some of these could be archived along with the PV but need not be.
# In this case, the engine simply maintains the latest copy in memory and this is served up when data from the engine in included in the stream.
# This is a comma separated list of fields
# For example, if you have an fields for the owner of a PV, you could add that here.
# We add the DESC in addition to the typical limits.
org.epics.archiverappliance.config.RuntimeKeys=DESC

# On CA disconnects, occasionally, we do not reconnect back to the PV in time.
# This timeout governs the delay between the disconnect and when we do a pause/resume to convert reconnects into ca searches.
# If you want to turn off this functionality, simply set this value to 0
org.epics.archiverappliance.engine.util.EngineContext.disconnectCheckTimeoutInMinutes = 0

# One can define a set of named flags (booleans) that can be used to control various processes in the system
# For example, you can control the ETL process in a PlainPBStoragePlugin using a named flag to accomplish a gated ETL.
# Named flags are not persistent; each time the server starts up, all the named flags are set to false
# If a named flag is not defined, it defaults to false.
# You can optionally load values for named flags by specifying the full path to a java properties file here.
# org.epics.archiverappliance.config.NamedFlags.readFromFile=/nfs/fullpathto/namedFlags.properties

# We pick up named client configuration JSON files for the archive viewer from here.
# To turn off this features, simply comment this property.
#org.epics.archiverappliance.retrieval.bpl.GetClientConfiguration.DocumentRoot=/nfs/slac/g/lcls/tools/ArchiveBrowser/config

# We impose a throttle on archive requests that are pending. This is an attempt to conserve resources on the engine and also to control CA search broadcast storms
# What this means is that if you have more that this many invalid PV's (PVs that will never connect) in the archive workflow; the ones later in the queue will never get fulfilled unless the archive request queue is cleaned up.
# See abortNeverConnectedPV for a example of how to do this.
# Use this property to increase this batch size.
# Note that there is a limit on how high this can go. We sample the PV for a minute to determine storage rates etc; if this is set very high (> 10000), there may not be enough time to perform the sampling for the archive workflow.
# org.epics.archiverappliance.mgmt.MgmtRuntimeState.archivePVWorkflowBatchSize = 1000

# For larger archivePVWorkflowBatchSize, you may need a longer time between the workflow state machine ticks.
# Set this to 60 seconds or more if you are using archivePVWorkflowBatchSize's of 5000 or greater.
# The workflow may take a little longer per PV but overall may be much faster.
# org.epics.archiverappliance.mgmt.MgmtRuntimeState.archivePVWorkflowTickSeconds = 10

# Abort PV's in the archive PV workflow after this many minutes if the archiver is not able to connect to the PV.
# The workflow can take a few minutes; so this should be set to a reasonable value (for example, 1 minute would mean that no PV would complete the workflow)
# By default, this is set to a day. So, if the archiver cannot connect to the PV in a day, it will give up and abort.
# To turn this off, set this to -1.
# org.epics.archiverappliance.mgmt.MgmtRuntimeState.abortArchiveRequestInMins = 1440

# For the moment, don't abort never connected PVs for J-PARC MR
org.epics.archiverappliance.mgmt.MgmtRuntimeState.abortArchiveRequestInMins = -1

# See org.epics.archiverappliance.engine.pv.EngineContext for these two entries
# org.epics.archiverappliance.engine.maximum_disconnected_channel_percentage_before_starting_metachannels = 5.0
# org.epics.archiverappliance.engine.metachannels_to_start_at_a_time = 10000
