com.bigdata.relation.accesspath.UnsyncLocalOutputBuffer Maven / Gradle / Ivy
package com.bigdata.relation.accesspath;
import com.bigdata.bop.IBindingSet;
import com.bigdata.bop.engine.BOpStats;
/**
* Wraps the base class to update the caller's {@link BOpStats}.
*
* @author Bryan Thompson
* @version $Id: UnsyncLocalOutputBuffer.java 3448 2010-08-18 20:55:58Z
* thompsonbry $
* @param
*/
public class UnsyncLocalOutputBuffer extends
AbstractUnsynchronizedArrayBuffer {//UnsynchronizedOutputBuffer {
// private final BOpStats stats;
private final IBlockingBuffer syncBuffer;
// * @param stats
// * Statistics object
/**
* @param capacity
* The capacity of this buffer.
* @param syncBuffer
* The thread-safe buffer onto which this buffer writes when
* it overflows.
*/
public UnsyncLocalOutputBuffer(//final BOpStats stats,
final int capacity, final IBlockingBuffer syncBuffer) {
this(capacity, syncBuffer, null/* filter */);
}
public UnsyncLocalOutputBuffer(
// final BOpStats stats,
final int capacity, final IBlockingBuffer syncBuffer,
final IElementFilter filter) {
super(capacity, (Class extends E>) IBindingSet.class, filter);
// this.stats = stats;
this.syncBuffer = syncBuffer;
}
/**
* Adds the chunk to the {@link #syncBuffer} and updates the
* {@link BOpStats}.
*
* @param chunk
* A chunk of {@link IBindingSet}s to be output.
*/
@Override
protected void handleChunk(final E[] chunk) {
syncBuffer.add(chunk);
// stats.chunksOut.increment();
// stats.unitsOut.add(chunk.length);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy