Class IdUtils

java.lang.Object
org.apache.druid.common.utils.IdUtils

public class IdUtils extends Object
  • Constructor Details

    • IdUtils

      public IdUtils()
  • Method Details

    • validateId

      public static String validateId(String thingToValidate, String stringToValidate)
    • getRandomId

      public static String getRandomId()
    • getRandomIdWithPrefix

      public static String getRandomIdWithPrefix(String prefix)
    • newTaskId

      public static String newTaskId(String typeName, String dataSource, @Nullable org.joda.time.Interval interval)
    • newTaskId

      public static String newTaskId(@Nullable String idPrefix, String typeName, String dataSource, @Nullable org.joda.time.Interval interval)
    • getValidSegmentId

      public static SegmentId getValidSegmentId(String dataSource, String serializedSegmentId)
      Tries to parse the serialized ID as a SegmentId of the given datasource.
      Throws:
      DruidException - if the segment ID could not be parsed.
    • getValidSegmentIds

      public static Set<SegmentId> getValidSegmentIds(String dataSource, Set<String> serializedIds)
      Tries to parse the given serialized IDs as SegmentIds of the given datasource.
      Returns:
      Set containing valid segment IDs.
      Throws:
      DruidException - if any of the given segment IDs is invalid