cassandra/examples/hadoop_word_count
Brandon Williams 8fd8832a87 Fix word count
Patch by  Ala' Alkhaldi, reviewed by brandonwilliams for CASSANDRA-7200
2014-07-18 12:35:57 -05:00
..
bin add log4j properties 2012-04-11 13:24:32 -05:00
conf Fix word count 2014-07-18 12:35:57 -05:00
src Fix word count 2014-07-18 12:35:57 -05:00
README.txt Fix word count 2014-07-18 12:35:57 -05:00
build.xml move example code from contrib/ to examples/, and tools from contrib/ to tools/ 2011-04-01 15:19:27 +00:00
ivy.xml update hadoop dependency in wordcount examples 2013-07-16 17:46:19 -05:00

README.txt

Introduction
============

WordCount hadoop example: Inserts a bunch of words across multiple rows,
and counts them, with RandomPartitioner. The word_count_counters example sums
the value of counter columns for a key.

The scripts in bin/ assume you are running with cwd of contrib/word_count.


Running
=======

First build and start a Cassandra server with the default configuration*, 
then run

contrib/word_count$ ant
contrib/word_count$ bin/word_count_setup
contrib/word_count$ bin/word_count
contrib/word_count$ bin/word_count_counters

In order to view the results in Cassandra, one can use bin/cassandra-cli and
perform the following operations:
$ bin/cassandra-cli
> connect localhost/9160;
> use wordcount;
> list output_words;

The output of the word count can now be configured. In the bin/word_count
file, you can specify the OUTPUT_REDUCER. The two options are 'filesystem'
and 'cassandra'. The filesystem option outputs to the /tmp/word_count*
directories. The cassandra option outputs to the 'output_words' column family
in the 'wordcount' keyspace.  'cassandra' is the default.

Read the code in src/ for more details.

The word_count_counters example sums the counter columns for a row. The output
is written to a text file in /tmp/word_count_counters.

*It is recommended to turn off vnodes when running Cassandra with hadoop.
This is done by setting "num_tokens: 1" in cassandra.yaml. If you want to
point wordcount at a real cluster, modify the seed and listenaddress
settings accordingly.


Troubleshooting
===============

word_count uses conf/log4j.properties to log to wc.out.