public class SortableSlot extends Object implements org.apache.hadoop.io.WritableComparable<SortableSlot>
Modifier and Type | Class and Description |
---|---|
static class |
SortableSlot.Comparator
A comparator for
SortableSlot . |
static class |
SortableSlot.Partitioner
A partitioner for
SortableSlot . |
Modifier and Type | Field and Description |
---|---|
static String |
NAME_ADD
The method name of
add(Writable) . |
static String |
NAME_ADD_BYTE
The method name of
addByte(int) . |
static String |
NAME_ADD_RANDOM
The method name of
addRandom() . |
static String |
NAME_BEGIN
The method name of
begin(int) . |
Constructor and Description |
---|
SortableSlot() |
Modifier and Type | Method and Description |
---|---|
void |
add(org.apache.hadoop.io.Writable data)
Adds an object.
|
void |
addByte(int data)
Adds an unsigned byte value.
|
void |
addRandom()
Adds a 32-bits random value.
|
void |
begin(int slot)
Begins to write key items into this object.
|
int |
compareTo(SortableSlot o) |
boolean |
equals(Object obj) |
int |
getSlot()
Returns the current slot number.
|
int |
hashCode() |
void |
readFields(DataInput in) |
void |
write(DataOutput out) |
public static final String NAME_BEGIN
begin(int)
.public static final String NAME_ADD_BYTE
addByte(int)
.public static final String NAME_ADD_RANDOM
addRandom()
.public static final String NAME_ADD
add(Writable)
.public void begin(int slot)
slot
- the target slot numberpublic int getSlot()
begin(int)
public void addByte(int data) throws IOException
data
- the value (only use lower 8-bits)IOException
- if failed to add the valuepublic void addRandom() throws IOException
IOException
- if failed to add the valuepublic void add(org.apache.hadoop.io.Writable data) throws IOException
data
- the objectIOException
- if failed to add the valuepublic void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public int compareTo(SortableSlot o)
compareTo
in interface Comparable<SortableSlot>
Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.