public abstract class EncodedDataConsumer<BatchKey,BatchType extends EncodedColumnBatch<BatchKey>> extends Object implements Consumer<BatchType>, ReadPipeline
Modifier and Type | Field and Description |
---|---|
protected FixedSizedObjectPool<ColumnVectorBatch> |
cvbPool |
Constructor and Description |
---|
EncodedDataConsumer(Consumer<ColumnVectorBatch> consumer,
int colCount,
LlapDaemonIOMetrics ioMetrics) |
Modifier and Type | Method and Description |
---|---|
void |
consumeData(BatchType data)
Some data has been produced.
|
protected abstract void |
decodeBatch(BatchType batch,
Consumer<ColumnVectorBatch> downstreamConsumer) |
Callable<Void> |
getReadCallable() |
void |
init(ConsumerFeedback<BatchType> upstreamFeedback,
Callable<Void> readCallable) |
void |
pause()
Pause data production.
|
void |
returnData(ColumnVectorBatch data)
Returns processed data back to producer; necessary if e.g.
|
void |
setDone()
No more data will be produced; done
|
void |
setError(Throwable t)
No more data will be produced; error during production
|
void |
stop()
Stop data production, the external operation has been cancelled.
|
void |
unpause()
Unpause data production.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFileSchema, getIncludedColumns
protected final FixedSizedObjectPool<ColumnVectorBatch> cvbPool
public EncodedDataConsumer(Consumer<ColumnVectorBatch> consumer, int colCount, LlapDaemonIOMetrics ioMetrics)
public void init(ConsumerFeedback<BatchType> upstreamFeedback, Callable<Void> readCallable)
public Callable<Void> getReadCallable()
getReadCallable
in interface ReadPipeline
public void consumeData(BatchType data)
Consumer
consumeData
in interface Consumer<BatchType extends EncodedColumnBatch<BatchKey>>
protected abstract void decodeBatch(BatchType batch, Consumer<ColumnVectorBatch> downstreamConsumer)
public void setDone()
Consumer
setDone
in interface Consumer<BatchType extends EncodedColumnBatch<BatchKey>>
public void setError(Throwable t)
Consumer
setError
in interface Consumer<BatchType extends EncodedColumnBatch<BatchKey>>
public void returnData(ColumnVectorBatch data)
ConsumerFeedback
returnData
in interface ConsumerFeedback<ColumnVectorBatch>
public void stop()
ConsumerFeedback
stop
in interface ConsumerFeedback<ColumnVectorBatch>
public void pause()
ConsumerFeedback
pause
in interface ConsumerFeedback<ColumnVectorBatch>
public void unpause()
ConsumerFeedback
unpause
in interface ConsumerFeedback<ColumnVectorBatch>
Copyright © 2016 The Apache Software Foundation. All rights reserved.