public class LimitRows extends AbstractRecordCompositeOperator
By default, all records are passed through unless explicitly specified.
input, output
Constructor and Description |
---|
LimitRows()
Performs no truncation of the input flow.
|
LimitRows(long count)
Truncates incoming data to the first N
records of the input.
|
LimitRows(long skip,
long count)
Truncates incoming data to the first N
records following a specified record.
|
Modifier and Type | Method and Description |
---|---|
protected void |
compose(CompositionContext ctx)
Compose the body of this operator.
|
long |
getCount()
Gets the maximum number of records
which will be output.
|
RecordPort |
getInput()
Returns the input port
|
RecordPort |
getOutput()
Returns the output port
|
long |
getSkip()
Gets the number of input records to skip
before outputting records.
|
void |
setCount(long count)
Sets the maximum number of records
which will be output.
|
void |
setSkip(long skip)
Sets the number of input records to skip
before outputting records.
|
disableParallelism, getInputPorts, getOutputPorts, newInput, newInput, newOutput, newRecordInput, newRecordInput, newRecordOutput, notifyError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disableParallelism, getInputPorts, getOutputPorts
public LimitRows()
public LimitRows(long count)
count
- the number of records to
pass throughpublic LimitRows(long skip, long count)
skip
- the record at which to start
passing through records. Indices are
zero-based; that is, the first record is
at index 0
.count
- the number of records to
pass throughpublic RecordPort getInput()
PipelineOperator
getInput
in interface PipelineOperator<RecordPort>
getInput
in class AbstractRecordCompositeOperator
public RecordPort getOutput()
PipelineOperator
getOutput
in interface PipelineOperator<RecordPort>
getOutput
in class AbstractRecordCompositeOperator
public long getCount()
public void setCount(long count)
count
- the limit on the number of
output records.InvalidPropertyValueException
- if
count <= 0
public long getSkip()
public void setSkip(long skip)
skip
- the index of the first record to
pass throughInvalidPropertyValueException
- if
count < 0
protected void compose(CompositionContext ctx)
CompositeOperator
OperatorComposable.add(O)
OperatorComposable.connect(P, P)
. This includes
connections from the composite's input ports to sub-operators, connections between sub-operators, and
connections from sub-operators output ports to the composite's output portscompose
in class CompositeOperator
ctx
- the contextCopyright © 2021 Actian Corporation. All rights reserved.