com.google.cloud.dataflow.sdk.io

## Class BlockBasedSource.Block<T>

- java.lang.Object
- - com.google.cloud.dataflow.sdk.io.BlockBasedSource.Block<T>

Enclosing class:
  BlockBasedSource<T>

    @Experimental(value=SOURCE_SINK)
    protected abstract static class BlockBasedSource.Block<T>
    extends Object

A `Block` represents a block of records that can be read.

### Constructor Summary

Constructors
`protected` `Block()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract T` `getCurrentRecord()` Returns the current record.
`abstract double` `getFractionOfBlockConsumed()` Returns the fraction of the block already consumed, if possible, as a value in `[0, 1]`.
`abstract boolean` `readNextRecord()` Reads the next record from the block and returns true iff one exists.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Block

    protected Block()

### Method Detail

#### getCurrentRecord

    public abstract T getCurrentRecord()

Returns the current record.

#### readNextRecord

    public abstract boolean readNextRecord()
                                    throws IOException

Reads the next record from the block and returns true iff one exists.

Throws:
  `IOException`

#### getFractionOfBlockConsumed

    public abstract double getFractionOfBlockConsumed()

Returns the fraction of the block already consumed, if possible, as a value in `[0, 1]`. It should not include the current record. Successive results from this method must be monotonically increasing.

If it is not possible to compute the fraction of the block consumed this method may return zero. For example, when the total number of records in the block is unknown.