|
| ContinuousReader (ContinuousUDParserLocks continuousUDParserLocks) |
|
int | capacity () |
|
int | getBytesConsumed () |
|
CoroutineState | getCs () |
|
DataBuffer | getCurrentBuffer () |
|
byte | getDataAt (int pos) |
|
int | getLastReservationSize () |
|
int | getPrev_reserved () |
|
InputState | getState () |
|
boolean | isEOF () |
|
boolean | isNeedInput () |
|
boolean | noMoreData () |
|
byte[] | read (int n) |
|
int | reserve (int size) throws UdfException |
|
int | seek (int distance) throws UdfException |
|
void | setCs (CoroutineState cs) |
|
void | setCurrentBuffer (DataBuffer currentBuffer) |
|
void | setLastReservationSize (int lastReservationSize) |
|
void | setNeedInput (boolean needInput) |
|
void | setPrev_reserved (int prev_reserved) |
|
void | setState (InputState state) |
|
ContinuousReader intended for reading data
int com.vertica.sdk.ContinuousStreamer.capacity |
( |
| ) |
|
|
inherited |
- Returns
- Number of bytes reserved
int com.vertica.sdk.ContinuousStreamer.getBytesConsumed |
( |
| ) |
|
|
inherited |
- Returns
- returns the number of bytes consumed so far by the ContinuousStreamer.
- Returns
- returns the Co-routine state.
DataBuffer com.vertica.sdk.ContinuousStreamer.getCurrentBuffer |
( |
| ) |
|
|
inherited |
- Returns
- Returns current Buffer of the ContinuousStreamer.
byte com.vertica.sdk.ContinuousStreamer.getDataAt |
( |
int |
pos | ) |
|
|
inherited |
- Parameters
-
pos | - the position at which data needs to be retrieved. |
- Returns
- Returns the byte to the start of a buffer containing the next N bytes of the input stream, where n is equal to value returned by last call to reserve()
int com.vertica.sdk.ContinuousStreamer.getLastReservationSize |
( |
| ) |
|
|
inherited |
- Returns
- Returns the Last reservation size of the ContinuousStreamer.
int com.vertica.sdk.ContinuousStreamer.getPrev_reserved |
( |
| ) |
|
|
inherited |
- Returns
- returns the previous reservation size.
InputState com.vertica.sdk.ContinuousStreamer.getState |
( |
| ) |
|
|
inherited |
- Returns
- Returns the Input State of ContinuousStreamer.
boolean com.vertica.sdk.ContinuousStreamer.isEOF |
( |
| ) |
|
|
inherited |
- Returns
- true iff we have reached the end of input stream and no data can be reserved
boolean com.vertica.sdk.ContinuousStreamer.isNeedInput |
( |
| ) |
|
|
inherited |
- Returns
- boolean flag to indicate whether more input is needed or not.
boolean com.vertica.sdk.ContinuousStreamer.noMoreData |
( |
| ) |
|
|
inherited |
- Returns
- true iff no more data can be reserved. The current reservation can still be valid and of nonZero size
byte [] com.vertica.sdk.ContinuousReader.read |
( |
int |
n | ) |
|
Reads upto 'n' bytes from the input stream, and copies them to a byte buffer.
A wrapper on top of reserve() and seek().
Note: Read is incompatible with row rejection at this time because the row to be rejected is no longer available to Vertica once it has been seek()'ed past. See reserve()/seek() API for an alternative that doesn't have this limitation.
- Parameters
-
n | integer representing number of bytes to read. |
- Returns
- byte array containing the bytes read.
int com.vertica.sdk.ContinuousStreamer.reserve |
( |
int |
size | ) |
throws UdfException |
|
inherited |
- Parameters
-
size | integer indicating number of bytes to reserve. if size is less than or equal to capacity(), this call has no effect. Otherwise, it is a request to allocate more memory. |
- Returns
- Returns size if at least 'size' bytes could be reserved, or some value smaller than 'size', indicating how many bytes were successfully reserved, if end_of_file was reached and fewer than 'size' bytes are available. check capacity to see how many bytes were reserved.
int com.vertica.sdk.ContinuousStreamer.seek |
( |
int |
distance | ) |
throws UdfException |
|
inherited |
Seek forward in the input stream.
Attempt to seek forward 'distance' bytes. If this is successful then return 'distance'
if this is unsuccessful due to reaching the end of the input stream, return a value less than'distance' thant is equal to the number of bytes that have been consumed.
Calling seek() invalidates any reserved data; to guarantee that data is still available, it is necessary to call reserve() immediately after calling seek().
- Parameters
-
distance | an integer indicating position to seek forward. |
- Returns
- the actual distance the Streamer could seek
- Parameters
-
cs | used to set the Co-routine state |
void com.vertica.sdk.ContinuousStreamer.setCurrentBuffer |
( |
DataBuffer |
currentBuffer | ) |
|
|
inherited |
- Parameters
-
currentBuffer | used to set the currentBuffer of the ContinuousStreamer. |
void com.vertica.sdk.ContinuousStreamer.setLastReservationSize |
( |
int |
lastReservationSize | ) |
|
|
inherited |
- Parameters
-
lastReservationSize | Used to set the lastReservationSize of the ContinuousStreamer |
void com.vertica.sdk.ContinuousStreamer.setNeedInput |
( |
boolean |
needInput | ) |
|
|
inherited |
- Parameters
-
needInput | used to set the needInput flag of ContinuousStreamer. |
void com.vertica.sdk.ContinuousStreamer.setPrev_reserved |
( |
int |
prev_reserved | ) |
|
|
inherited |
- Parameters
-
prev_reserved | used to set the previous reservation size. |
void com.vertica.sdk.ContinuousStreamer.setState |
( |
InputState |
state | ) |
|
|
inherited |
- Parameters
-
state | used to set the InputState of ContinuousStreamer. |