| Modifier and Type | Class and Description |
|---|---|
static class |
TupleReaderWriter.TupleRawComparator
Tuple 对象的 WritableComparator 自然顺序实现(升序). |
| Constructor and Description |
|---|
TupleReaderWriter() |
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(Writable o1,
Writable o2)
/** Compare two objects to each other.
|
static int |
compare(Writable o1,
Writable o2,
byte dt1,
byte dt2)
Same as
#compare(Object, Object), but does not use reflection to
determine the type of passed in objects, relying instead on the caller to
provide the appropriate values, as determined by findType(Object). |
static void |
readTuple(DataInput in,
Tuple t)
从指定的输入流反序列化至指定的Tuple对象
|
static void |
writeTuple(DataOutput out,
Tuple t)
将指定的Tuple对象序列化至指定的输出流中
|
public static int compare(Writable o1, Writable o2)
o1 - First objecto2 - Second objectpublic static int compare(Writable o1, Writable o2, byte dt1, byte dt2)
#compare(Object, Object), but does not use reflection to
determine the type of passed in objects, relying instead on the caller to
provide the appropriate values, as determined by findType(Object).
Use this version in cases where multiple objects of the same type have to
be repeatedly compared.o1 - first objecto2 - second objectdt1 - type, as byte value, of o1dt2 - type, as byte value, of o2public static void readTuple(DataInput in, Tuple t) throws IOException
in - 输入流,含有Tuple的field的字节t - 反序列化后的Tuple对象IOException - 输入流中的字节不是某个Tuple序列化后的字节public static void writeTuple(DataOutput out, Tuple t) throws IOException
out - Tuple对象要写入的输出流t - 待写出的Tuple对象IOException - 待序列化的Tuple对象在序列化其field对象出现异常Copyright © 2023 Alibaba Cloud Computing. All rights reserved.