是否有可用于 lzo 压缩二进制数据的 Scalding 源?

Is there a Scalding source I can use for lzo-compressed binary data?

我正在使用 Elephant Bird's splittable LZO compression. To achieve this I am using their ThriftBlockWriter class. My Scalding job then uses the FixedPathLzoThrift 源将序列化的 Thrift 记录写入文件以处理记录。这一切都很好。问题是我仅限于单个 Thrift class.

的记录

我想开始使用 RawBlockWriter 而不是 ThriftBlockWriter[MyThriftClass]。因此,我的输入将是 LZO 压缩的原始字节数组,而不是 LZO 压缩的 Thrift 记录。我的问题是:我应该使用什么来代替 FixedPathLzoThrift[MyThriftClass]?

"protocol-buffers" 标签的解释:Elephant Bird 使用 Protocol Buffers SerializedBlock class 来包装原始输入,如 here.

所示

我通过创建 FixedPathLzoRaw class 来代替 FixedPathLzoThrift 解决了这个问题:

case class FixedPathLzoRaw(path: String*) extends FixedPathSource(path: _*) with LzoRaw

// Corresponds to LzoThrift trait
trait LzoRaw extends LocalTapSource with SingleMappable[Array[Byte]] with TypedSink[Array[Byte]] {
  override def setter[U <: Array[Byte]] = TupleSetter.asSubSetter[Array[Byte], U](TupleSetter.singleSetter[Array[Byte]])
  override def hdfsScheme = HadoopSchemeInstance((new LzoByteArrayScheme()).asInstanceOf[Scheme[_, _, _, _, _]])
}