Repository: trafodion Updated Branches: refs/heads/master 63e1083d1 -> cdc788e41
[TRAFODION-1966]TrafexportSnapshot ran into NoClassDefFoundError on HDP2.4 Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/6f60da57 Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/6f60da57 Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/6f60da57 Branch: refs/heads/master Commit: 6f60da57df0d2c8f2e0c26588298dcaf7e3b7cfa Parents: 8e332e5 Author: Liu Ming <[email protected]> Authored: Sun Jan 14 03:08:53 2018 +0000 Committer: Liu Ming <[email protected]> Committed: Sun Jan 14 03:08:53 2018 +0000 ---------------------------------------------------------------------- .../backup_and_restore/run_full_trafodion_backup.sh | 9 +++++++++ .../utility/backuprestore/TrafExportSnapshot.java | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafodion/blob/6f60da57/core/sqf/hbase_utilities/backup_and_restore/run_full_trafodion_backup.sh ---------------------------------------------------------------------- diff --git a/core/sqf/hbase_utilities/backup_and_restore/run_full_trafodion_backup.sh b/core/sqf/hbase_utilities/backup_and_restore/run_full_trafodion_backup.sh index d36f665..8f7972b 100755 --- a/core/sqf/hbase_utilities/backup_and_restore/run_full_trafodion_backup.sh +++ b/core/sqf/hbase_utilities/backup_and_restore/run_full_trafodion_backup.sh @@ -119,6 +119,15 @@ do esac done +#check the HBase compatiblity if TrafExportSnapshot is able to be used +java org.trafodion.utility.backuprestore.TrafExportSnapshot -test +if [[ $? -ne 0 ]]; then + echo 'not able to use TrafExportSnapshot' + mr_limit=0 +else + echo 'able to use TrafExportSnapshot' +fi + echo "logging output to: ${log_file}" #create tmp and log folders if they don't exist http://git-wip-us.apache.org/repos/asf/trafodion/blob/6f60da57/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java ---------------------------------------------------------------------- diff --git a/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java b/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java index 3abf8ac..c4003d3 100644 --- a/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java +++ b/core/sqf/hbase_utilities/src/main/java/org/trafodion/utility/backuprestore/TrafExportSnapshot.java @@ -1103,9 +1103,23 @@ public class TrafExportSnapshot extends Configured implements Tool { static int innerMain(final Configuration conf, final String [] args) throws Exception { return ToolRunner.run(conf, new TrafExportSnapshot(), args); } - + private void testMobAvail() { + MobUtils.getMobHome(HBaseConfiguration.create()); + } public static void main(String[] args) throws Exception { LOG.info("Trafodion Export Snapshot Utility"); + if(args.length == 1) + { + String cmd = args[0]; + if (cmd.equals("-h") || cmd.equals("--help")) { + System.exit(innerMain(HBaseConfiguration.create(), args)); + } + //test if MobUtils is aviable in this system + //doing something meanless + TrafExportSnapshot ti = new TrafExportSnapshot(); + ti.testMobAvail(); + System.exit(0); //normal + } System.exit(innerMain(HBaseConfiguration.create(), args)); } }
