Class SegmentGenerationUtils


  • public class SegmentGenerationUtils
    extends Object
    • Method Detail

      • generateSchemaURI

        public static String generateSchemaURI​(String controllerUri,
                                               String table)
      • generateTableConfigURI

        public static String generateTableConfigURI​(String controllerUri,
                                                    String table)
      • getSchema

        public static Schema getSchema​(String schemaURIString)
      • getSchema

        public static Schema getSchema​(String schemaURIString,
                                       String authToken)
      • getRelativeOutputPath

        public static URI getRelativeOutputPath​(URI baseInputDir,
                                                URI inputFile,
                                                URI outputDir)
        Generate a relative output directory path when `useRelativePath` flag is on. This method will compute the relative path based on `inputFile` and `baseInputDir`, then apply only the directory part of relative path to `outputDir`. E.g. baseInputDir = "/path/to/input" inputFile = "/path/to/input/a/b/c/d.avro" outputDir = "/path/to/output" getRelativeOutputPath(baseInputDir, inputFile, outputDir) = /path/to/output/a/b/c
      • getFileName

        public static String getFileName​(URI inputFileURI)
        Extract file name from a given URI.
        Parameters:
        inputFileURI -
        Returns:
      • getFileURI

        public static URI getFileURI​(String uriStr,
                                     URI fullUriForPathOnlyUriStr)
                              throws URISyntaxException
        Convert a File URI String to URI Object, use parent URI scheme/userInfo/host/port if sheme is not specified.
        Parameters:
        uriStr -
        fullUriForPathOnlyUriStr -
        Returns:
        Throws:
        URISyntaxException
      • getDirectoryURI

        public static URI getDirectoryURI​(String uriStr)
                                   throws URISyntaxException
        Convert Directory URI String to URI Object, default to local file system scheme.
        Parameters:
        uriStr -
        Returns:
        Throws:
        URISyntaxException