Class EncodedValueComparator
java.lang.Object
org.apache.flink.api.common.typeutils.TypeComparator<byte[]>
org.apache.beam.runners.flink.translation.types.EncodedValueComparator
- All Implemented Interfaces:
Serializable
public class EncodedValueComparator
extends org.apache.flink.api.common.typeutils.TypeComparator<byte[]>
Flink
TypeComparator
for Beam values that have been
encoded to byte data by a Coder
.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
compare
(byte[] first, byte[] second) int
compareSerialized
(org.apache.flink.core.memory.DataInputView firstSource, org.apache.flink.core.memory.DataInputView secondSource) int
compareToReference
(org.apache.flink.api.common.typeutils.TypeComparator<byte[]> other) org.apache.flink.api.common.typeutils.TypeComparator
<byte[]> boolean
equalToReference
(byte[] candidate) int
extractKeys
(Object record, Object[] target, int index) org.apache.flink.api.common.typeutils.TypeComparator[]
int
int
hash
(byte[] record) boolean
boolean
isNormalizedKeyPrefixOnly
(int keyBytes) void
putNormalizedKey
(byte[] record, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes) byte[]
readWithKeyDenormalization
(byte[] reuse, org.apache.flink.core.memory.DataInputView source) void
setReference
(byte[] toCompare) boolean
boolean
void
writeWithKeyNormalization
(byte[] record, org.apache.flink.core.memory.DataOutputView target) Methods inherited from class org.apache.flink.api.common.typeutils.TypeComparator
compareAgainstReference, supportsCompareAgainstReference
-
Constructor Details
-
EncodedValueComparator
public EncodedValueComparator(boolean ascending)
-
-
Method Details
-
hash
public int hash(byte[] record) - Specified by:
hash
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
setReference
public void setReference(byte[] toCompare) - Specified by:
setReference
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
equalToReference
public boolean equalToReference(byte[] candidate) - Specified by:
equalToReference
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
compareToReference
public int compareToReference(org.apache.flink.api.common.typeutils.TypeComparator<byte[]> other) - Specified by:
compareToReference
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
compare
public int compare(byte[] first, byte[] second) - Specified by:
compare
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
compareSerialized
public int compareSerialized(org.apache.flink.core.memory.DataInputView firstSource, org.apache.flink.core.memory.DataInputView secondSource) throws IOException - Specified by:
compareSerialized
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
- Throws:
IOException
-
supportsNormalizedKey
public boolean supportsNormalizedKey()- Specified by:
supportsNormalizedKey
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
supportsSerializationWithKeyNormalization
public boolean supportsSerializationWithKeyNormalization()- Specified by:
supportsSerializationWithKeyNormalization
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
getNormalizeKeyLen
public int getNormalizeKeyLen()- Specified by:
getNormalizeKeyLen
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
isNormalizedKeyPrefixOnly
public boolean isNormalizedKeyPrefixOnly(int keyBytes) - Specified by:
isNormalizedKeyPrefixOnly
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
putNormalizedKey
public void putNormalizedKey(byte[] record, org.apache.flink.core.memory.MemorySegment target, int offset, int numBytes) - Specified by:
putNormalizedKey
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
writeWithKeyNormalization
public void writeWithKeyNormalization(byte[] record, org.apache.flink.core.memory.DataOutputView target) throws IOException - Specified by:
writeWithKeyNormalization
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
- Throws:
IOException
-
readWithKeyDenormalization
public byte[] readWithKeyDenormalization(byte[] reuse, org.apache.flink.core.memory.DataInputView source) throws IOException - Specified by:
readWithKeyDenormalization
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
- Throws:
IOException
-
invertNormalizedKey
public boolean invertNormalizedKey()- Specified by:
invertNormalizedKey
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
duplicate
public org.apache.flink.api.common.typeutils.TypeComparator<byte[]> duplicate()- Specified by:
duplicate
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
extractKeys
- Specified by:
extractKeys
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-
getFlatComparators
public org.apache.flink.api.common.typeutils.TypeComparator[] getFlatComparators()- Specified by:
getFlatComparators
in classorg.apache.flink.api.common.typeutils.TypeComparator<byte[]>
-