Return-Path: X-Original-To: apmail-flume-user-archive@www.apache.org Delivered-To: apmail-flume-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AA0FFD4BA for ; Thu, 6 Dec 2012 19:52:46 +0000 (UTC) Received: (qmail 49895 invoked by uid 500); 6 Dec 2012 19:52:46 -0000 Delivered-To: apmail-flume-user-archive@flume.apache.org Received: (qmail 49858 invoked by uid 500); 6 Dec 2012 19:52:46 -0000 Mailing-List: contact user-help@flume.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@flume.apache.org Delivered-To: mailing list user@flume.apache.org Received: (qmail 49850 invoked by uid 99); 6 Dec 2012 19:52:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 19:52:46 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of brock@cloudera.com designates 209.85.216.44 as permitted sender) Received: from [209.85.216.44] (HELO mail-qa0-f44.google.com) (209.85.216.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 19:52:39 +0000 Received: by mail-qa0-f44.google.com with SMTP id z4so1314372qan.17 for ; Thu, 06 Dec 2012 11:52:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=XT+RujaQlKjwnM/uU8v9fFVgKYG1K66Rt3HRW89m+Aw=; b=hDzce9kQd3Xsw7UU4zvzD6fz6c5Tl3vQG4st/nBUyUxuAEn+kd8Q2IybO5b9pHA1j7 en88xHR6sEeIcn9pnLTCvvOVwB9GI3sY8ljGxRtdoOF/K/On1n5I6UJEtJ/XB3IN7Kp7 dWRSFKNze63yWHxegfr/4TkBZRMw1hzKYlvrvEJiet6Vf13WIangeOdbzau/YI5pKKqh uaG6KcznBK7cyfJdKeHcMSIWjyzfvfO/xqw3+r8FB9nafZ8U0KnjXFWX2XizHDs3Gd3t Z49qJ1Pi5TAQ/WdBmAsI+IhKB9zlIMh+hU8lhQUdlbankL3GkA1hkCBa0rneTgjnhwjd ka1w== Received: by 10.224.174.67 with SMTP id s3mr4942496qaz.95.1354823538835; Thu, 06 Dec 2012 11:52:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.106.162 with HTTP; Thu, 6 Dec 2012 11:51:58 -0800 (PST) In-Reply-To: References: <0011414263E69B4FB3ADD3E568E142D9015D91B6@IMCMBX03.MITRE.ORG> <0011414263E69B4FB3ADD3E568E142D9015D91D2@IMCMBX03.MITRE.ORG> <0011414263E69B4FB3ADD3E568E142D9015D94F9@IMCMBX03.MITRE.ORG> From: Brock Noland Date: Thu, 6 Dec 2012 13:51:58 -0600 Message-ID: Subject: Re: AVRO_EVENT problem To: "user@flume.apache.org" Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQmn5n8NKnP6l775EkPFNAqSPKwiW58okedVMoyEzisJEyVnjtOJrFTQd+Tu4bQfmFUC8TuA X-Virus-Checked: Checked by ClamAV on apache.org OK, I don't really understand how Avro is working here, but I think you should try FileChannel or maybe MemoryChannel for simplicity to see if that works. IE, I think the problem is JDBCChannel. Can you let me know how it turns out? On Thu, Dec 6, 2012 at 1:45 PM, Brock Noland wrote: > Hmm, looks like I missed something..Not familiar with this code. > > On Thu, Dec 6, 2012 at 1:29 PM, DeCarlo, Thom wrote: >> Hmmm... How does one define/check/set the schema? I lifted my configuration straight from the on-line documentation and it only mentions a schema in the JDBC Channel section. >> >> -- >> Thom DeCarlo >> >> >> -----Original Message----- >> From: Brock Noland [mailto:brock@cloudera.com] >> Sent: Thursday, December 06, 2012 1:57 PM >> To: user@flume.apache.org >> Subject: Re: AVRO_EVENT problem >> >> It seems to me like the object you are trying to write doesn't match >> the Schema? I'd check your convert() method. >> >> On Thu, Dec 6, 2012 at 9:09 AM, DeCarlo, Thom wrote: >>> Oh, right... forgot the version. I'm using the latest (as of yesterday) from the git repository. It gets built as 1.4-SNAPSHOT. >>> >>> -- >>> Thom DeCarlo >>> >>> >>> -----Original Message----- >>> From: Brock Noland [mailto:brock@cloudera.com] >>> Sent: Thursday, December 06, 2012 10:06 AM >>> To: user@flume.apache.org >>> Subject: Re: AVRO_EVENT problem >>> >>> Hi, >>> >>> Hopefully someone will be able to answer the AVRO issue, in order to >>> help them, what version of Flume are you running? >>> >>> Brock >>> >>> On Thu, Dec 6, 2012 at 8:59 AM, DeCarlo, Thom wrote: >>>> Hi, >>>> I'm just getting started with flume, so I apologize if this is an already known problem. >>>> >>>> I'm trying to set up a FILE_ROLL sink that uses the AVRO_EVENT serializer. But, when I start the agent I get an exception thrown from within the AVRO DataFileWriter class. It is failing when trying to cast a java.util.ArrayList to java.util.Map. >>>> >>>> Can anyone tell me how this is supposed to work? >>>> >>>> OBTW, I'm running on Windows 7 (64-bit), and I've tried both the 32- and 64-bit versions of both Java 1.6.0_37 and 1.7.0_09, with the same results. >>>> >>>> Thanks, >>>> Thom >>>> -- >>>> The console output looks like this: >>>> >>>> 2012-12-04 14:24:25,111 (lifecycleSupervisor-1-4) [INFO - org.apache.flume.sink.RollingFileSink.start(RollingFileSink.java:135)] RollingFileSink fileSink-1 started. >>>> 2012-12-04 14:24:25,145 (lifecycleSupervisor-1-2) [INFO - org.apache.flume.source.NetcatSource.start(NetcatSource.java:164)] Created serverSocket:sun.nio.ch.ServerSocketChannelImpl[/127.0.0.1:33333] >>>> 2012-12-04 14:24:25,593 (SinkRunner-PollingRunner-DefaultSinkProcessor) [WARN - org.apache.flume.channel.jdbc.impl.JdbcTransactionImpl.rollback(JdbcTransactionImpl.java:102)] Marking transaction for rollback >>>> 2012-12-04 14:24:25,594 (SinkRunner-PollingRunner-DefaultSinkProcessor) [INFO - org.apache.flume.channel.jdbc.impl.JdbcTransactionImpl.close(JdbcTransactionImpl.java:118)] Attempting transaction roll-back >>>> 2012-12-04 14:24:25,604 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:160)] Unable to deliver event. Exception follows. >>>> org.apache.flume.EventDeliveryException: Failed to process transaction >>>> at org.apache.flume.sink.RollingFileSink.process(RollingFileSink.java:218) >>>> 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:722) >>>> Caused by: org.apache.avro.file.DataFileWriter$AppendWriteException: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map >>>> at org.apache.avro.file.DataFileWriter.append(DataFileWriter.java:263) >>>> at org.apache.flume.serialization.AbstractAvroEventSerializer.write(AbstractAvroEventSerializer.java:108) >>>> at org.apache.flume.sink.RollingFileSink.process(RollingFileSink.java:195) >>>> ... 3 more >>>> Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.util.Map >>>> at org.apache.avro.generic.GenericDatumWriter.getMapSize(GenericDatumWriter.java:174) >>>> at org.apache.avro.generic.GenericDatumWriter.writeMap(GenericDatumWriter.java:159) >>>> at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:68) >>>> at org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:104) >>>> at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:105) >>>> at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:65) >>>> at org.apache.avro.reflect.ReflectDatumWriter.write(ReflectDatumWriter.java:104) >>>> at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:57) >>>> at org.apache.avro.file.DataFileWriter.append(DataFileWriter.java:257) >>>> ... 5 more >>>> >>>> -- >>>> My config file looks like this: >>>> >>>> ######################################## >>>> # Sources >>>> ######################################## >>>> agent1.sources = source1 >>>> >>>> # Describe/configure source1 >>>> agent1.sources.source1.type = netcat >>>> agent1.sources.source1.bind = localhost >>>> agent1.sources.source1.port = 33333 >>>> agent1.sources.source1.interceptors = inter1 inter2 >>>> agent1.sources.source1.interceptors.inter1.type = timestamp >>>> agent1.sources.source1.interceptors.inter2.type = host >>>> agent1.sources.source1.interceptors.inter2.hostHeader = hostname >>>> >>>> ######################################## >>>> # Channels >>>> ######################################## >>>> agent1.channels = channel1 jdbcChannel-1 >>>> >>>> # Use a channel which buffers events in memory >>>> agent1.channels.channel1.type = memory >>>> agent1.channels.channel1.capacity = 1000 >>>> agent1.channels.channel1.transactionCapacity = 100 >>>> >>>> # Add a channel which uses JDBC to buffer messages >>>> agent1.channels.jdbcChannel-1.type = jdbc >>>> >>>> ######################################## >>>> # Sinks >>>> ######################################## >>>> agent1.sinks = sink1 fileSink-1 >>>> >>>> # Describe sink1, a simple console Logger Sink >>>> agent1.sinks.sink1.type = logger >>>> >>>> #Describe fileSink-1, which writes to a file >>>> agent1.sinks.fileSink-1.type = FILE_ROLL >>>> agent1.sinks.fileSink-1.sink.directory = c:/flume/logs >>>> agent1.sinks.fileSink-1.sink.rollInterval = 3600 >>>> #agent1.sinks.fileSink-1.sink.serializer = org.apache.flume.serialization.HeaderAndBodyTextEventSerializer$Builder >>>> agent1.sinks.fileSink-1.sink.serializer = AVRO_EVENT >>>> agent1.sinks.fileSink-1.sink.serializer.compressionCodec = snappy >>>> >>>> ######################################## >>>> # Bindings >>>> ######################################## >>>> # Bind the source and sink to the channel >>>> agent1.sources.source1.channels = channel1 jdbcChannel-1 >>>> agent1.sinks.sink1.channel = channel1 >>>> agent1.sinks.fileSink-1.channel = jdbcChannel-1 >>>> >>>> >>>> -- >>>> Thom DeCarlo >>>> >>> >>> >>> >>> -- >>> Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/ >> >> >> >> -- >> Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/ > > > > -- > Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/ -- Apache MRUnit - Unit testing MapReduce - http://incubator.apache.org/mrunit/