Class ParameterIdDb
type is a 32 bit assigned corresponding (engType, rawType)
engType and rawType are one of the types from protobuf Value.Type - the numbers are used assuming that no more than 2^15 will ever exist.
The parameter_id is the tbsIndex from RocksdDb backed database.
The aggregates and arrays are also allocated parameter_ids (i.e. tbsIndex) but they do not contain any data, just a list of members parameter ids stored in the tablespace metadata. Backed by RocksDB
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
createAndGet
(String paramFqn, Yamcs.Value.Type engType) get a parameter id for a parameter that only has engineering valueint
createAndGet
(String paramFqn, Yamcs.Value.Type engType, Yamcs.Value.Type rawType) Get the mapping from (parameterFqn, type) to pidint
createAndGetAggrray
(String paramFqn, Yamcs.Value.Type engType, Yamcs.Value.Type rawType, IntArray components) Creates (if not already existing) an id for the aggregate or array parameter with the given qualified name and member ids.Get all parameters ids for a given qualified name return null if no parameter id exists for that fqn.getAggarrayComponents
(int aggrayPid, int gid) Get the array components of aggregate/array parameter pid which are members of the group gidreturns an array of all parameter ids (including the time pseudo-parameter id)org.yamcs.parameterarchive.ParameterIdDb.Entry
getCachedEntryById
(int pid) getParameterFqnById
(int parameterId) returns the parameter FQN for the given parameterIdgetParameterId
(int pid) returns ParameterId based on numeric id or null if it does not existint
void
iterate
(BiFunction<String, ParameterId, Boolean> consumer) Iterate over the parameter database, calling the function with the fqn and parameter id.void
print
(PrintStream out) int
size()
-
Field Details
-
TIME_PARAMETER_FQN
- See Also:
-
-
Method Details
-
createAndGet
public int createAndGet(String paramFqn, Yamcs.Value.Type engType, Yamcs.Value.Type rawType) throws ParameterArchiveException Get the mapping from (parameterFqn, type) to pidIt 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
-
getParameterGroupIdDb
-
createAndGet
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() -
print
-
size
public int size() -
get
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
returns the parameter FQN for the given parameterId- Parameters:
parameterId
-- Returns:
- parameterFQN or null if there is no parameter with the given id
-
getParameterId
returns ParameterId based on numeric id or null if it does not exist -
getCachedEntryById
public org.yamcs.parameterarchive.ParameterIdDb.Entry getCachedEntryById(int pid) -
iterate
Iterate over the parameter database, calling the function with the fqn and parameter id.The iteration will continue as long as the function returns true
- Parameters:
consumer
-
-
createAndGetAggrray
public int createAndGetAggrray(String paramFqn, Yamcs.Value.Type engType, Yamcs.Value.Type rawType, IntArray components) Creates (if not already existing) an id for the aggregate or array parameter with the given qualified name and member ids.If another parameter with the same name exists and the aggArray is either a subset or superset of the members of the existing parameter, it is considered the same and is returned.
For example an array will have an id for each index of its elements a[0], a[1],.. The aggArray for that parameter will consist of the list of ids corresponding to the value which had the maximum number of elements.
If a new value is encountered having more elements than the previous maximum, we do not want to create a new id for that parameter. We do however want to create a new id if the elements have a different type (and thus a[i] will have a different id)
- Parameters:
paramFqn
- - qualified name of the parameterengType
- - the type of engineering value (ARRAY or AGGREGATE)rawType
- - the type of the raw value - null if the parameter has no raw valuecomponents
- - the parameter ids of the components of the aggregate or array- Returns:
-
getAggarrayComponents
Get the array components of aggregate/array parameter pid which are members of the group gid- Parameters:
aggrayPid
-gid
-- Returns:
-
getAllPids
returns an array of all parameter ids (including the time pseudo-parameter id)
-