public class TransactionalWords extends Object
This class defines a more involved transactional topology then TransactionalGlobalCount. This topology processes a stream of words and produces two outputs:
1. A count for each word (stored in a database) 2. The number of words for every bucket of 10 counts. So it stores in the database how many words have appeared 0-9 times, how many have appeared 10-19 times, and so on. A batch of words can cause the bucket counts to decrement for some buckets and increment for others as words move between buckets as their counts accumulate.Modifier and Type | Class and Description |
---|---|
static class |
TransactionalWords.BucketCountUpdater |
static class |
TransactionalWords.Bucketize |
static class |
TransactionalWords.BucketValue |
static class |
TransactionalWords.CountValue |
static class |
TransactionalWords.KeyedCountUpdater |
Modifier and Type | Field and Description |
---|---|
static Map<Integer,TransactionalWords.BucketValue> |
BUCKET_DATABASE |
static int |
BUCKET_SIZE |
static Map<String,TransactionalWords.CountValue> |
COUNT_DATABASE |
static Map<Integer,List<List<Object>>> |
DATA |
static int |
PARTITION_TAKE_PER_BATCH |
Constructor and Description |
---|
TransactionalWords() |
public static final int BUCKET_SIZE
public static Map<String,TransactionalWords.CountValue> COUNT_DATABASE
public static Map<Integer,TransactionalWords.BucketValue> BUCKET_DATABASE
public static final int PARTITION_TAKE_PER_BATCH
Copyright © 2022 The Apache Software Foundation. All Rights Reserved.