cassandra/examples/hadoop_word_count
Brandon Williams f31c53049d Switch word count to M3P. Patch by brandonwilliams reviewed by yukim
for CASSANDRA-4975
2012-11-26 16:59:54 -06:00
..
bin add log4j properties 2012-04-11 13:24:32 -05:00
conf Add missing licences and versions for 1.1.1 release 2012-06-01 18:20:02 +02:00
src Switch word count to M3P. Patch by brandonwilliams reviewed by yukim 2012-11-26 16:59:54 -06:00
README.txt add log4j properties 2012-04-11 13:24:32 -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 move example code from contrib/ to examples/, and tools from contrib/ to tools/ 2011-04-01 15:19:27 +00: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.

*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.