@VisibleForTesting
  @Nullable
  static String tryExtractMostProbableDataSource(String segmentId)
  {
    Matcher dateTimeMatcher = DateTimes.COMMON_DATE_TIME_PATTERN.matcher(segmentId);
    while (true) {
      if (!dateTimeMatcher.find()) {
        return null;
      }
      int dataSourceEnd = dateTimeMatcher.start() - 1;
      if (segmentId.charAt(dataSourceEnd) != DELIMITER) {
        continue;
      }
      return segmentId.substring(0, dataSourceEnd);
    }
  }
@ VisibleForTesting @ Nullable static String tryExtractMostProbableDataSource ( String segmentId ) { Matcher dateTimeMatcher = DateTimes . COMMON_DATE_TIME_PATTERN . matcher ( segmentId ) ; while ( true ) { if ( ! dateTimeMatcher . find ( ) ) { return null ; } int dataSourceEnd = dateTimeMatcher . start ( ) - 1 ; if ( segmentId . charAt ( dataSourceEnd ) != DELIMITER ) { continue ; } return segmentId . substring ( 0 , dataSourceEnd ) ; } }
Heuristically tries to extract the most probable data source from a String segment id representation, or returns
null on failure.

This method is not guaranteed to return a non-null data source given a valid String segment id representation.