public final class Util extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Util.DatabaseBuilder
A builder for Database.
|
static class |
Util.PartitionBuilder
Builder of partitions.
|
static class |
Util.TableBuilder
Builder for Table.
|
static interface |
Util.ThrowingSupplier<T,E extends Exception>
Version of the Supplier that can throw exceptions.
|
Modifier and Type | Method and Description |
---|---|
static List<org.apache.hadoop.hive.metastore.api.FieldSchema> |
createSchema(@Nullable List<String> params)
Create table schema from parameters.
|
static List<String> |
filterMatches(@Nullable List<String> candidates,
@Nullable Pattern[] positivePatterns,
@Nullable Pattern[] negativePatterns)
Filter candidates - find all that match positive matches and do not match
any negative matches.
|
static @Nullable URI |
getServerUri(@Nullable String host,
@Nullable String portString)
Get server URI.
|
static <T> T |
throwingSupplierWrapper(Util.ThrowingSupplier<T,Exception> throwingSupplier)
Wrapper that moves all checked exceptions to RuntimeException.
|
public static <T> T throwingSupplierWrapper(Util.ThrowingSupplier<T,Exception> throwingSupplier)
T
- Supplier return typethrowingSupplier
- Supplier that throws Exceptionpublic static List<org.apache.hadoop.hive.metastore.api.FieldSchema> createSchema(@Nullable @Nullable List<String> params)
params
- list of parameters. Each parameter can be either a simple name or
name:type for non-String types.@Nullable public static @Nullable URI getServerUri(@Nullable @Nullable String host, @Nullable @Nullable String portString) throws URISyntaxException
HMS host is obtained from
host
- HMS host string.portString
- HMS portURISyntaxException
- if URI is is invalidpublic static List<String> filterMatches(@Nullable @Nullable List<String> candidates, @Nullable @Nullable Pattern[] positivePatterns, @Nullable @Nullable Pattern[] negativePatterns)
candidates
- list of candidate strings. If null, return an empty list.positivePatterns
- list of regexp that should all match. If null, everything matches.negativePatterns
- list of regexp, none of these should match. If null, everything matches.Copyright © 2018. All rights reserved.