Skip to content

Commit 8f3dd7e

Browse files
committed
Project dependency clean up. Added path to drop out of startup script when run from install directory.
Additional reporting details on silent LOCATION translation.
1 parent e06e3c7 commit 8f3dd7e

File tree

4 files changed

+27
-31
lines changed

4 files changed

+27
-31
lines changed

bin/hms-mirror

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ CURR_DIR=$(pwd)
2424

2525
echo "APP_DIR: $APP_DIR"
2626

27+
DO_NOT_FILE="${APP_DIR}/DO_NOT_RUN_APP_FROM_HERE.txt"
28+
if [ -f $DO_NOT_FILE ]; then
29+
echo "Do NOT run application from 'install' directory. If properly installed, the application will be in your PATH";
30+
exit 1
31+
fi
32+
2733
if [[ "${APP_DIR}" == "${HOME}/.hms-mirror/bin" ]]; then
2834
echo "Running from User Local Instance"
2935
else

bin/hms-mirror-cli

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env sh
22

3+
34
#
4-
# Copyright (c) 2022. Cloudera, Inc. All Rights Reserved
5+
# Copyright (c) 2022. David W. Streever All Rights Reserved
56
#
67
# Licensed under the Apache License, Version 2.0 (the "License");
78
# you may not use this file except in compliance with the License.
@@ -15,7 +16,6 @@
1516
# See the License for the specific language governing permissions and
1617
# limitations under the License.
1718
#
18-
#
1919

2020
# Resolve Symlinks of exe
2121
RESOLVED_EXE_PATH=`readlink -f $0`
@@ -25,6 +25,12 @@ CURR_DIR=$(pwd)
2525

2626
echo "APP_DIR: $APP_DIR"
2727

28+
DO_NOT_FILE="${APP_DIR}/DO_NOT_RUN_APP_FROM_HERE.txt"
29+
if [ -f $DO_NOT_FILE ]; then
30+
echo "Do NOT run application from 'install' directory. If properly installed, the application will be in your PATH";
31+
exit 1
32+
fi
33+
2834
if [[ "${APP_DIR}" == "${HOME}/.hms-mirror/bin" ]]; then
2935
echo "Running from User Local Instance"
3036
else
@@ -110,10 +116,10 @@ while [[ $# -gt 0 ]]; do
110116
export AUX_LIBS_DIR=$1
111117
shift
112118
;;
113-
# --hadoop-classpath)
114-
# shift
115-
# HADOOP_CLASSPATH="true"
116-
# ;;
119+
--hadoop-classpath)
120+
shift
121+
HADOOP_CLASSPATH="true"
122+
;;
117123
--show-cp)
118124
shift
119125
SHOW_CP="true"
@@ -154,8 +160,6 @@ if [[ "${HADOOP_CLASSPATH}x" != "x" ]]; then
154160
echo "Picking up local Hadoop Classpath Libs."
155161
SHADED=shaded-no-hadoop
156162
CMD_CP=$(hadoop classpath):${CMD_CP}
157-
echo "hms-mirror-cli with local Hadoop Classpath Libs not supported"
158-
exit 1
159163
else
160164
SHADED=shaded
161165
fi

pom.xml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<groupId>com.cloudera.utils.hadoop</groupId>
2424
<artifactId>hms-mirror</artifactId>
25-
<version>1.5.3.4-SNAPSHOT</version>
25+
<version>1.5.3.5-SNAPSHOT</version>
2626
<name>hms-mirror</name>
2727

2828
<url>https://github.com/dstreev/hms_mirror</url>
@@ -53,21 +53,16 @@
5353
<!-- Support Libs -->
5454
<javax.validation.version>2.0.1.Final</javax.validation.version>
5555
<jackson.version>2.13.3</jackson.version>
56-
<!-- Part of include Hadoop Libs-->
57-
<!-- <commons-cli.version>1.2</commons-cli.version>-->
58-
<commons-lang.version>3.11</commons-lang.version>
56+
5957
<commons-dbcp2.version>2.9.0</commons-dbcp2.version>
60-
<commons-cli.version>1.2</commons-cli.version>
61-
<commons-io.version>2.8.0</commons-io.version>
6258

6359
<jcabi.manifests.version>1.1</jcabi.manifests.version>
6460
<commonmark.version>0.17.1</commonmark.version>
6561

66-
<commons-io.version>2.4</commons-io.version>
6762
<commons-text.version>1.10.0</commons-text.version>
6863
<junit.version>4.13.1</junit.version>
6964

70-
<hadoop-cli.version>2.4.0.5.3-SNAPSHOT</hadoop-cli.version>
65+
<hadoop-cli.version>2.4.1.0</hadoop-cli.version>
7166

7267
</properties>
7368

@@ -105,16 +100,6 @@
105100
<artifactId>jcabi-manifests</artifactId>
106101
<version>${jcabi.manifests.version}</version>
107102
</dependency>
108-
<dependency>
109-
<groupId>commons-cli</groupId>
110-
<artifactId>commons-cli</artifactId>
111-
<version>${commons-cli.version}</version>
112-
</dependency>
113-
<dependency>
114-
<groupId>commons-io</groupId>
115-
<artifactId>commons-io</artifactId>
116-
<version>${commons-io.version}</version>
117-
</dependency>
118103
<dependency>
119104
<groupId>org.apache.commons</groupId>
120105
<artifactId>commons-text</artifactId>
@@ -127,11 +112,6 @@
127112
<artifactId>commons-dbcp2</artifactId>
128113
<version>${commons-dbcp2.version}</version>
129114
</dependency>
130-
<dependency>
131-
<groupId>org.apache.commons</groupId>
132-
<artifactId>commons-lang3</artifactId>
133-
<version>${commons-lang.version}</version>
134-
</dependency>
135115

136116
<!-- DB Libraries -->
137117
<dependency>

src/main/java/com/cloudera/utils/hadoop/hms/mirror/DBMirror.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,12 @@ public void buildDBStatements(Config config) {
194194
managedLocation = location;
195195
// Set to null to skip processing.
196196
location = null;
197+
this.addIssue(Environment.RIGHT, "The LEFT's DB 'LOCATION' element was defined " +
198+
"as the default 'managed' location in later versions of Hive3. " +
199+
"We've adjusted the DB to set the MANAGEDLOCATION setting instead, " +
200+
"to avoid future conflicts. If your target environment is HDP3, this setting " +
201+
"will FAIL since the MANAGEDLOCATION property for a Database doesn't exist. " +
202+
"Fix the source DB's location element to avoid this translation." );
197203
}
198204
}
199205

0 commit comments

Comments
 (0)