|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avro.hadoop.io.AvroKeyValue<K,V>
K - The java type for the key.V - The java type for the value.public class AvroKeyValue<K,V>
A helper object for working with the Avro generic records that are used to store key/value pairs in an Avro container file.
| Nested Class Summary | |
|---|---|
static class |
AvroKeyValue.Iterator<K,V>
A wrapper for iterators over GenericRecords that are known to be KeyValue records. |
| Field Summary | |
|---|---|
static String |
KEY_FIELD
The name of the generic record field containing the key. |
static String |
KEY_VALUE_PAIR_RECORD_NAME
The name of the key value pair generic record. |
static String |
KEY_VALUE_PAIR_RECORD_NAMESPACE
The namespace of the key value pair generic record. |
static String |
VALUE_FIELD
The name of the generic record field containing the value. |
| Constructor Summary | |
|---|---|
AvroKeyValue(org.apache.avro.generic.GenericRecord keyValueRecord)
Wraps a GenericRecord that is a key value pair. |
|
| Method Summary | |
|---|---|
org.apache.avro.generic.GenericRecord |
get()
Gets the wrapped key/value GenericRecord. |
K |
getKey()
Read the key. |
static org.apache.avro.Schema |
getSchema(org.apache.avro.Schema keySchema,
org.apache.avro.Schema valueSchema)
Creates a KeyValuePair generic record schema. |
V |
getValue()
Read the value. |
void |
setKey(K key)
Sets the key. |
void |
setValue(V value)
Sets the value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String KEY_VALUE_PAIR_RECORD_NAME
public static final String KEY_VALUE_PAIR_RECORD_NAMESPACE
public static final String KEY_FIELD
public static final String VALUE_FIELD
| Constructor Detail |
|---|
public AvroKeyValue(org.apache.avro.generic.GenericRecord keyValueRecord)
| Method Detail |
|---|
public org.apache.avro.generic.GenericRecord get()
public K getKey()
public V getValue()
public void setKey(K key)
key - The key.public void setValue(V value)
value - The value.
public static org.apache.avro.Schema getSchema(org.apache.avro.Schema keySchema,
org.apache.avro.Schema valueSchema)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||