|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
org.apache.cassandra.hadoop.streaming.AvroOutputReader
public class AvroOutputReader
An OutputReader that reads sequential StreamingMutations (from Cassandra's Avro client API), and converts them to the objects used by CassandraOutputFormat. This allows Hadoop Streaming to output efficiently to Cassandra via a familiar API. Avro requires the reader's and writer's schema: otherwise, it assumes they are the same. If the canonical schema that the Cassandra side uses changes, and somebody packaged the {{avpr}} up in their application somehow, or generated code, they'd see a runtime failure. We could allow specifying an alternate Avro schema using a Configuration property to work around this.
Constructor Summary | |
---|---|
AvroOutputReader()
|
Method Summary | |
---|---|
java.nio.ByteBuffer |
getCurrentKey()
Returns the current key. |
java.util.List<org.apache.cassandra.avro.Mutation> |
getCurrentValue()
Returns the current value. |
java.lang.String |
getLastOutput()
Returns the last output from the client as a String. |
void |
initialize(org.apache.hadoop.streaming.PipeMapRed pmr)
Initializes the OutputReader. |
boolean |
readKeyValue()
Read the next key/value pair outputted by the client. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AvroOutputReader()
Method Detail |
---|
public void initialize(org.apache.hadoop.streaming.PipeMapRed pmr) throws java.io.IOException
org.apache.hadoop.streaming.io.OutputReader
initialize
in class org.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
java.io.IOException
public boolean readKeyValue() throws java.io.IOException
org.apache.hadoop.streaming.io.OutputReader
readKeyValue
in class org.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
java.io.IOException
public java.nio.ByteBuffer getCurrentKey() throws java.io.IOException
org.apache.hadoop.streaming.io.OutputReader
getCurrentKey
in class org.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
java.io.IOException
public java.util.List<org.apache.cassandra.avro.Mutation> getCurrentValue() throws java.io.IOException
org.apache.hadoop.streaming.io.OutputReader
getCurrentValue
in class org.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
java.io.IOException
public java.lang.String getLastOutput()
org.apache.hadoop.streaming.io.OutputReader
getLastOutput
in class org.apache.hadoop.streaming.io.OutputReader<java.nio.ByteBuffer,java.util.List<org.apache.cassandra.avro.Mutation>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |