----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/6650/#review10517 -----------------------------------------------------------
The major thing missing at this point is a testcase. Since this a command line tool the JUnit testcase should invoke metatool by calling its main() method. I also think it would be a good idea to create a separate class for this (e.g. TestHiveMetaTool) instead of adding it to something that already exists like TestHiveMetaStore. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22506> I think we should change the package to either o.a.h.hive.metastore.tools or o.a.h.hive.metastore.utils metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22507> Formatting. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22508> No point including an empty finally block. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22509> Formatting: '{' always go on the same line. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22510> Please move this to MetaStoreUtils and have this class and ObjectStore depend on the same version. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22525> So I realize this probably contradicts what I said earlier, but after looking more closely at this I think the methods that reference the pm (e.g. executeSelect, executeUpdate, etc), should be moved into ObjectStore, along with a note explaining that these are *NOT* to be exposed through the Metastore Thrift interface. If we take this route then it won't be necessary to duplicate code (or copy duplicated code over to a Utils class). Please also change the names of these methods to executeJDOQLUpdate, executeJDOQLSelect, etc. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22511> Please use 2 spaces for indents. I think this problem exists in a couple other places. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22505> Formatting: TAB metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22514> Please use commons-cli for handing command line arguments. Take a look at cli/src/java/org/apache/hadoop/hive/cli/OptionsProcessor.java for an example of how to do this. metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java <https://reviews.apache.org/r/6650/#comment22516> Formatting. - Carl Steinbach On Aug. 16, 2012, 2:33 a.m., Shreepadma Venugopalan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/6650/ > ----------------------------------------------------------- > > (Updated Aug. 16, 2012, 2:33 a.m.) > > > Review request for hive and Carl Steinbach. > > > Description > ------- > > This patch implement hive metatool which, > > * lets admins perform a HA upgrade by patching the location of the NN in > Hive's metastore > * allows JDOQL to be executed against the metastore. > > Additionally this patch also upgrades DN to 3.0 > > > This addresses bug HIVE-3056. > https://issues.apache.org/jira/browse/HIVE-3056 > > > Diffs > ----- > > bin/ext/metatool.sh PRE-CREATION > bin/metatool PRE-CREATION > build.xml 6712af9 > common/src/java/org/apache/hadoop/hive/conf/HiveConf.java 7ab76f9 > conf/hive-default.xml.template fa92bb1 > ivy/libraries.properties f0b1918 > metastore/ivy.xml 3011d2f > metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaTool.java > PRE-CREATION > ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java ccb0d7f > > Diff: https://reviews.apache.org/r/6650/diff/ > > > Testing > ------- > > Manual testing for various metatool options. > > > Thanks, > > Shreepadma Venugopalan > >