Class TmPartitionGroups

java.lang.Object
org.yamcs.archive.TmPartitionGroups

public class TmPartitionGroups extends Object
Assigns the packets recorded in the tm table to partition groups, as configured with the partitionGroups option of the XtceTmRecorder.

The group of a packet is determined from its packet name (pname): starting with the container having that name and going up in the XTCE hierarchy, the first container listed in a group determines the group. If no container is listed, the packet goes into the DEFAULT_GROUP.

The groups are computed from the current configuration and MDB. If the configuration is changed such that a packet moves to another group, the retrievals filtering on that packet name will not find the data recorded before the change.

  • Field Details

  • Constructor Details

    • TmPartitionGroups

      public TmPartitionGroups(String yamcsInstance, Mdb mdb, Map<String,List<String>> groupDefinitions)
      Parameters:
      yamcsInstance - used for logging
      mdb - used to navigate the container hierarchy
      groupDefinitions - group name -> list of container qualified names
  • Method Details

    • getGroup

      public String getGroup(String pname)
      Returns the group in which the packets with the given name are recorded.
    • getGroups

      public Set<String> getGroups(Collection<String> pnames)
      Returns the groups containing the given packet names or null if all groups have to be read (because the groups of some packet names cannot be determined or because all groups are concerned).
    • addGroupFilter

      public static void addGroupFilter(String yamcsInstance, SqlBuilder sqlb, Collection<String> pnames)
      If the tm table of the instance is partitioned by group, adds a condition on the pgroup column such that only the partitions which may contain the given packet names are read.

      This only limits which partitions are read; the caller has to filter on the packet names itself.

    • getInstance

      public static TmPartitionGroups getInstance(String yamcsInstance)
      Returns the partition groups of the given instance, or null if the tm table is not partitioned by group or if no XtceTmRecorder is running in the instance.