Permalink
Browse files

remove excess List wrapping

  • Loading branch information...
1 parent 6c5ac41 commit fda4a6203c191ec2063f8150ddafcecdef1e440f @markhamstra committed Apr 16, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 examples/TransactionalGlobalCount.scala
@@ -13,30 +13,31 @@ import backtype.storm.coordination.BatchOutputCollector
import backtype.storm.task.TopologyContext
import backtype.storm.topology.OutputFieldsDeclarer
import backtype.storm.transactional.{TransactionAttempt, ICommitter, TransactionalTopologyBuilder}
+import java.util.Map
object TransactionalGlobalCount {
val PARTITION_TAKE_PER_BATCH = 3
val DATA = new HashMap[java.lang.Integer, java.util.List[java.util.List[AnyRef]]]()
- DATA += ( (0, List[java.util.List[AnyRef]](List(new Values("cat"),
+ DATA += ( (0, List[java.util.List[AnyRef]](new Values("cat"),
new Values("dog"),
new Values("chicken"),
new Values("cat"),
new Values("dog"),
- new Values("apple"))))
- , (1, List[java.util.List[AnyRef]](List(new Values("cat"),
+ new Values("apple")))
+ , (1, List[java.util.List[AnyRef]](new Values("cat"),
new Values("dog"),
new Values("apple"),
- new Values("banana"))))
- , (2, List[java.util.List[AnyRef]](List(new Values("cat"),
+ new Values("banana")))
+ , (2, List[java.util.List[AnyRef]](new Values("cat"),
new Values("cat"),
new Values("cat"),
new Values("cat"),
new Values("cat"),
new Values("dog"),
new Values("dog"),
new Values("dog"),
- new Values("dog"))))
+ new Values("dog")))
)
class Value {
@@ -49,7 +50,7 @@ object TransactionalGlobalCount {
val GLOBAL_COUNT_KEY = "GLOBAL-COUNT"
class BatchCount extends BaseBatchBolt {
- var _id: Object = null.asInstanceOf[Object]
+ var _id: TransactionAttempt = null
var _collector: BatchOutputCollector = null
var _count: java.lang.Integer = 0
@@ -69,7 +70,6 @@ object TransactionalGlobalCount {
override def declareOutputFields(declarer: OutputFieldsDeclarer) {
declarer declare(new Fields("id", "count"))
}
-
}

0 comments on commit fda4a62

Please sign in to comment.