Class SegmentUtils

java.lang.Object
org.apache.druid.segment.SegmentUtils

public class SegmentUtils extends Object
Utility methods useful for implementing deep storage extensions.
  • Method Details

    • hashIds

      public static String hashIds(List<DataSegment> segments)
      Hash the IDs of the given segments based on SHA-256 algorithm.
    • getVersionFromDir

      public static int getVersionFromDir(File inDir) throws IOException
      Throws:
      IOException
    • commaSeparatedIdentifiers

      @Nullable public static Object commaSeparatedIdentifiers(@Nullable Collection<DataSegment> segments)
      Returns an object whose toString() returns a String with identifiers of the given segments, comma-separated. Useful for log messages. Not useful for anything else, because this doesn't take special effort to escape commas that occur in identifiers (not common, but could potentially occur in a datasource name).
    • groupSegmentsByInterval

      public static Map<org.joda.time.Interval,List<DataSegment>> groupSegmentsByInterval(Collection<DataSegment> segments)