com.twitter.elephantbird.cascading2.io.protobuf
Class ProtobufComparator
java.lang.Object
com.twitter.elephantbird.cascading2.io.protobuf.ProtobufComparator
- All Implemented Interfaces:
- cascading.tuple.StreamComparator<cascading.tuple.hadoop.io.BufferedInputStream>, Comparator<com.google.protobuf.Message>
public class ProtobufComparator
- extends Object
- implements cascading.tuple.StreamComparator<cascading.tuple.hadoop.io.BufferedInputStream>, Comparator<com.google.protobuf.Message>
Comparator for protobufs
- Author:
- Ning Liang
|
Method Summary |
int |
compare(cascading.tuple.hadoop.io.BufferedInputStream leftStream,
cascading.tuple.hadoop.io.BufferedInputStream rightStream)
|
int |
compare(com.google.protobuf.Message left,
com.google.protobuf.Message right)
|
static void |
readFully(InputStream in,
ByteArrayOutputStream out,
byte[] buffer)
Method used to read a protobuf input stream into a byte array |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProtobufComparator
public ProtobufComparator()
compare
public int compare(cascading.tuple.hadoop.io.BufferedInputStream leftStream,
cascading.tuple.hadoop.io.BufferedInputStream rightStream)
- Specified by:
compare in interface cascading.tuple.StreamComparator<cascading.tuple.hadoop.io.BufferedInputStream>
compare
public int compare(com.google.protobuf.Message left,
com.google.protobuf.Message right)
- Specified by:
compare in interface Comparator<com.google.protobuf.Message>
readFully
public static void readFully(InputStream in,
ByteArrayOutputStream out,
byte[] buffer)
- Method used to read a protobuf input stream into a byte array
- Parameters:
in - the protobuf input streamout - the byte output streambuffer - the array out output bytes
Copyright © 2015 Twitter. All Rights Reserved.