Package org.apache.pinot.common.minion
Class MinionTaskMetadataUtils
- java.lang.Object
-
- org.apache.pinot.common.minion.MinionTaskMetadataUtils
-
public final class MinionTaskMetadataUtils extends Object
Helper methods to fetch/persist ZNRecord for minion task metadata
-
-
Method Summary
Modifier and Type Method Description static voiddeleteTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String tableNameWithType)Deletes the minion task metadata ZNRecord for the given tableName, from both the new path MINION_TASK_METADATA/${tableNameWthType} and the old path MINION_TASK_METADATA//${tableNameWthType} static voiddeleteTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, String tableNameWithType)Deletes the minion task metadata 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.ZNRecordfetchTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, String tableNameWithType)Fetches the minion task metadata ZNRecord for the given minion task and tableName.static Map<String,Map<String,Long>>getAllTaskMetadataLastUpdateTimeMs(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore)Gets the last update time (in ms) of all minion task metadata.static voidpersistTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, BaseTaskMetadata taskMetadata, int expectedVersion)Generic method for persistingBaseTaskMetadatato 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 minion task metadata 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}.
-
getAllTaskMetadataLastUpdateTimeMs
public static Map<String,Map<String,Long>> getAllTaskMetadataLastUpdateTimeMs(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore)
Gets the last update time (in ms) of all minion task metadata.- Parameters:
propertyStore- the property store where all minion task metadata is stored.- Returns:
- a map storing the last update time (in ms) of all minion task metadata: (tableNameWithType -> taskType -> last update time in ms)
-
deleteTaskMetadata
public static void deleteTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String taskType, String tableNameWithType)Deletes the minion task metadata 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}.
-
deleteTaskMetadata
public static void deleteTaskMetadata(org.apache.helix.store.HelixPropertyStore<org.apache.helix.zookeeper.datamodel.ZNRecord> propertyStore, String tableNameWithType)Deletes the minion task metadata ZNRecord for the given tableName, from both the new path MINION_TASK_METADATA/${tableNameWthType} and the old path MINION_TASK_METADATA//${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 persistingBaseTaskMetadatato MINION_TASK_METADATA. The metadata will be saved in the ZNode under the new path /MINION_TASK_METADATA/${tableNameWithType}/${taskType} if it exists or the old path does not exist; 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.
-
-