All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hmsonline.storm.cassandra.bolt.mapper.TridentColumnMapper Maven / Gradle / Ivy

package com.hmsonline.storm.cassandra.bolt.mapper;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import storm.trident.tuple.TridentTuple;
import backtype.storm.tuple.Values;

/**
 * Interface for mapping a Cassandra row(s) to Trident tuples.
 * 
 * @author tgoetz
 * 
 * @param  - Cassandra row key type
 * @param  - Cassandra column name (column key) type
 * @param  - Cassandra column value tupe
 */
public interface TridentColumnMapper extends Serializable {

    /**
     * 
     * Given a row key (K), a java.util.Map of column
     * names(C)/values(V) associated with that key, return a list of values to
     * emit.
     * 
     * The input parameter is provided as a convenience for special
     * cases where the implementation class may need to inspect the incoming
     * TridentTuple, for example to perform some
     * implementation-specific logic.
     * 
     * In most cases, the input parameter will be ignored.
     * 
     * Examples of using the input parameter might include
     * situations where values in the incoming TridentTuple need to
     * be passed through to the emitted value, but would not be included in the
     * Cassandra row.
     * 
     * 
     * 
     * @param rowKey 
     * @param columns
     * @param input
     * @return
     */
    public List mapToValues(K rowKey, Map columns, TridentTuple input);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy