# Class RowRunner

java.lang.Object
uk.ac.starlink.table.RowRunner

public class RowRunner extends Object
Manages potentially parallel processing of StarTable row data.

Since:
  5 Aug 2020
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final RowRunner`
`DEFAULT`
General purpose instance; will be parallel for suitable environments.
`static final uk.ac.starlink.util.SplitPolicy`
`DFLT_POLICY`
Default split policy.
`static final RowRunner`
`PARTEST`
Testing instance; force parallel processing even for small tables.
`static final RowRunner`
`SEQUENTIAL`
Sequential-only instance; no parallel processing.

## Constructor Summary

Constructors
Constructor
Description
`RowRunner(uk.ac.starlink.util.SplitProcessor<?> processor)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`<A> A`
`collect(RowCollector<A> collector, StarTable table)`
Performs a collection operation on table rows.
`RowSplittable`
`createRowSplittable(StarTable table)`
Acquires a splittable row sequence from a table.
`uk.ac.starlink.util.SplitProcessor<RowSplittable>`
`getSplitProcessor()`
Returns the processor on which this runner is based.

### Methods inherited from class Object

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

## Field Details

### DFLT_POLICY

public static final uk.ac.starlink.util.SplitPolicy DFLT_POLICY
Default split policy.

### DEFAULT

public static final RowRunner DEFAULT
General purpose instance; will be parallel for suitable environments.

### SEQUENTIAL

public static final RowRunner SEQUENTIAL
Sequential-only instance; no parallel processing.

### PARTEST

public static final RowRunner PARTEST
Testing instance; force parallel processing even for small tables.

## Constructor Details

### RowRunner

public RowRunner(uk.ac.starlink.util.SplitProcessor<?> processor)
Constructor.

Parameters:
  `processor` - processor that manages the executions

## Method Details

### collect

public <A> A collect(RowCollector<A> collector, StarTable table) throws IOException
Performs a collection operation on table rows.

Parameters:
  `collector` - collector defining operation
  `table` - table supplying data
Returns:
  result of collection
Throws:
  `IOException`

### createRowSplittable

public RowSplittable createRowSplittable(StarTable table) throws IOException
Acquires a splittable row sequence from a table. The default implementation just calls `StarTable.getRowSplittable()`, but this may be overridden if required.

Parameters:
  `table` - input table
Returns:
  potentially splittable row sequence
Throws:
  `IOException`

### getSplitProcessor

public uk.ac.starlink.util.SplitProcessor<RowSplittable> getSplitProcessor()
Returns the processor on which this runner is based.

Returns:
  processor