kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject git commit: kafka-933; Hadoop example running DataGenerator causes kafka.message.Message cannot be cast to [B exception; patched by drunkedcat; reviewed by Jun Rao
Date Fri, 22 Nov 2013 05:36:51 GMT
Updated Branches:
  refs/heads/trunk cd81d37ac -> 99dd94c9b


kafka-933; Hadoop example running DataGenerator causes kafka.message.Message cannot be cast
to [B exception; patched by drunkedcat; reviewed by Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/99dd94c9
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/99dd94c9
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/99dd94c9

Branch: refs/heads/trunk
Commit: 99dd94c9b659775e738e12330d90ae7ebe7bdbb6
Parents: cd81d37
Author: drunkedcat <whitelilis@gmail.com>
Authored: Thu Nov 21 21:37:34 2013 -0800
Committer: Jun Rao <junrao@gmail.com>
Committed: Thu Nov 21 21:37:34 2013 -0800

----------------------------------------------------------------------
 .../src/main/java/kafka/etl/impl/DataGenerator.java               | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/99dd94c9/contrib/hadoop-consumer/src/main/java/kafka/etl/impl/DataGenerator.java
----------------------------------------------------------------------
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 4b1d117..f3fb3fd 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<Integer, Message>(_topic, null, message));
+            list.add(new KeyedMessage<Integer, byte[]>(_topic, null, bytes));
 		}
 		// send events
 		System.out.println(" send " + list.size() + " " + _topic + " count events to " + _uri);


Mime
View raw message