Class ParameterIdDb


  • public class ParameterIdDb
    extends Object
    Stores a map between (parameter_fqn, type) and parameter_id type is a 32 bit assigned corresponding (engType, rawType) engType and rawType are one of the types from protobuf Value.Type - we use the numbers assuming that no more than 2^15 will ever exist. Backed by RocksDB
    • Method Detail

      • createAndGet

        public int createAndGet​(String paramFqn,
                                org.yamcs.protobuf.Yamcs.Value.Type engType,
                                org.yamcs.protobuf.Yamcs.Value.Type rawType)
                         throws ParameterArchiveException
        Get the mapping from parameter_name, type to parameter_id It creates it if it does not exist
        Parameters:
        paramFqn -
        engType -
        rawType -
        Returns:
        a parameter id for the given parameter name and type
        Throws:
        ParameterArchiveException - if there was an error creating and storing a new parameter_id
      • createAndGet

        public int createAndGet​(String paramFqn,
                                org.yamcs.protobuf.Yamcs.Value.Type engType)
        get a parameter id for a parameter that only has engineering value
        Parameters:
        paramFqn -
        engType -
        Returns:
        a parameter id for the given parameter name and type
      • getTimeParameterId

        public int getTimeParameterId()
      • getSize

        public int getSize()
      • get

        public ParameterId[] get​(String fqn)
        Get all parameters ids for a given qualified name return null if no parameter id exists for that fqn.
        Parameters:
        fqn - - fully qualified name of the parameter for which the ids are returned
        Returns:
        all parameters ids for a given qualified name or null if no parameter id exists for that fqn
      • getParameterFqnById

        public String getParameterFqnById​(int parameterId)
        returns the parameter FQN for the given parameterId - relatively expensive operation
        Parameters:
        parameterId -
        Returns:
        parameterFQN or null if there is no parameter with the given id
      • getParameterId

        public ParameterId getParameterId​(int pid)
        returns ParameterId based on numeric id