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

com.twitter.elephantbird.cascading.protobuf.ProtobufSerialization Maven / Gradle / Ivy

There is a newer version: 4.17
Show newest version
package com.twitter.elephantbird.cascading.protobuf;

import java.util.Comparator;

import com.google.protobuf.Message;

import org.apache.hadoop.io.serializer.Deserializer;
import org.apache.hadoop.io.serializer.Serialization;
import org.apache.hadoop.io.serializer.Serializer;

import cascading.tuple.Comparison;

/**
 * Serialization format class
 * @author Ning Liang
 */
public class ProtobufSerialization implements Serialization, Comparison {

  @Override
  public boolean accept(Class klass) {
    boolean accept = Message.class.isAssignableFrom(klass);
    return accept;
  }

  @Override
  public Deserializer getDeserializer(Class klass) {
    return new ProtobufDeserializer(klass);
  }

  @Override
  public Serializer getSerializer(Class klass) {
    return new ProtobufSerializer();
  }

  @Override
  public Comparator getComparator(Class klass) {
    return new ProtobufComparator();
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy