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

com.inin.analytics.elasticsearch.BaseESMapper Maven / Gradle / Ivy

There is a newer version: 1.2.1
Show newest version
package com.inin.analytics.elasticsearch;

import java.io.IOException;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

/**
 * This class acts as a passthrough routing data to the reducer. Your input should be keyed off of 
 * [index name] | [index type] 
 * 
 * The values should be the raw json payloads to send to ES.
 * @author drew
 *
 */
public class BaseESMapper implements Mapper  {
	public void configure(JobConf job) {
	}

	public void map(Text indexAndRouting, Text documentPayload, OutputCollector output, Reporter reporter) throws IOException {
		/**
		 * Reducer key looks like this   [indexName]|[routing hash] value [doc type]|[doc id]|json
		 * 
		 */
		output.collect(indexAndRouting, documentPayload);
	} 

	public void close() throws IOException {
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy