class PipelinedSubpartition extends ResultSubpartition {

	@Override
	public PipelinedSubpartitionView createReadView(BufferProvider bufferProvider) {
		synchronized (buffers) {
			if (readView != null) {
				throw new IllegalStateException("Subpartition " + index + " of "
						+ parent.getPartitionId() + " is being or already has been " +
						"consumed, but pipelined subpartitions can only be consumed once.");
			}

			readView = new PipelinedSubpartitionView(this);

			LOG.debug("Created read view for subpartition {} of partition {}.", index, parent.getPartitionId());

			return readView;
		}
	}

	  PipelinedSubpartition(int index, ResultPartition parent);

}