- All Implemented Interfaces:
public class ConvertPVNameToKey extends Object implements PVNameToKeyMappingMost labs use a standard character (typically the ":" or the "-" character) in their naming conventions to separate out the components of a name. We want to replace these characters with the File.separator so that the key/file structure reflects the naming convention reasonably closely This give us 2 things
- All the files/keys for the entire archiver system do not land in the same folder. This improves performance significantly on ext2/3/4 like filesystems which can handle upto around 10000 files in a folder reasonably well but are very inefficient if this limit is crossed. Note, systems like ZFS/BTRFS do not have this limitation.
- We have a deterministic way to go from PV name to key/file name
One other issue we need to solve is that some PV's (
X:CTRD_V) are substrings of other PV's (
X:CTRD_V_BOOK). So, files for
X:CTRD_Vare matches for
X:CTRD_V_BOOKas well. We can either replace the underscores with /'s as well. Or the character that separates the final name component of the PV name from the rest of the file name (time partition info, extension etc) should also be something that would not show up in a PV name at the end. For now, we choose the latter and use another property to identify the separator string (for example ":") as the terminator. For example,
X:CTRD_V_BOOKis mapped to
This class uses two properties obtained from the
archappl.propertiesfile to map PV names to keys.
- org.epics.archiverappliance.config.ConvertPVNameToKey.siteNameSpaceSeparators - This is a list of characters that separate the components of the PV name. The syntax for this must satisfy Java's
replaceAllregex requirements. So to specify a list containing the ":" and the "-" characters, we have to use
- org.epics.archiverappliance.config.ConvertPVNameToKey.siteNameSpaceTerminator - This is the character used as the terminator of the PV name portion of the key.
Constructors Constructor Description
Modifier and Type Method Description
breakIntoParts(String pvName)Break a PV name into parts separated by the site specific separators For examples, ABC:123:DEF gets broken into [ABC, 123, DEF]
containsSiteSeparators(String pvName)Return true if the given pvName contains any site specific separators.
generateChunkKey(String pvName)One option is to simply override the final element of chunk key generation.
public void initialize(ConfigService configService) throws ConfigException
generateChunkKeyOne option is to simply override the final element of chunk key generation. To do that, subclass and override this method. (Of course, you still have to register the subclass in archappl.properties).
pvName- The name of PV.
public boolean containsSiteSeparators(String pvName)Description copied from interface:
PVNameToKeyMappingReturn true if the given pvName contains any site specific separators.
breakIntoPartsDescription copied from interface:
PVNameToKeyMappingBreak a PV name into parts separated by the site specific separators For examples, ABC:123:DEF gets broken into [ABC, 123, DEF]