public class OutputCollector<T> extends Object implements Collector<T>
RecordWriters.
The OutputCollector tracks to which writers a deep-copy must be given and which not.| Modifier and Type | Field and Description |
|---|---|
protected RecordWriter<SerializationDelegate<T>>[] |
writers |
| Constructor and Description |
|---|
OutputCollector(List<RecordWriter<SerializationDelegate<T>>> writers,
TypeSerializer<T> serializer)
Initializes the output collector with a set of writers.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addWriter(RecordWriter<SerializationDelegate<T>> writer)
Adds a writer to the OutputCollector.
|
void |
close() |
void |
collect(T record)
Collects a record and emits it to all writers.
|
List<RecordWriter<SerializationDelegate<T>>> |
getWriters()
List of writers that are associated with this output collector
|
protected RecordWriter<SerializationDelegate<T>>[] writers
public OutputCollector(List<RecordWriter<SerializationDelegate<T>>> writers, TypeSerializer<T> serializer)
List.writers - List of all writers.public void addWriter(RecordWriter<SerializationDelegate<T>> writer)
writer - The writer to add.public void collect(T record)
public List<RecordWriter<SerializationDelegate<T>>> getWriters()
Copyright © 2015 The Apache Software Foundation. All rights reserved.