Package org.yamcs.parameterarchive
Class ParameterIdDb
- java.lang.Object
-
- org.yamcs.parameterarchive.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
-
-
Field Summary
Fields Modifier and Type Field Description static String
TIME_PARAMETER_FQN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
createAndGet(String paramFqn, org.yamcs.protobuf.Yamcs.Value.Type engType)
get a parameter id for a parameter that only has engineering valueint
createAndGet(String paramFqn, org.yamcs.protobuf.Yamcs.Value.Type engType, org.yamcs.protobuf.Yamcs.Value.Type rawType)
Get the mapping from parameter_name, type to parameter_id It creates it if it does not existParameterId[]
get(String fqn)
Get all parameters ids for a given qualified name return null if no parameter id exists for that fqn.String
getParameterFqnById(int parameterId)
returns the parameter FQN for the given parameterId - relatively expensive operationParameterId
getParameterId(int pid)
returns ParameterId based on numeric idint
getSize()
int
getTimeParameterId()
void
print(PrintStream out)
-
-
-
Field Detail
-
TIME_PARAMETER_FQN
public static final String TIME_PARAMETER_FQN
- See Also:
- Constant Field Values
-
-
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()
-
print
public void print(PrintStream out)
-
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
-
-