Package org.apache.parquet.io.api
Class RecordConsumer
- java.lang.Object
-
- org.apache.parquet.io.api.RecordConsumer
-
- Direct Known Subclasses:
RecordConsumerLoggingWrapper,ValidatingRecordConsumer
public abstract class RecordConsumer extends Object
Abstraction for writing records It decouples the striping algorithm from the actual record model example:startMessage() startField("A", 0) addValue(1) addValue(2) endField("A", 0) startField("B", 1) startGroup() startField("C", 0) addValue(3) endField("C", 0) endGroup() endField("B", 1) endMessage()would produce the following message:{ A: [1, 2] B: { C: 3 } }
-
-
Constructor Summary
Constructors Constructor Description RecordConsumer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidaddBinary(Binary value)add a binary value in the current fieldabstract voidaddBoolean(boolean value)add a boolean value in the current fieldabstract voidaddDouble(double value)add a double value in the current fieldabstract voidaddFloat(float value)add a float value in the current fieldabstract voidaddInteger(int value)add an int value in the current fieldabstract voidaddLong(long value)add a long value in the current fieldabstract voidendField(String field, int index)end of a field in a group or messageabstract voidendGroup()end of a group in a fieldabstract voidendMessage()end of a recordvoidflush()NoOps by default Subclass class can implement its own flushing logicabstract voidstartField(String field, int index)start of a field in a group or message if the field is repeated the field is started only once and all values added in between start and endabstract voidstartGroup()start of a group in a fieldabstract voidstartMessage()start a new record
-
-
-
Method Detail
-
startMessage
public abstract void startMessage()
start a new record
-
endMessage
public abstract void endMessage()
end of a record
-
startField
public abstract void startField(String field, int index)
start of a field in a group or message if the field is repeated the field is started only once and all values added in between start and end- Parameters:
field- name of the fieldindex- of the field in the group or message
-
endField
public abstract void endField(String field, int index)
end of a field in a group or message- Parameters:
field- name of the fieldindex- of the field in the group or message
-
startGroup
public abstract void startGroup()
start of a group in a field
-
endGroup
public abstract void endGroup()
end of a group in a field
-
addInteger
public abstract void addInteger(int value)
add an int value in the current field- Parameters:
value- an int value
-
addLong
public abstract void addLong(long value)
add a long value in the current field- Parameters:
value- a long value
-
addBoolean
public abstract void addBoolean(boolean value)
add a boolean value in the current field- Parameters:
value- a boolean value
-
addBinary
public abstract void addBinary(Binary value)
add a binary value in the current field- Parameters:
value- a binary value
-
addFloat
public abstract void addFloat(float value)
add a float value in the current field- Parameters:
value- a float value
-
addDouble
public abstract void addDouble(double value)
add a double value in the current field- Parameters:
value- a double value
-
flush
public void flush()
NoOps by default Subclass class can implement its own flushing logic
-
-