O'Reilly logo

Cassandra High Performance Cookbook by Edward Capriolo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

A Map-only program that reads from Cassandra using the ColumnFamilyInputFormat

The ColumnFamilyInputFormat allows data stored in Cassandra to be used as input for Hadoop jobs. Hadoop can then be used to perform many different types of algorithms on the data. This recipe shows how to use a map-only job to locate any key with a specific column and convert the value of the column to uppercase.

Tip

Big Data Ahead!

The ColumnFamilyInputFormat scans through all the data on all nodes!

How to do it...

  1. Create a file <hpc_build>/src/java/hpcas/c11/MapOnly.java:
    package hpcas.c11; import hpcas.c03.Util; import java.nio.ByteBuffer; import java.util.*; import org.apache.cassandra.hadoop.ColumnFamilyInputFormat; import org.apache.cassandra.hadoop.ConfigHelper; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required