Class SegmentGenerationUtils
- java.lang.Object
-
- org.apache.pinot.common.segment.generation.SegmentGenerationUtils
-
public class SegmentGenerationUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringPINOT_PLUGINS_DIRstatic StringPINOT_PLUGINS_TAR_GZ
-
Method Summary
Modifier and Type Method Description static StringgenerateSchemaURI(String controllerUri, String table)static StringgenerateTableConfigURI(String controllerUri, String table)static URIgetDirectoryURI(String uriStr)Convert Directory URI String to URI Object, default to local file system scheme.static StringgetFileName(URI inputFileURI)Extract file name from a given URI.static URIgetFileURI(String uriStr, URI fullUriForPathOnlyUriStr)Convert a File URI String to URI Object, use parent URI scheme/userInfo/host/port if sheme is not specified.static URIgetRelativeOutputPath(URI baseInputDir, URI inputFile, URI outputDir)Generate a relative output directory path when `useRelativePath` flag is on.static SchemagetSchema(String schemaURIString)static SchemagetSchema(String schemaURIString, String authToken)static TableConfiggetTableConfig(String tableConfigURIStr)Deprecated.static TableConfiggetTableConfig(String tableConfigURIStr, String authToken)static List<String>listMatchedFilesWithRecursiveOption(PinotFS pinotFs, URI fileUri, String includePattern, String excludePattern, boolean searchRecursively)static StringsanitizeURIString(String path)
-
-
-
Field Detail
-
PINOT_PLUGINS_TAR_GZ
public static final String PINOT_PLUGINS_TAR_GZ
- See Also:
- Constant Field Values
-
PINOT_PLUGINS_DIR
public static final String PINOT_PLUGINS_DIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
generateTableConfigURI
public static String generateTableConfigURI(String controllerUri, String table)
-
getTableConfig
@Deprecated public static TableConfig getTableConfig(String tableConfigURIStr)
Deprecated.
-
getTableConfig
public static TableConfig getTableConfig(String tableConfigURIStr, 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
-
listMatchedFilesWithRecursiveOption
public static List<String> listMatchedFilesWithRecursiveOption(PinotFS pinotFs, URI fileUri, @Nullable String includePattern, @Nullable String excludePattern, boolean searchRecursively) throws Exception
- Parameters:
pinotFs- root directory fsfileUri- root directory uriincludePattern- optional glob patterns for files to includeexcludePattern- optional glob patterns for files to excludesearchRecursively- if ture, search files recursively from directory specified in fileUri- Returns:
- list of matching files.
- Throws:
IOException- on IO failure for list files in root directory.URISyntaxException- for matching file URIsRuntimeException- if there is no matching file.Exception
-
-