From 99dd94c9b659775e738e12330d90ae7ebe7bdbb6 Mon Sep 17 00:00:00 2001 From: drunkedcat Date: Thu, 21 Nov 2013 21:37:34 -0800 Subject: [PATCH] kafka-933; Hadoop example running DataGenerator causes kafka.message.Message cannot be cast to [B exception; patched by drunkedcat; reviewed by Jun Rao --- .../src/main/java/kafka/etl/impl/DataGenerator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java b/contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java index 4b1d117462d..f3fb3fd9986 100644 --- a/contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java +++ b/contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java @@ -86,8 +86,7 @@ public class DataGenerator { Long timestamp = RANDOM.nextLong(); if (timestamp < 0) timestamp = -timestamp; byte[] bytes = timestamp.toString().getBytes("UTF8"); - Message message = new Message(bytes); - list.add(new KeyedMessage(_topic, null, message)); + list.add(new KeyedMessage(_topic, null, bytes)); } // send events System.out.println(" send " + list.size() + " " + _topic + " count events to " + _uri);