[
https://issues.apache.org/jira/browse/FLUME-1766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510267#comment-13510267
]
Mike Percy commented on FLUME-1766:
-----------------------------------
Hi Jeff, thanks for this patch!
Since you are essentially defining constants (portKey, bindKey), please declare
them in all-caps, like the following:
{noformat}
private final static String PORT_KEY = "port";
private final static String BIND_KEY = "bind";
{noformat}
and then use those constants in the rest of the configure() method. For
example, instead of
{noformat}
port = context.getInteger("port");
{noformat}
prefer:
{noformat}
port = context.getInteger(PORT_KEY);
{noformat}
Finally, please make sure your indentation is consistent with the rest of the
file. Flume uses 2 spaces everywhere.
Thanks!
> AvroSource throws confusing exception when configured without a port
> --------------------------------------------------------------------
>
> Key: FLUME-1766
> URL: https://issues.apache.org/jira/browse/FLUME-1766
> Project: Flume
> Issue Type: Bug
> Components: Sinks+Sources
> Affects Versions: v1.3.0
> Reporter: Mike Percy
> Assignee: Jeff Lord
> Priority: Minor
> Labels: newbie
> Fix For: v1.4.0
>
> Attachments: FLUME-1766-1.patch
>
>
> 2012-12-03 18:25:08,210 (conf-file-poller-0) [DEBUG -
> org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:74)]
> Creating instance of source src-1, type AVRO
> 2012-12-03 18:25:08,235 (conf-file-poller-0) [ERROR -
> org.apache.flume.conf.file.AbstractFileConfigurationProvider$FileWatcherRunnable.run(AbstractFileConfigurationProvider.java:204)]
> Failed to load configuration data. Exception follows.
> java.lang.NumberFormatException: null
> at java.lang.Integer.parseInt(Integer.java:417)
> at java.lang.Integer.parseInt(Integer.java:499)
> at org.apache.flume.source.AvroSource.configure(AvroSource.java:126)
> at org.apache.flume.conf.Configurables.configure(Configurables.java:41)
> at
> org.apache.flume.conf.properties.PropertiesFileConfigurationProvider.loadSources(PropertiesFileConfigurationProvider.java:323)
> at
> org.apache.flume.conf.properties.PropertiesFileConfigurationProvider.load(PropertiesFileConfigurationProvider.java:222)
> at
> org.apache.flume.conf.file.AbstractFileConfigurationProvider.doLoad(AbstractFileConfigurationProvider.java:123)
> at
> org.apache.flume.conf.file.AbstractFileConfigurationProvider.access$300(AbstractFileConfigurationProvider.java:38)
> at
> org.apache.flume.conf.file.AbstractFileConfigurationProvider$FileWatcherRunnable.run(AbstractFileConfigurationProvider.java:202)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
> at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:680)
> ^C2012-12-03 18:25:17,989 (node-shutdownHook) [INFO -
> org.apache.flume.node.FlumeNode.stop(FlumeNode.java:67)] Flume node stopping
> - agent
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira