Class MinionTaskMetadataUtils


  • public final class MinionTaskMetadataUtils
    extends Object
    Helper methods to fetch/persist ZNRecord for minion task metadata
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void deleteTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, String tableNameWithType)
      Deletes the ZNRecord for the given minion task and tableName, from both the new path MINION_TASK_METADATA/${tableNameWthType}/${taskType} and the old path MINION_TASK_METADATA/${taskType}/${tableNameWthType}.
      static org.apache.helix.zookeeper.datamodel.ZNRecord fetchTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, String tableNameWithType)
      Fetches the ZNRecord for the given minion task and tableName.
      static void persistTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, BaseTaskMetadata taskMetadata, int expectedVersion)
      Generic method for persisting BaseTaskMetadata to MINION_TASK_METADATA.
    • Method Detail

      • fetchTaskMetadata

        @Nullable
        public static org.apache.helix.zookeeper.datamodel.ZNRecord fetchTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore,
                                                                                      String taskType,
                                                                                      String tableNameWithType)
        Fetches the ZNRecord for the given minion task and tableName. Fetch from the new path MINION_TASK_METADATA/${tableNameWthType}/{taskType} if it exists; otherwise, fetch from the old path MINION_TASK_METADATA/${taskType}/${tableNameWthType}.
      • deleteTaskMetadata

        public static void deleteTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore,
                                              String taskType,
                                              String tableNameWithType)
        Deletes the ZNRecord for the given minion task and tableName, from both the new path MINION_TASK_METADATA/${tableNameWthType}/${taskType} and the old path MINION_TASK_METADATA/${taskType}/${tableNameWthType}.
      • persistTaskMetadata

        public static void persistTaskMetadata​(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore,
                                               String taskType,
                                               BaseTaskMetadata taskMetadata,
                                               int expectedVersion)
        Generic method for persisting BaseTaskMetadata to MINION_TASK_METADATA. The metadata will be saved in the ZNode under the new path /MINION_TASK_METADATA/${tableNameWithType}/${taskType} if the old path already exists; otherwise, it will be saved in the ZNode under the old path /MINION_TASK_METADATA/${taskType}/${tableNameWithType}. Will fail if expectedVersion does not match. Set expectedVersion -1 to override version check.