Top Description Fields Constructors Methods
org.apache.avro.io

public abstract Class ParsingEncoder

extends Encoder
Class Inheritance
Known Direct Subclasses
org.apache.avro.io.ValidatingEncoder, org.apache.avro.io.JsonEncoder
Imports
java.io.IOException, java.util.Arrays, org.apache.avro.AvroTypeException

Base class for parser-based Encoders.

Field Summary

Modifier and TypeField and Description
private long[]
counts

Tracks the number of items that remain to be written in the collections (array or map).

protected int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final int
protected final void
pop()

protected final void
push()

Push a new collection on to the stack.

public void
setItemCount(long
The number of startItem() calls to follow.
itemCount
)

Implements abstract org.apache.avro.io.Encoder.setItemCount.

Call this method before writing a batch of items in an array or a map.
public void
startItem()

Implements abstract org.apache.avro.io.Encoder.startItem.

Start a new item of an array or map.
Inherited from org.apache.avro.io.Encoder:
writeArrayEndwriteArrayStartwriteBooleanwriteByteswriteByteswriteByteswriteDoublewriteEnumwriteFixedwriteFixedwriteFixedwriteFloatwriteIndexwriteIntwriteLongwriteMapEndwriteMapStartwriteNullwriteStringwriteStringwriteString

Field Detail

countsback to summary
private long[] counts

Tracks the number of items that remain to be written in the collections (array or map).

posback to summary
protected int pos

Constructor Detail

ParsingEncoderback to summary
public ParsingEncoder()

Method Detail

depthback to summary
protected final int depth()
popback to summary
protected final void pop()
pushback to summary
protected final void push()

Push a new collection on to the stack.

setItemCountback to summary
public void setItemCount(long itemCount) throws IOException

Implements abstract org.apache.avro.io.Encoder.setItemCount.

Doc from org.apache.avro.io.Encoder.setItemCount.

Call this method before writing a batch of items in an array or a map. Then for each item, call startItem() followed by any of the other write methods of Encoder. The number of calls to startItem() must be equal to the count specified in setItemCount. Once a batch is completed you can start another batch with setItemCount.

Parameters
itemCount:long

The number of startItem() calls to follow.

Annotations
@Override
startItemback to summary
public void startItem() throws IOException

Implements abstract org.apache.avro.io.Encoder.startItem.

Doc from org.apache.avro.io.Encoder.startItem.

Start a new item of an array or map. See writeArrayStart for usage information.

Annotations
@Override