<commit_before>package com.linkedin.batch.etl.kafka.coders;

import kafka.message.Message;

import org.apache.avro.generic.GenericData.Record;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.specific.SpecificRecord;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;

public abstract class KafkaMessageDecoder implements Configurable {
	private Configuration conf;

	public KafkaMessageDecoder(Configuration conf) {
		this.conf = conf;
	}

	public Record toRecord(Message message) {
		return toRecord(message, null);
	}

	public <T extends SpecificRecord> T toSpecificRecord(Message message) {
		T specificRecord = this.<T> toSpecificRecord(message, null);
		return specificRecord;
	}

	public abstract Record toRecord(Message message, BinaryDecoder decoderReuse);

	public abstract <T extends SpecificRecord> T toSpecificRecord(
			Message message, BinaryDecoder decoderReuse);
<commit_msg>adding topicName since the decoder will need to know which topic it is decoding<commit_after>package com.linkedin.batch.etl.kafka.coders;

import kafka.message.Message;

import org.apache.avro.generic.GenericData.Record;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.specific.SpecificRecord;
import org.apache.hadoop.conf.Configurable;
import org.apache.hadoop.conf.Configuration;

public abstract class KafkaMessageDecoder implements Configurable {
	private Configuration conf;

	public KafkaMessageDecoder(Configuration conf) {
		this.conf = conf;
	}

	public Record toRecord(String topicName, Message message) {
		return toRecord(topicName, message, null);
	}

	public <T extends SpecificRecord> T toSpecificRecord(String topicName, Message message) {
		T specificRecord = this.<T> toSpecificRecord(topicName, message, null);
		return specificRecord;
	}

	public abstract Record toRecord(String topicName, Message message, BinaryDecoder decoderReuse);

	public abstract <T extends SpecificRecord> T toSpecificRecord(String topicName, 
			Message message, BinaryDecoder decoderReuse);

{'fraction_non_alphanumeric': 0.08097560975609756, 'fraction_numerical': 0.0, 'mean_word_length': 6.023972602739726, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6021937', 'n_tokens_mistral': 598, 'n_tokens_neox': 557, 'n_words': 156}