Class DefaultConfigService
java.lang.Object
org.epics.archiverappliance.config.DefaultConfigService
- All Implemented Interfaces:
ConfigService
- Direct Known Subclasses:
ConfigServiceForTests
This is the default config service for the archiver appliance.
There is a subclass that is used in the junit tests.
- Author:
- mshankar
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.epics.archiverappliance.config.ConfigService
ConfigService.EAABulkOperation<T>, ConfigService.STARTUP_SEQUENCE, ConfigService.WAR_FILE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ApplianceAggregateInfoprotected Map<String, ApplianceInfo> protected ConcurrentSkipListSet<String> static final Stringprotected Propertiesprotected com.hazelcast.map.IMap<String, UserSpecifiedSamplingParams> static final Stringprotected EngineContextprotected PBThreeTierETLPVLookupprotected com.google.common.eventbus.EventBusprotected ConcurrentHashMap<String, com.google.common.cache.LoadingCache<String, Boolean>> static final Stringstatic final Stringprotected MgmtRuntimeStateprotected ApplianceInfoprotected Stringprotected ConcurrentHashMap<String, ConcurrentSkipListSet<String>> protected ConfigPersistenceprotected ProcessMetricsprotected com.hazelcast.topic.ITopic<PubSubEvent> protected com.hazelcast.map.IMap<String, ApplianceInfo> protected com.hazelcast.map.IMap<String, List<ChannelArchiverDataServerPVInfo>> protected PVNameToKeyMappingprotected RetrievalStateprotected LinkedList<Runnable> static final Stringstatic final Stringprotected ScheduledExecutorServiceprotected ConfigService.STARTUP_SEQUENCEstatic final Stringprotected com.hazelcast.map.IMap<String, PVTypeInfo> protected ConfigService.WAR_FILEFields inherited from interface org.epics.archiverappliance.config.ConfigService
ARCHAPPL_APPLIANCES, ARCHAPPL_CONFIGSERVICE_IMPL, ARCHAPPL_MYIDENTITY, ARCHAPPL_NAMEDFLAGS_PROPERTIES_FILE_PROPERTY, ARCHAPPL_PERSISTENCE_LAYER, ARCHAPPL_POLICIES, ARCHAPPL_PROPERTIES_FILENAME, ARCHAPPL_SITEID, CONFIG_SERVICE_NAME, DEFAULT_ARCHAPPL_PROPERTIES_FILENAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister an aliasvoidaddExternalArchiverDataServer(String serverURL, String archivesCSV) Add a external Archiver Data Server into the system.voidaddShutdownHook(Runnable runnable) Add an appserver agnostic shutdown hook; for example, to close the CA channels on shutdownvoidaddToArchiveRequests(String pvName, UserSpecifiedSamplingParams userSpecifiedSamplingParams) The workflow for requesting a PV to be archived consists of multiple steps This method adds a PV to the persisted list of PVs that are currently engaged in this workflow in addition to any user specified overridesvoidMark this pv as having it archive pv request completed and pull this request out of persistent store Can be used in the case of aborting a PV archive request as wellbreakDownPVsByAppliance(List<String> pvNames) Prepare for batch jobs by breaking down a list of PV's into a Map that maps appliance identity to a list of PV's being archived on that appliance.computePolicyForPV(String pvName, MetaInfo metaInfo, UserSpecifiedSamplingParams userSpecParams) Given a pvName (for now, we should have a pv details object of some kind soon), determine the policy applicable for archiving this PV.booleanIs this pv in the archive request workflow.executeClusterWide(ConfigService.EAABulkOperation<T> theOperation) <T> TexecuteOnAppliance(ApplianceInfo applianceInfo, ConfigService.EAABulkOperation<T> theOperation) getAggregatedApplianceInfo(ApplianceInfo applianceInfo) Facilitates various optimizations for BPL that uses appliance wide information by caching and maintaining this information on a per appliance basisgetAliasesForRealName(String realName) Gets all the aliases in the system that map to this real PV nameGet all the aliases in the system.voidgetAllExpandedNames(Consumer<String> func) For automated PV submission, IOC engineers could add .VAL, fields, aliases etc.Get an exhaustive list of all the PVs this cluster of appliances knows about Much goodness is facilitated if the objects are returned in the same order (perhaps order of creation) all the time.getAppliance(String identity) Given an identity of an appliance, return the appliance info for that appliancegetApplianceForPV(String pvName) Given a PV, get us the appliance that is responsible for archiving it.Get all the appliances in this cluster.Gets a list of PVs that are currently engaged in the archive PV workflowReturns a TypeSystem object that is used to convert from JCA DBR's to Event's (actually, DBRTimeEvents)getChannelArchiverDataServers(String pvName) Return a list of ChannelArchiverDataServerPVInfos for a PV if one exists; otherwise return null.Return the runtime state for the engine.Return the runtime state for ETL.com.google.common.eventbus.EventBusGet the event bus used for events within this appliance.This product has the ability to proxy data from other archiver data servers.String[]Get a list of extra fields that are obtained when we initially make a request for archiving.getFailoverApplianceURL(String pvName) Get the first external archiver appliance that also archives this PV and is configured with a mergeDuringRetrieval query parameter.Get a list of external archiver appliances configured for failover.This product offers the ability to archive certain fields (like HIHI, LOLO etc) as part of every PV.intIn clustered environments, to give capacity planning a chance to work correctly, we want to kick off the archive PV workflow only after all the machines have started.An arbitrary list of name/value pairs can be specified in a file called archappl.properties that is loaded from the classpath.Return the runtime state for the mgmt webapp.Get the appliance information for this appliance.booleangetNamedFlag(String name) Named flags are used to control various process in the appliance; for example, the ETL process in a PlainStoragePlugin Named flags are not persistent; each time the server starts up, all the named flags are set to false You can optionally load values for named flags from a file by specifying the ARCHAPPL_NAMEDFLAGS_PROPERTIES_FILE_PROPERTY property in archappl.properties.Return the names of all the named flags that we know aboutGet a set of PVs that have been paused in this appliance.Return a map of name to description of all the policies in the system This is used to drive a dropdown in the UI.Return the text of the policy for this installation.Implementation for converting a PV name to something that forms the prefix of a chunk's key.Get all PVs being archived by this appliance.getPVsForApplianceMatchingRegex(String nameToMatch) Get the pvNames for this appliance matching the given regex.Get all the PVs for this appliance.getRealNameForAlias(String aliasName) Gets the .NAME field for a PV if it exists.Returns the runtime state for the retrieval appGet a list of fields for PVs that are monitored and maintained in the engine.Used for inter-appliance startup checks.longGet an approximate time in epoch seconds when the appserver started up.getTypeInfoForPV(String pvName) Gets information about a PV's type, i.e its DBR type, graphic limits etc.getUserSpecifiedSamplingParams(String pvName) Returns any user specified parameters for the archive request.Which component is this configservice instance.We expect to live within a servlet container.booleanTo prevent split brain side-effects, we support cetain BPL only when all the member of the cluster have finished loading their PVs into the cluster.voidinitialize(jakarta.servlet.ServletContext sce) If you have a null constructor and need a ServletContext, implement this method.booleanIs this appliance component shutting down?booleanHave we completed all the startup steps?voidThis method is called after the mgmt WAR file has started up and set up the cluster and recovered data from persistence.voidpublishEventIntoCluster(PubSubEvent pubSubEvent) <T> Collection<T> queryPVTypeInfos(com.hazelcast.query.Predicate<String, PVTypeInfo> predicate, com.hazelcast.projection.Projection<Map.Entry<String, PVTypeInfo>, T> projection) Query this cluster's pvTypeInfos using the supplied the predicate and then run the supplied projection operator.voidFor all the Channel Archiver XMLRPC data servers in the mix, update the PV info.voidregisterPVToAppliance(String pvName, ApplianceInfo applianceInfo, PVRegistrationType registrationType) Make changes in the config service to register this PV to an appliancevoidremoveAlias(String aliasName, String realName) Remove an alias for the specified realnamevoidremoveExternalArchiverDataServer(String serverURL, String archivesCSV) Removes an entry for an external Archiver Data Server from the system Note; we may need to restart the entire cluster for this change to take effect.voidremovePVFromCluster(String pvName) Remove the pv from all cached and persisted configuration.voidEach retrieval component in a cluster caches the PV's from remote failover appliances.voidsetNamedFlag(String name, boolean value) Sets the value of the named flag specified by name to the specified valuevoidCall the registered shutdown hooks and shut the archive appliance down.voidupdateArchiveRequest(String pvName, UserSpecifiedSamplingParams userSpecifiedSamplingParams) Update the archive request (mostly with aliases) if and only if we have this in our persistence.voidvoidupdateTypeInfoForPV(String pvName, PVTypeInfo typeInfo) Update the type information about a PV; updating both ther persistent and cached versions of the information.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.epics.archiverappliance.config.ConfigService
registerPVToAppliance
-
Field Details
-
LOGGING_TYPE
- See Also:
-
ARCHAPPL_NAME
- See Also:
-
LOCAL_HOST_ADDRESS
- See Also:
-
TYPEINFO
- See Also:
-
CLUSTER_INET_2_APPLIANCE_IDENTITY
- See Also:
-
SITE_FOR_UNIT_TESTS_NAME
- See Also:
-
SITE_FOR_UNIT_TESTS_VALUE
- See Also:
-
myIdentity
-
myApplianceInfo
-
appliances
-
typeInfos
-
archivePVRequests
-
channelArchiverDataServers
-
aliasNamesToRealNames
-
pv2appliancemapping
-
parts2PVNamesForThisAppliance
-
clusterInet2ApplianceIdentity
-
appliancesConfigLoaded
-
pv2ChannelArchiverDataServer
protected com.hazelcast.map.IMap<String,List<ChannelArchiverDataServerPVInfo>> pv2ChannelArchiverDataServer -
pubSub
-
namedFlags
-
shutdownHooks
-
etlPVLookup
-
retrievalState
-
mgmtRuntime
-
engineContext
-
appliancesInCluster
-
applianceAggregateInfo
-
eventBus
protected com.google.common.eventbus.EventBus eventBus -
archapplproperties
-
pvName2KeyConverter
-
persistanceLayer
-
failoverPVs
protected ConcurrentHashMap<String,com.google.common.cache.LoadingCache<String, failoverPVsBoolean>> -
warFile
-
startupState
-
startupExecutor
-
processMetrics
-
-
Constructor Details
-
DefaultConfigService
protected DefaultConfigService()
-
-
Method Details
-
initialize
Description copied from interface:ConfigServiceIf you have a null constructor and need a ServletContext, implement this method.- Specified by:
initializein interfaceConfigService- Parameters:
sce- ServletContext- Throws:
ConfigException-
-
postStartup
Description copied from interface:ConfigServiceThis method is called after the mgmt WAR file has started up and set up the cluster and recovered data from persistence. Each appliance's mgmt war is responsible for calling this method on the other components (engine, etl and retrieval) using BPL. Until this method is called on all the web apps, the cluster is not considered to have started up.- Specified by:
postStartupin interfaceConfigService- Throws:
ConfigException-
-
getStartupState
Description copied from interface:ConfigServiceUsed for inter-appliance startup checks.- Specified by:
getStartupStatein interfaceConfigService- Returns:
- STARTUP_SEQUENCE
-
updatePVSForThisAppliance
-
publishEventIntoCluster
-
isStartupComplete
public boolean isStartupComplete()Description copied from interface:ConfigServiceHave we completed all the startup steps?- Specified by:
isStartupCompletein interfaceConfigService- Returns:
- boolean True or False
-
getInstallationProperties
Description copied from interface:ConfigServiceAn arbitrary list of name/value pairs can be specified in a file called archappl.properties that is loaded from the classpath.- Specified by:
getInstallationPropertiesin interfaceConfigService- Returns:
- Properties
-
getAppliancesInCluster
Description copied from interface:ConfigServiceGet all the appliances in this cluster. Much goodness is facilitated if the objects are returned in the same order (perhaps order of creation) all the time.- Specified by:
getAppliancesInClusterin interfaceConfigService- Returns:
- ApplianceInfo
-
hasClusterFinishedInitialization
public boolean hasClusterFinishedInitialization()Description copied from interface:ConfigServiceTo prevent split brain side-effects, we support cetain BPL only when all the member of the cluster have finished loading their PVs into the cluster. This consists of two checks 1) Make sure all appliances listed in appliances.xml have started up and are part of the cluster 2) All appliances in the cluster have registered their PVs with the cluster. Previously, we'd allow appliances.xml to have more appliances that are actually present in the cluster. However; this is becoming increasingly hard to support. We've had to tighten this to avoid split brain issues which can happen when the networking between instances fails.- Specified by:
hasClusterFinishedInitializationin interfaceConfigService- Returns:
- boolean
-
getMyApplianceInfo
Description copied from interface:ConfigServiceGet the appliance information for this appliance.- Specified by:
getMyApplianceInfoin interfaceConfigService- Returns:
- ApplianceInfo
-
getAppliance
Description copied from interface:ConfigServiceGiven an identity of an appliance, return the appliance info for that appliance- Specified by:
getAppliancein interfaceConfigService- Parameters:
identity- The appliance identify- Returns:
- ApplianceInfo
-
getAllPVs
Description copied from interface:ConfigServiceGet an exhaustive list of all the PVs this cluster of appliances knows about Much goodness is facilitated if the objects are returned in the same order (perhaps order of creation) all the time.- Specified by:
getAllPVsin interfaceConfigService- Returns:
- String AllPVs
-
getApplianceForPV
Description copied from interface:ConfigServiceGiven a PV, get us the appliance that is responsible for archiving it. Note that this may be null as the assignment of PV's to appliances can take some time.- Specified by:
getApplianceForPVin interfaceConfigService- Parameters:
pvName- The name of PV.- Returns:
- ApplianceInfo
-
getPVsForAppliance
Description copied from interface:ConfigServiceGet all PVs being archived by this appliance. Much goodness is facilitated if the objects are returned in the same order (perhaps order of creation) all the time.- Specified by:
getPVsForAppliancein interfaceConfigService- Parameters:
info- ApplianceInfo- Returns:
- string All PVs being archiveed by this appliance
-
getPVsForThisAppliance
Description copied from interface:ConfigServiceGet all the PVs for this appliance. Much goodness is facilitated if the objects are returned in the same order (perhaps order of creation) all the time.- Specified by:
getPVsForThisAppliancein interfaceConfigService- Returns:
- String All PVs being archiveed for this appliance
-
queryPVTypeInfos
public <T> Collection<T> queryPVTypeInfos(com.hazelcast.query.Predicate<String, PVTypeInfo> predicate, com.hazelcast.projection.Projection<Map.Entry<String, PVTypeInfo>, T> projection) Description copied from interface:ConfigServiceQuery this cluster's pvTypeInfos using the supplied the predicate and then run the supplied projection operator. This runs using Hz's query functions and can be run from any war file For example, to quickly determine the appliances for a bunch of PV's, project the applianceIdentity and then do a stream groupby.- Specified by:
queryPVTypeInfosin interfaceConfigService- Returns:
-
breakDownPVsByAppliance
Description copied from interface:ConfigServicePrepare for batch jobs by breaking down a list of PV's into a Map that maps appliance identity to a list of PV's being archived on that appliance.- Specified by:
breakDownPVsByAppliancein interfaceConfigService- Returns:
-
executeClusterWide
- Specified by:
executeClusterWidein interfaceConfigService
-
executeOnAppliance
public <T> T executeOnAppliance(ApplianceInfo applianceInfo, ConfigService.EAABulkOperation<T> theOperation) - Specified by:
executeOnAppliancein interfaceConfigService
-
getPVsForApplianceMatchingRegex
Description copied from interface:ConfigServiceGet the pvNames for this appliance matching the given regex.- Specified by:
getPVsForApplianceMatchingRegexin interfaceConfigService- Parameters:
nameToMatch-- Returns:
- string PVsForApplianceMatchingRegex
-
getAggregatedApplianceInfo
public ApplianceAggregateInfo getAggregatedApplianceInfo(ApplianceInfo applianceInfo) throws IOException Description copied from interface:ConfigServiceFacilitates various optimizations for BPL that uses appliance wide information by caching and maintaining this information on a per appliance basis- Specified by:
getAggregatedApplianceInfoin interfaceConfigService- Parameters:
applianceInfo- ApplianceInfo- Returns:
- ApplianceAggregateInfo
- Throws:
IOException-
-
registerPVToAppliance
public void registerPVToAppliance(String pvName, ApplianceInfo applianceInfo, PVRegistrationType registrationType) throws AlreadyRegisteredException Description copied from interface:ConfigServiceMake changes in the config service to register this PV to an appliance- Specified by:
registerPVToAppliancein interfaceConfigService- Parameters:
pvName- The name of PV.applianceInfo- ApplianceInforegistrationType- If reassigning; then an AlreadyRegisteredException is not raised- Throws:
AlreadyRegisteredException-
-
getTypeInfoForPV
Description copied from interface:ConfigServiceGets information about a PV's type, i.e its DBR type, graphic limits etc. This information is assumed to be somewhat static and is expected to come from a cache if possible as it is used in data retrieval.- Specified by:
getTypeInfoForPVin interfaceConfigService- Parameters:
pvName- The name of PV.- Returns:
- PVTypeInfo
-
updateTypeInfoForPV
Description copied from interface:ConfigServiceUpdate the type information about a PV; updating both ther persistent and cached versions of the information. Clients are not expected to call this method a million times a second. In general, this is expected to be called when archiving a PV for the first time, or perhaps when an appserver startups etc...- Specified by:
updateTypeInfoForPVin interfaceConfigService- Parameters:
pvName- The name of PV.typeInfo- PVTypeInfo
-
removePVFromCluster
Description copied from interface:ConfigServiceRemove the pv from all cached and persisted configuration.- Specified by:
removePVFromClusterin interfaceConfigService- Parameters:
pvName- The name of PV.
-
addToArchiveRequests
public void addToArchiveRequests(String pvName, UserSpecifiedSamplingParams userSpecifiedSamplingParams) Description copied from interface:ConfigServiceThe workflow for requesting a PV to be archived consists of multiple steps This method adds a PV to the persisted list of PVs that are currently engaged in this workflow in addition to any user specified overrides- Specified by:
addToArchiveRequestsin interfaceConfigService- Parameters:
pvName- The name of PV.userSpecifiedSamplingParams- - Use a null contructor for userSpecifiedSamplingParams if no override specified.
-
updateArchiveRequest
public void updateArchiveRequest(String pvName, UserSpecifiedSamplingParams userSpecifiedSamplingParams) Description copied from interface:ConfigServiceUpdate the archive request (mostly with aliases) if and only if we have this in our persistence.- Specified by:
updateArchiveRequestin interfaceConfigService- Parameters:
pvName- The name of PV.userSpecifiedSamplingParams-
-
getArchiveRequestsCurrentlyInWorkflow
Description copied from interface:ConfigServiceGets a list of PVs that are currently engaged in the archive PV workflow- Specified by:
getArchiveRequestsCurrentlyInWorkflowin interfaceConfigService- Returns:
- String ArchiveRequestsCurrentlyInWorkflow
-
doesPVHaveArchiveRequestInWorkflow
Description copied from interface:ConfigServiceIs this pv in the archive request workflow.- Specified by:
doesPVHaveArchiveRequestInWorkflowin interfaceConfigService- Parameters:
pvname- The name of PV.- Returns:
- boolean True or False
-
getUserSpecifiedSamplingParams
Description copied from interface:ConfigServiceReturns any user specified parameters for the archive request.- Specified by:
getUserSpecifiedSamplingParamsin interfaceConfigService- Parameters:
pvName- The name of PV.- Returns:
- UserSpecifiedSamplingParams
-
archiveRequestWorkflowCompleted
Description copied from interface:ConfigServiceMark this pv as having it archive pv request completed and pull this request out of persistent store Can be used in the case of aborting a PV archive request as well- Specified by:
archiveRequestWorkflowCompletedin interfaceConfigService- Parameters:
pvName- The name of PV.
-
getInitialDelayBeforeStartingArchiveRequestWorkflow
public int getInitialDelayBeforeStartingArchiveRequestWorkflow()Description copied from interface:ConfigServiceIn clustered environments, to give capacity planning a chance to work correctly, we want to kick off the archive PV workflow only after all the machines have started. This is an approximation for that metric; though not a very satisfactory approximation. TODO -- Think thru implications of making the appliances.xml strict...- Specified by:
getInitialDelayBeforeStartingArchiveRequestWorkflowin interfaceConfigService- Returns:
- - Initial delay in seconds.
-
addAlias
Description copied from interface:ConfigServiceRegister an alias- Specified by:
addAliasin interfaceConfigService- Parameters:
aliasName-realName- This is the name under which the PV will be archived under
-
removeAlias
Description copied from interface:ConfigServiceRemove an alias for the specified realname- Specified by:
removeAliasin interfaceConfigService- Parameters:
aliasName-realName- This is the name under which the PV will be archived under
-
getRealNameForAlias
Description copied from interface:ConfigServiceGets the .NAME field for a PV if it exists. Otherwise, this returns null- Specified by:
getRealNameForAliasin interfaceConfigService- Parameters:
aliasName-- Returns:
- String RealNameForAlias
-
getAliasesForRealName
Description copied from interface:ConfigServiceGets all the aliases in the system that map to this real PV name- Specified by:
getAliasesForRealNamein interfaceConfigService- Parameters:
realName-- Returns:
- A list of aliases for this real name
-
getAllAliases
Description copied from interface:ConfigServiceGet all the aliases in the system. This is used for matching during glob requests in the UI.- Specified by:
getAllAliasesin interfaceConfigService- Returns:
- String AllAliases
-
getExtraFields
Description copied from interface:ConfigServiceGet a list of extra fields that are obtained when we initially make a request for archiving. These are used in the policies to make decisions on how to archive the PV.- Specified by:
getExtraFieldsin interfaceConfigService- Returns:
- String ExtraFields
-
getRuntimeFields
Description copied from interface:ConfigServiceGet 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.- Specified by:
getRuntimeFieldsin interfaceConfigService- Returns:
- String RuntimeFields
-
getETLLookup
Description copied from interface:ConfigServiceReturn the runtime state for ETL. This may eventually be moved to a RunTime class but that would still start from the configservice.- Specified by:
getETLLookupin interfaceConfigService- Returns:
- PBThreeTierETLPVLookup
-
getRetrievalRuntimeState
Description copied from interface:ConfigServiceReturns the runtime state for the retrieval app- Specified by:
getRetrievalRuntimeStatein interfaceConfigService- Returns:
- RetrievalState
-
isShuttingDown
public boolean isShuttingDown()Description copied from interface:ConfigServiceIs this appliance component shutting down?- Specified by:
isShuttingDownin interfaceConfigService- Returns:
- boolean True or False
-
addShutdownHook
Description copied from interface:ConfigServiceAdd an appserver agnostic shutdown hook; for example, to close the CA channels on shutdown- Specified by:
addShutdownHookin interfaceConfigService- Parameters:
runnable- Runnable
-
shutdownNow
public void shutdownNow()Description copied from interface:ConfigServiceCall the registered shutdown hooks and shut the archive appliance down.- Specified by:
shutdownNowin interfaceConfigService
-
getExternalArchiverDataServers
Description copied from interface:ConfigServiceThis product has the ability to proxy data from other archiver data servers. We currently integrate with Channel Archiver XMLRPC data servers and other EPICS Archiver Appliance clusters. Get a list of external Archiver Data Servers that we know about.- Specified by:
getExternalArchiverDataServersin interfaceConfigService- Returns:
- Map ExternalArchiverDataServers
-
addExternalArchiverDataServer
Description copied from interface:ConfigServiceAdd a external Archiver Data Server into the system.- Specified by:
addExternalArchiverDataServerin interfaceConfigService- Parameters:
serverURL- - For Channel Archivers, this is the URL to the XML-RPC server. For other EPICS Archiver Appliance clusters, this is thedata_retrieval_urlof the cluster as defined in theappliances.xml.archivesCSV- - For Channel Archivers, this is a comma separated list of indexes. For other EPICS Archiver Appliance clusters, this is the string pbraw.- Throws:
IOException-
-
removeExternalArchiverDataServer
public void removeExternalArchiverDataServer(String serverURL, String archivesCSV) throws IOException Description copied from interface:ConfigServiceRemoves an entry for an external Archiver Data Server from the system Note; we may need to restart the entire cluster for this change to take effect.- Specified by:
removeExternalArchiverDataServerin interfaceConfigService- Parameters:
serverURL- - For Channel Archivers, this is the URL to the XML-RPC server. For other EPICS Archiver Appliance clusters, this is thedata_retrieval_urlof the cluster as defined in theappliances.xml.archivesCSV- - For Channel Archivers, this is a comma separated list of indexes. For other EPICS Archiver Appliance clusters, this is the string pbraw.- Throws:
IOException-
-
getChannelArchiverDataServers
Description copied from interface:ConfigServiceReturn a list of ChannelArchiverDataServerPVInfos for a PV if one exists; otherwise return null. The servers are sorted in order of the start seconds. Note: this only applies to Channel Archiver XML RPC servers. For proxying external EPICS Archiver Appliance clusters, we do not cache the PV's that are being archived on the external system.- Specified by:
getChannelArchiverDataServersin interfaceConfigService- Parameters:
pvName- The name of PV.- Returns:
- ChannelArchiverDataServerPVInfo
-
computePolicyForPV
public PolicyConfig computePolicyForPV(String pvName, MetaInfo metaInfo, UserSpecifiedSamplingParams userSpecParams) throws IOException Description copied from interface:ConfigServiceGiven a pvName (for now, we should have a pv details object of some kind soon), determine the policy applicable for archiving this PV.- Specified by:
computePolicyForPVin interfaceConfigService- Parameters:
pvName- The name of PV.metaInfo- The MetaInfo of PVuserSpecParams- UserSpecifiedSamplingParams- Returns:
- PolicyConfig
- Throws:
IOException-
-
getPoliciesInInstallation
Description copied from interface:ConfigServiceReturn a map of name to description of all the policies in the system This is used to drive a dropdown in the UI.- Specified by:
getPoliciesInInstallationin interfaceConfigService- Returns:
- HashMap
- Throws:
IOException-
-
getFieldsArchivedAsPartOfStream
Description copied from interface:ConfigServiceThis product offers the ability to archive certain fields (like HIHI, LOLO etc) as part of every PV. The data for these fields is embedded into the stream as extra fields using the FieldValues interface of events. This method lists all these fields. Requests for archiving these fields are deferred to and combined with the request for archiving the .VAL. We also assume that the data type (double/float) for these fields is the same as the .VAL.- Specified by:
getFieldsArchivedAsPartOfStreamin interfaceConfigService- Returns:
- String
- Throws:
IOException-
-
getArchiverTypeSystem
Description copied from interface:ConfigServiceReturns a TypeSystem object that is used to convert from JCA DBR's to Event's (actually, DBRTimeEvents)- Specified by:
getArchiverTypeSystemin interfaceConfigService- Returns:
- TypeSystem
-
getPolicyText
Description copied from interface:ConfigServiceReturn the text of the policy for this installation. Gets you an InputStream; remember to close it.- Specified by:
getPolicyTextin interfaceConfigService- Returns:
- InputStream
- Throws:
IOException-
-
getEngineContext
Description copied from interface:ConfigServiceReturn the runtime state for the engine.- Specified by:
getEngineContextin interfaceConfigService- Returns:
- EngineContext
-
getMgmtRuntimeState
Description copied from interface:ConfigServiceReturn the runtime state for the mgmt webapp.- Specified by:
getMgmtRuntimeStatein interfaceConfigService- Returns:
- MgmtRuntimeStat
-
getWarFile
Description copied from interface:ConfigServiceWhich component is this configservice instance.- Specified by:
getWarFilein interfaceConfigService- Returns:
- WAR_FILE
-
getEventBus
public com.google.common.eventbus.EventBus getEventBus()Description copied from interface:ConfigServiceGet the event bus used for events within this appliance.- Specified by:
getEventBusin interfaceConfigService- Returns:
- EventBus
-
getPVNameToKeyConverter
Description copied from interface:ConfigServiceImplementation for converting a PV name to something that forms the prefix of a chunk's key. See @see{PVNameToKeyMapping} for more details.- Specified by:
getPVNameToKeyConverterin interfaceConfigService- Returns:
- PVNameToKeyMapping
-
getProcessMetrics
-
getWebInfFolder
Description copied from interface:ConfigServiceWe expect to live within a servlet container. This call returns the full path to the WEB-INF folder of the webapp as it is deployed in the container. Is typically a call to theservletContext.getRealPath("WEB-INF/")- Specified by:
getWebInfFolderin interfaceConfigService- Returns:
- String WebInfFolder
-
getPausedPVsInThisAppliance
Description copied from interface:ConfigServiceGet a set of PVs that have been paused in this appliance.- Specified by:
getPausedPVsInThisAppliancein interfaceConfigService- Returns:
- String
-
refreshPVDataFromChannelArchiverDataServers
public void refreshPVDataFromChannelArchiverDataServers()Description copied from interface:ConfigServiceFor all the Channel Archiver XMLRPC data servers in the mix, update the PV info. This should help improve performance a little in proxying data from ChannelArchiver data servers that are still active. For proxying external EPICS Archiver Appliance clusters, since we do not cache the PV's that are being archived on the external system, this is a no-op.- Specified by:
refreshPVDataFromChannelArchiverDataServersin interfaceConfigService
-
getFailoverApplianceURL
Description copied from interface:ConfigServiceGet the first external archiver appliance that also archives this PV and is configured with a mergeDuringRetrieval query parameter.- Specified by:
getFailoverApplianceURLin interfaceConfigService- Returns:
- - Returns null if no failover appliance.
-
getFailoverServerURLs
Description copied from interface:ConfigServiceGet a list of external archiver appliances configured for failover. Failover appliances are not used as proxies to minimize imposing the retrieval load of the this installation on a potentially less powerful appliance used principally for failover.- Specified by:
getFailoverServerURLsin interfaceConfigService- Returns:
-
resetFailoverCaches
public void resetFailoverCaches()Description copied from interface:ConfigServiceEach retrieval component in a cluster caches the PV's from remote failover appliances. These caches contain one entry for each PV in this appliance indicating if the PV is being archived in the remote appliance. This information is cached using a TTL to minimize the impact on the remote failover appliance. This method manually unloads this cache.- Specified by:
resetFailoverCachesin interfaceConfigService
-
getNamedFlag
Description copied from interface:ConfigServiceNamed flags are used to control various process in the appliance; for example, the ETL process in a PlainStoragePlugin Named flags are not persistent; each time the server starts up, all the named flags are set to false You can optionally load values for named flags from a file by specifying the ARCHAPPL_NAMEDFLAGS_PROPERTIES_FILE_PROPERTY property in archappl.properties. This method gets the value of the specified named flag. If the flag has not been defined before in the cluster, this method will return false.- Specified by:
getNamedFlagin interfaceConfigService- Parameters:
name-- Returns:
- boolean True or False
-
setNamedFlag
Description copied from interface:ConfigServiceSets the value of the named flag specified by name to the specified value- Specified by:
setNamedFlagin interfaceConfigService- Parameters:
name-value-
-
getNamedFlagNames
Description copied from interface:ConfigServiceReturn the names of all the named flags that we know about- Specified by:
getNamedFlagNamesin interfaceConfigService- Returns:
- String
-
getTimeOfAppserverStartup
public long getTimeOfAppserverStartup()Description copied from interface:ConfigServiceGet an approximate time in epoch seconds when the appserver started up.- Specified by:
getTimeOfAppserverStartupin interfaceConfigService- Returns:
- The time this app server started up.
-
getAllExpandedNames
Description copied from interface:ConfigServiceFor automated PV submission, IOC engineers could add .VAL, fields, aliases etc. This method attempts to return all possible PV's that the archiver could know about. This is a lot of names; so we take in a consumer that potentially streams a name out as quickly as possible.- Specified by:
getAllExpandedNamesin interfaceConfigService- Parameters:
func- A consumer of pvNames
-