середа, 26 грудня 2012 р.

surprise in Hadoop log

When I started working with Hadoop I was confused by next message in logs:
  1. DEBUG conf.Configuration: java.io.IOException: config(config)
  2. at org.apache.hadoop.conf.Configuration.<init>(Configuration.java:225)
  3. at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:183)

It was Hadoop 1.0.3 and I didn't understand "what am I doing wrong?". It was just the newest Hadoop and I didn't find more information in Google, So, I was need to check source code... surprise! Look at it (line 4!):
  1. public Configuration(boolean loadDefaults) {
  2. this.loadDefaults = loadDefaults;
  3. if (LOG.isDebugEnabled()) {
  4. LOG.debug(StringUtils.stringifyException(new IOException("config()")));
  5. }
  6. synchronized(Configuration.class) {
  7. REGISTRY.put(this, null);
  8. }
  9. this.storeResource = false;
  10. }

I can't believe they always log exception... strange way to get stack trace? maybe...

Немає коментарів:

Дописати коментар