Before Christmas, I posted a blog about my trouble to write a Flume Collector Sink Decorator Plugin. After doing some research and continue digging the underlining issue, I finally get a solution to this, which makes me super happy. The issue I had was caused by error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: garbagefilter/GarbageFilterDecorator : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at com.cloudera.flume.conf.SourceFactoryImpl.loadPluginBuilders(
at com.cloudera.flume.conf.SourceFactoryImpl.(
at com.cloudera.flume.conf.FlumeBuilder.(
at com.cloudera.flume.agent.LogicalNodeManager.spawn(
at com.cloudera.flume.agent.FlumeNode.setup(
at com.cloudera.flume.agent.FlumeNode.main(
This is due to the fact that I compiled my plugin under Java 1.7 and tried to run the .jar file under Java 1.6. This error did not appear in the flume log when I ran it as a service using command, which was why I had no clue on what was going on:
$ service flume-node start
It only appeared when I ran it directly on the command line:
$ flume node -n collector1
Not exactly sure why though. Anyway, it is now working, simply follow the steps outlined here. This is my first Java code in the last 5 years, wow. I think I will spend more time to write more Flume plugins as we need to push more jobs to Flume to do some post processing for us.

Leave a Reply

Your email address will not be published. Required fields are marked *