How about calling setQuietMode(false) before your check and turn it on after the check ? This should give the user more clue in case of version mismatch.
On Thu, Feb 17, 2011 at 4:32 PM, Todd Lipcon <[email protected]> wrote: > Yes, it has always been an implicit requirement. Now it is an explicit one, > because we found people didn't listen to the implicit one. > > > On Thu, Feb 17, 2011 at 4:29 PM, Ted Yu <[email protected]> wrote: > >> Was this a requirement for 0.20.6 and 0.89 ? >> >> On Thu, Feb 17, 2011 at 4:25 PM, Todd Lipcon <[email protected]> wrote: >> >> > On Thu, Feb 17, 2011 at 4:19 PM, Ted Yu <[email protected]> wrote: >> > >> >> My earlier point was that we shouldn't require hbase-default.xml to be >> >> present in the classpath because users may repackage hbase jar. >> >> We should fault out if there *is* one hbase-default.xml in the >> classpath >> >> *and* it doesn't contain the correct version value. >> > >> > >> > Yes, we should require hbase-default.xml. It is a necessary part of >> hbase. >> > If you don't have it, it should fail. >> > >> > >> >> >> >> >> >> On Thu, Feb 17, 2011 at 4:13 PM, Todd Lipcon <[email protected]> >> wrote: >> >> >> >>> On Thu, Feb 17, 2011 at 4:03 PM, Ted Yu <[email protected]> wrote: >> >>> >> >>>> An alternative is to check the value of a well-known config parameter >> >>>> which >> >>>> has changed from 20.6 (0.89) to 0.90.x >> >>>> >> >>>> After almost all 0.20.6 and 0.89 deployments are gone in the world, >> >>>> toggle >> >>>> to version check. >> >>>> >> >>> >> >>> Better would be to use the classloader to find the hbase-default.xml >> path >> >>> that got loaded and include that in the error. File a JIRA and let's >> fix for >> >>> 0.90.2. >> >>> >> >>> -Todd >> >>> >> >>> >> >>>> >> >>>> On Thu, Feb 17, 2011 at 3:51 PM, Ted Yu <[email protected]> wrote: >> >>>> >> >>>> > Your change cannot distinguish missing hbase-default.xml and the >> old >> >>>> > hbase-default.xml >> >>>> > This makes debugging hard, considering what I said in my first >> email. >> >>>> > >> >>>> > >> >>>> > On Thu, Feb 17, 2011 at 3:26 PM, Todd Lipcon <[email protected]> >> >>>> wrote: >> >>>> > >> >>>> >> Then you've probably got another hbase-default somewhere on your >> >>>> >> classpath. >> >>>> >> >> >>>> >> >> >>>> >> On Thu, Feb 17, 2011 at 3:26 PM, Ted Yu <[email protected]> >> wrote: >> >>>> >> >> >>>> >>> I checked the size of the packaged file which is the same as the >> >>>> build >> >>>> >>> artifact: >> >>>> >>> >> >>>> >>> tyumac:hbase-0.90.1 tyu$ ls -l target/classes/hbase-default.xml >> >>>> >>> -rw-r--r-- 1 tyu staff 23610 Feb 11 11:50 >> >>>> >>> target/classes/hbase-default.xml >> >>>> >>> >> >>>> >>> I also unpacked the file and saw the correct version. >> >>>> >>> >> >>>> >>> >> >>>> >>> On Thu, Feb 17, 2011 at 3:17 PM, Todd Lipcon <[email protected]> >> >>>> wrote: >> >>>> >>> >> >>>> >>>> Where are you getting the hbase-defaults.xml file that you're >> >>>> packaging >> >>>> >>>> into your jar? >> >>>> >>>> >> >>>> >>>> You need to take it out of the hbase jar that ships with 0.90.1 >> and >> >>>> >>>> package that one -- my guess is you've packaged one from an >> older >> >>>> version. >> >>>> >>>> >> >>>> >>>> -Todd >> >>>> >>>> >> >>>> >>>> On Thu, Feb 17, 2011 at 3:01 PM, Ted Yu <[email protected]> >> >>>> wrote: >> >>>> >>>> >> >>>> >>>>> We re-package hbase jar into the jar containing our classes. >> >>>> >>>>> >> >>>> >>>>> [sjc1-hadoop0.sjc1:hadoop 36789]jar tvf >> >>>> >>>>> /usr/local/hadoop/sims/lib/flow-m2m_hbase_regr-38.jar | grep >> >>>> MetaSca >> >>>> >>>>> 7030 Fri Feb 11 11:50:28 GMT+00:00 2011 >> >>>> >>>>> org/apache/hadoop/hbase/client/MetaScanner.class >> >>>> >>>>> 2027 Fri Feb 11 11:50:28 GMT+00:00 2011 >> >>>> >>>>> org/apache/hadoop/hbase/client/MetaScanner$1.class >> >>>> >>>>> [sjc1-hadoop0.sjc1:hadoop 36791]jar tvf >> >>>> >>>>> /usr/local/hadoop/sims/lib/flow-m2m_hbase_regr-38.jar | grep >> >>>> default | >> >>>> >>>>> grep >> >>>> >>>>> hbase >> >>>> >>>>> 23610 Fri Feb 11 11:50:22 GMT+00:00 2011 hbase-default.xml >> >>>> >>>>> >> >>>> >>>>> If the above jar structure is incorrect, please comment. >> >>>> >>>>> >> >>>> >>>>> Using 0.90.1 jar as client, I saw: >> >>>> >>>>> >> >>>> >>>>> INFO [2011-02-17 06:52:23] (ExecUtil.java:261) - >> >>>> >>>>> java.lang.RuntimeException: hbase-default.xml file seems to be >> for >> >>>> and >> >>>> >>>>> old version of HBase (null), this version is 0.90.1 >> >>>> >>>>> INFO [2011-02-17 06:52:23] (ExecUtil.java:261) - at >> >>>> >>>>> >> >>>> >>>>> >> >>>> >> org.apache.hadoop.hbase.HBaseConfiguration.checkDefaultsVersion(HBaseConfiguration.java:66) >> >>>> >>>>> INFO [2011-02-17 06:52:23] (ExecUtil.java:261) - at >> >>>> >>>>> >> >>>> >>>>> >> >>>> >> org.apache.hadoop.hbase.HBaseConfiguration.addHbaseResources(HBaseConfiguration.java:76) >> >>>> >>>>> INFO [2011-02-17 06:52:23] (ExecUtil.java:261) - at >> >>>> >>>>> >> >>>> >>>>> >> >>>> >> org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:44) >> >>>> >>>>> INFO [2011-02-17 06:52:23] (ExecUtil.java:261) - at >> >>>> >>>>> >> >>>> >>>>> >> >>>> >> org.apache.hadoop.hbase.HBaseConfiguration.<init>(HBaseConfiguration.java:56) >> >>>> >>>>> >> >>>> >>>>> I looked at Configuration.java which has quiet mode setter. But >> >>>> the >> >>>> >>>>> above >> >>>> >>>>> exception happened in ctor. >> >>>> >>>>> >> >>>> >>>>> Please advise how I can troubleshoot this. >> >>>> >>>>> >> >>>> >>>> >> >>>> >>>> >> >>>> >>>> >> >>>> >>>> -- >> >>>> >>>> Todd Lipcon >> >>>> >>>> Software Engineer, Cloudera >> >>>> >>>> >> >>>> >>> >> >>>> >>> >> >>>> >> >> >>>> >> >> >>>> >> -- >> >>>> >> Todd Lipcon >> >>>> >> Software Engineer, Cloudera >> >>>> >> >> >>>> > >> >>>> > >> >>>> >> >>> >> >>> >> >>> >> >>> -- >> >>> Todd Lipcon >> >>> Software Engineer, Cloudera >> >>> >> >> >> >> >> > >> > >> > -- >> > Todd Lipcon >> > Software Engineer, Cloudera >> > >> > > > > -- > Todd Lipcon > Software Engineer, Cloudera >
