com.hmsonline.storm.cassandra.bolt.mapper.TupleCounterMapper Maven / Gradle / Ivy
package com.hmsonline.storm.cassandra.bolt.mapper;
import java.io.Serializable;
import java.util.List;
import backtype.storm.tuple.Tuple;
/**
* Interface for mapping storm Tuples to Cassandra counter columns.
*
* @author tgoetz
*
*/
public interface TupleCounterMapper extends Serializable {
/**
* Given a backtype.storm.tuple.Tuple
object, map the column
* family to write to.
*
* @param tuple
* @return
*/
String mapToColumnFamily(Tuple tuple);
/**
* Given a backtype.storm.tuple.Tuple
object, map the keyspace to write to.
*
* @param tuple
* @return
*/
String mapToKeyspace(Tuple tuple);
/**
* Given a backtype.storm.tuple.Tuple
generate a Cassandra row
* key.
*
* @param tuple
* @return
*/
String mapToRowKey(Tuple tuple);
/**
* Given a backtype.storm.tuple.Tuple
return the amount that
* must be incremented by.
*
* @param tuple
* @return
*/
long mapToIncrementAmount(Tuple tuple);
/**
* Given a backtype.storm.tuple.Tuple
object, map the columns
* that must be incremented by the increment amount.
*
* @param tuple
* @return
*/
List mapToColumnList(Tuple tuple);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy