This project has retired. For details please refer to its Attic page.
FakeResolvingDecoder (Apache Gora 0.2 API)

org.apache.gora.mapreduce
Class FakeResolvingDecoder

java.lang.Object
  extended by org.apache.avro.io.Decoder
      extended by org.apache.avro.io.ParsingDecoder
          extended by org.apache.avro.io.ValidatingDecoder
              extended by org.apache.avro.io.ResolvingDecoder
                  extended by org.apache.gora.mapreduce.FakeResolvingDecoder
All Implemented Interfaces:
org.apache.avro.io.parsing.Parser.ActionHandler, org.apache.avro.io.parsing.SkipParser.SkipHandler

public class FakeResolvingDecoder
extends org.apache.avro.io.ResolvingDecoder

Avro uses a ResolvingDecoder which resolves two schemas and converts records written by one to the other, and validates the input. However, Gora needs to write extra information along with the data, so the validation is not consistent with the grammer generated by Avro. So we need to fake the ResolvingDecoder (which is sadly hard codec into GenericDatumReader) until we can write our own GrammerGenerator extending ResolvingGrammerGenerator of avro.


Field Summary
 
Fields inherited from class org.apache.avro.io.ValidatingDecoder
in
 
Fields inherited from class org.apache.avro.io.ParsingDecoder
parser
 
Constructor Summary
FakeResolvingDecoder(org.apache.avro.Schema schema, org.apache.avro.io.Decoder in)
           
 
Method Summary
 long arrayNext()
           
 org.apache.avro.io.parsing.Symbol doAction(org.apache.avro.io.parsing.Symbol input, org.apache.avro.io.parsing.Symbol top)
           
 void init(InputStream in)
           
 long mapNext()
           
 long readArrayStart()
           
 boolean readBoolean()
           
 ByteBuffer readBytes(ByteBuffer old)
           
 double readDouble()
           
 int readEnum()
           
 void readFixed(byte[] bytes)
           
 void readFixed(byte[] bytes, int start, int len)
           
 float readFloat()
           
 int readIndex()
           
 int readInt()
           
 long readLong()
           
 long readMapStart()
           
 void readNull()
           
 org.apache.avro.util.Utf8 readString(org.apache.avro.util.Utf8 old)
           
 void skipAction()
           
 long skipArray()
           
 void skipBytes()
           
protected  void skipFixed()
           
 void skipFixed(int length)
           
 long skipMap()
           
 void skipString()
           
 void skipTopSymbol()
           
 
Methods inherited from class org.apache.avro.io.ResolvingDecoder
drain, readFieldOrder, resolve
 
Methods inherited from class org.apache.avro.io.ValidatingDecoder
init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FakeResolvingDecoder

public FakeResolvingDecoder(org.apache.avro.Schema schema,
                            org.apache.avro.io.Decoder in)
                     throws IOException
Throws:
IOException
Method Detail

arrayNext

public long arrayNext()
               throws IOException
Overrides:
arrayNext in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

doAction

public org.apache.avro.io.parsing.Symbol doAction(org.apache.avro.io.parsing.Symbol input,
                                                  org.apache.avro.io.parsing.Symbol top)
                                           throws IOException
Specified by:
doAction in interface org.apache.avro.io.parsing.Parser.ActionHandler
Overrides:
doAction in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

init

public void init(InputStream in)
          throws IOException
Overrides:
init in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

mapNext

public long mapNext()
             throws IOException
Overrides:
mapNext in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readDouble

public double readDouble()
                  throws IOException
Overrides:
readDouble in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

readEnum

public int readEnum()
             throws IOException
Overrides:
readEnum in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

readIndex

public int readIndex()
              throws IOException
Overrides:
readIndex in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

readLong

public long readLong()
              throws IOException
Overrides:
readLong in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

skipAction

public void skipAction()
                throws IOException
Specified by:
skipAction in interface org.apache.avro.io.parsing.SkipParser.SkipHandler
Overrides:
skipAction in class org.apache.avro.io.ResolvingDecoder
Throws:
IOException

readArrayStart

public long readArrayStart()
                    throws IOException
Overrides:
readArrayStart in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readBoolean

public boolean readBoolean()
                    throws IOException
Overrides:
readBoolean in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readBytes

public ByteBuffer readBytes(ByteBuffer old)
                     throws IOException
Overrides:
readBytes in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readFixed

public void readFixed(byte[] bytes,
                      int start,
                      int len)
               throws IOException
Overrides:
readFixed in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readFloat

public float readFloat()
                throws IOException
Overrides:
readFloat in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readInt

public int readInt()
            throws IOException
Overrides:
readInt in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readMapStart

public long readMapStart()
                  throws IOException
Overrides:
readMapStart in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readNull

public void readNull()
              throws IOException
Overrides:
readNull in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

readString

public org.apache.avro.util.Utf8 readString(org.apache.avro.util.Utf8 old)
                                     throws IOException
Overrides:
readString in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipArray

public long skipArray()
               throws IOException
Overrides:
skipArray in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipBytes

public void skipBytes()
               throws IOException
Overrides:
skipBytes in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipFixed

protected void skipFixed()
                  throws IOException
Overrides:
skipFixed in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipFixed

public void skipFixed(int length)
               throws IOException
Overrides:
skipFixed in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipMap

public long skipMap()
             throws IOException
Overrides:
skipMap in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipString

public void skipString()
                throws IOException
Overrides:
skipString in class org.apache.avro.io.ValidatingDecoder
Throws:
IOException

skipTopSymbol

public void skipTopSymbol()
                   throws IOException
Specified by:
skipTopSymbol in interface org.apache.avro.io.parsing.SkipParser.SkipHandler
Overrides:
skipTopSymbol in class org.apache.avro.io.ParsingDecoder
Throws:
IOException

readFixed

public void readFixed(byte[] bytes)
               throws IOException
Overrides:
readFixed in class org.apache.avro.io.Decoder
Throws:
IOException


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.