Repository: incubator-gobblin Updated Branches: refs/heads/master 647319ca6 -> bfc250fac
[GOBBLIN-342] Introduce option to set hive metastore uri in Hiveregister Closes #2198 from treff7es/set_hive_metastore_in_registration Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/bfc250fa Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/bfc250fa Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/bfc250fa Branch: refs/heads/master Commit: bfc250faceb9bae6fe63d5f5efc9659129806ddb Parents: 647319c Author: treff7es <[email protected]> Authored: Tue Dec 12 01:26:14 2017 -0800 Committer: Abhishek Tiwari <[email protected]> Committed: Tue Dec 12 01:26:14 2017 -0800 ---------------------------------------------------------------------- .../src/main/java/org/apache/gobblin/hive/HiveRegister.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/bfc250fa/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegister.java ---------------------------------------------------------------------- diff --git a/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegister.java b/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegister.java index 82d205b..08a4f10 100644 --- a/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegister.java +++ b/gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/HiveRegister.java @@ -66,6 +66,7 @@ public abstract class HiveRegister implements Closeable { public static final String DEFAULT_HIVE_TABLE_COMPARATOR_TYPE = HiveTableComparator.class.getName(); public static final String HIVE_PARTITION_COMPARATOR_TYPE = "hive.partition.comparator.type"; public static final String DEFAULT_HIVE_PARTITION_COMPARATOR_TYPE = HivePartitionComparator.class.getName(); + public static final String HIVE_METASTORE_URI_KEY = "hive.metastore.uri"; protected static final String HIVE_DB_EXTENSION = ".db"; @@ -353,7 +354,10 @@ public abstract class HiveRegister implements Closeable { * will be returned. This {@link State} object is also used to instantiate the {@link HiveRegister} object. */ public static HiveRegister get(State props) { - return get(props, Optional.<String> absent()); + Optional<String> metastoreUri = + Optional.fromNullable(props.getProperties().getProperty(HIVE_METASTORE_URI_KEY)); + + return get(props, metastoreUri); } /**
