[ 
https://issues.apache.org/jira/browse/FLUME-2286?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13859645#comment-13859645
 ] 

Joshua Hyde edited comment on FLUME-2286 at 12/31/13 8:04 PM:
--------------------------------------------------------------

Digging into it a bit further, the exact error message above was because my 
code looked something like this:

{code}
private static LoadingCache<String, Integer> buildCache() {
    return CacheBuilder.newBuilder().maximumSize(10000).build(new 
MyCacheLoader());
}
{code}

It looks like, in version 11.0 and above of Guava, CacheBuilder has a method of 
{{maximumSize(long)}}, but 10.0.1 has a method of {{maximumSize(int)}}, and 
that isn't a backwards-compatible bytecode difference.


was (Author: jrh3k5):
Digging into it a bit further, the exact error message above was because my 
code looked something like this:

{code}
private static LoadingCache<String, Integer> buildCache() {
    return CacheBuilder.newBuilder().maximumSize(10000).build(new 
MyCacheLoader());
}
{code}

It looks like, in version 14.0.1 of Guava, CacheBuilder has a method of 
{{maximumSize(long)}}, but 10.0.1 has a method of {{maximumSize(int)}}, and 
that isn't a backwards-compatible bytecode difference.

> Upgrade Guava version to 14.0.1
> -------------------------------
>
>                 Key: FLUME-2286
>                 URL: https://issues.apache.org/jira/browse/FLUME-2286
>             Project: Flume
>          Issue Type: Wish
>            Reporter: Joshua Hyde
>            Priority: Minor
>
> I wrote a custom Sink as a Flume plugin that uses code that leverages the 
> {{CacheBuilder}} class provided by Guava. The problem was that my code uses 
> Guava 14.0.1, and I ended up with this error:
> {noformat}
> 31 Dec 2013 11:11:45,071 ERROR 
> [SinkRunner-PollingRunner-DefaultSinkProcessor] 
> (my.package.CustomSink.process:104)  - Failed to process events.
> java.lang.NoSuchMethodError: 
> com.google.common.cache.CacheBuilder.maximumSize(J)Lcom/google/common/cache/CacheBuilder;
>       at my.package.CustomSink.process(CustomSink.java:90)
>       at 
> org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:68)
>       at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:147)
>       at java.lang.Thread.run(Thread.java:744)
> {noformat}
> Thankfully, I have direct control over the code that uses Guava 14.0.1 and 
> can download it to the version used by Flume (10.0.1 at time of writing 
> this), but it'd be nice if I didn't have to downgrade my code base for this.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to