<commit_before>package com.orendainx.hortonworks.trucking.topology.nifi

import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple

import scala.collection.JavaConverters._

/**
  * @author <NAME> <<EMAIL>>
  */
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {

  private lazy val logger = Logger(this.getClass)

  override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
    val newAttributes = Map("processed" -> "true").asJava
    new StandardNiFiDataPacket(tuple.getValueByField("data").asInstanceOf[Array[Byte]], newAttributes)
  }
}<commit_msg>Change getStringByField to getBinaryByField, for retrieving an array of bytes<commit_after>package com.orendainx.hortonworks.trucking.topology.nifi

import com.typesafe.scalalogging.Logger
import org.apache.nifi.storm.{NiFiDataPacket, NiFiDataPacketBuilder, StandardNiFiDataPacket}
import org.apache.storm.tuple.Tuple

import scala.collection.JavaConverters._

/**
  * @author <NAME> <<EMAIL>>
  */
class ByteArrayToNiFiPacket extends NiFiDataPacketBuilder with Serializable {

  private lazy val logger = Logger(this.getClass)

  override def createNiFiDataPacket(tuple: Tuple): NiFiDataPacket = {
    val newAttributes = Map("processed" -> "true").asJava
    new StandardNiFiDataPacket(tuple.getBinaryByField("data"), newAttributes)
  }
}
{'fraction_non_alphanumeric': 0.10131852879944483, 'fraction_numerical': 0.0, 'mean_word_length': 6.103448275862069, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5018033', 'n_tokens_mistral': 461, 'n_tokens_neox': 440, 'n_words': 85}