public static enum RecordBatch.IterOutcome extends Enum<RecordBatch.IterOutcome>
RecordBatch.next().
Key characteristics of the return value sequence:
OK_NEW_SCHEMA always appears unless STOP appears. (A
batch returns OK_NEW_SCHEMA before returning NONE even
if the batch has zero rows.)
OK_NEW_SCHEMA always appears before OK appears.NONE or STOP, and NONE
and STOP appear only as the last value.
Details:
For normal completion, the basic sequence of return values from calls to
next() on a RecordBatch is:
OK_NEW_SCHEMA value followed by zero or more OK
values,
OK_NEW_SCHEMA value
followed by zero or more OK values, and then
NONE value.
In addition to that basic sequence, NOT_YET and
OUT_OF_MEMORY values can appear anywhere in the subsequence
before the terminal value (NONE or STOP).
For abnormal termination, the sequence is truncated (before the
NONE) and ends with STOP. That is, the sequence begins
with a subsequence that is some prefix of a normal-completion sequence
and that does not contain NONE, and ends with STOP.
(The normal-completion return sequence is matched by the following regular-expression-style grammar:
( ( NOT_YET | OUT_OF_MEMORY )* OK_NEW_SCHEMA
( NOT_YET | OUT_OF_MEMORY )* OK )*
)+
( NOT_YET | OUT_OF_+MEMORY )* NONE
)
| Enum Constant and Description |
|---|
NONE
Normal completion of batch.
|
NOT_YET
No data yet.
|
OK
Zero or more records with same schema.
|
OK_NEW_SCHEMA
New schema, maybe with records.
|
OUT_OF_MEMORY
Out of memory (not fatal).
|
STOP
Non-completion (abnormal) termination.
|
| Modifier and Type | Method and Description |
|---|---|
static RecordBatch.IterOutcome |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RecordBatch.IterOutcome[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RecordBatch.IterOutcome NONE
The call to RecordBatch.next()
read no records,
the batch has and will have no more results to return,
and next() must not be called again.
This value will be returned only after OK_NEW_SCHEMA has been
returned at least once (not necessarily immediately after).
public static final RecordBatch.IterOutcome OK
The call to RecordBatch.next()
read zero or more records,
the schema has not changed since the last time OK_NEW_SCHEMA
was returned,
and the batch will have more results to return (at least completion or
abnormal termination (NONE or STOP)).
(next() should be called again.)
This will be returned only after OK_NEW_SCHEMA has been
returned at least once (not necessarily immediately after).
public static final RecordBatch.IterOutcome OK_NEW_SCHEMA
The call to RecordBatch.next()
changed the schema and vector structures
and read zero or more records,
and the batch will have more results to return (at least completion or
abnormal termination (NONE or STOP)).
(next() should be called again.)
public static final RecordBatch.IterOutcome STOP
The call to RecordBatch.next()
reports that the query has terminated other than by normal completion,
and that the caller must not call any of the schema-access or
data-access methods nor call next() again.
The caller can consume its QueryContext to understand the current state of things.
public static final RecordBatch.IterOutcome NOT_YET
The call to RecordBatch.next()
read no data,
and the batch will have more results to return in the future (at least
completion or abnormal termination (NONE or STOP)).
The caller should call next() again, but should do so later
(including by returning NOT_YET to its caller).
Normally, the caller should perform any locally available work while waiting for incoming data from the callee, for example, doing partial sorts on already received data while waiting for additional data to sort.
Used by batches that haven't received incoming data yet.
public static final RecordBatch.IterOutcome OUT_OF_MEMORY
The call to RecordBatch.next(),
including upstream operators, was unable to allocate memory
and did not read any records,
and the batch will have more results to return (at least completion or
abnormal termination (NONE or STOP)).
The caller should release memory if it can (including by returning
OUT_OF_MEMORY to its caller) and call next() again.
public static RecordBatch.IterOutcome[] values()
for (RecordBatch.IterOutcome c : RecordBatch.IterOutcome.values()) System.out.println(c);
public static RecordBatch.IterOutcome valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullCopyright © 2017 The Apache Software Foundation. All rights reserved.