Class KafkaInputKeyComparator
- java.lang.Object
-
- com.linkedin.venice.hadoop.input.kafka.KafkaInputKeyComparator
-
- All Implemented Interfaces:
java.io.Serializable
,java.util.Comparator<org.apache.hadoop.io.BytesWritable>
,org.apache.hadoop.io.RawComparator<org.apache.hadoop.io.BytesWritable>
- Direct Known Subclasses:
KafkaInputValueGroupingComparator
public class KafkaInputKeyComparator extends java.lang.Object implements org.apache.hadoop.io.RawComparator<org.apache.hadoop.io.BytesWritable>, java.io.Serializable
This class is used to support secondary sorting for KafkaInput Repush. The key is composed by the raw key + offset, and this class will compare key part first to make it in ascending order and then compare the offset part when keys are equal to maintain an offset-descending order for the same key.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KafkaInputKeyComparator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)
protected int
compare(KafkaInputMapperKey k1, KafkaInputMapperKey k2)
int
compare(org.apache.hadoop.io.BytesWritable o1, org.apache.hadoop.io.BytesWritable o2)
-
-
-
Method Detail
-
compare
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)
- Specified by:
compare
in interfaceorg.apache.hadoop.io.RawComparator<org.apache.hadoop.io.BytesWritable>
-
compare
public int compare(org.apache.hadoop.io.BytesWritable o1, org.apache.hadoop.io.BytesWritable o2)
- Specified by:
compare
in interfacejava.util.Comparator<org.apache.hadoop.io.BytesWritable>
-
compare
protected int compare(KafkaInputMapperKey k1, KafkaInputMapperKey k2)
-
-