Java SDK Documentation  24.1.0
com.vertica.sdk.ContinuousReader Class Reference
Inheritance diagram for com.vertica.sdk.ContinuousReader:
Inheritance graph
Collaboration diagram for com.vertica.sdk.ContinuousReader:
Collaboration graph

Public Member Functions

 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)
 

Detailed Description

ContinuousReader intended for reading data

Member Function Documentation

◆ capacity()

int com.vertica.sdk.ContinuousStreamer.capacity ( )
inherited
Returns
Number of bytes reserved

◆ getBytesConsumed()

int com.vertica.sdk.ContinuousStreamer.getBytesConsumed ( )
inherited
Returns
returns the number of bytes consumed so far by the ContinuousStreamer.

◆ getCs()

CoroutineState com.vertica.sdk.ContinuousStreamer.getCs ( )
inherited
Returns
returns the Co-routine state.

◆ getCurrentBuffer()

DataBuffer com.vertica.sdk.ContinuousStreamer.getCurrentBuffer ( )
inherited
Returns
Returns current Buffer of the ContinuousStreamer.

◆ getDataAt()

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()

◆ getLastReservationSize()

int com.vertica.sdk.ContinuousStreamer.getLastReservationSize ( )
inherited
Returns
Returns the Last reservation size of the ContinuousStreamer.

◆ getPrev_reserved()

int com.vertica.sdk.ContinuousStreamer.getPrev_reserved ( )
inherited
Returns
returns the previous reservation size.

◆ getState()

InputState com.vertica.sdk.ContinuousStreamer.getState ( )
inherited
Returns
Returns the Input State of ContinuousStreamer.

◆ isEOF()

boolean com.vertica.sdk.ContinuousStreamer.isEOF ( )
inherited
Returns
true iff we have reached the end of input stream and no data can be reserved

◆ isNeedInput()

boolean com.vertica.sdk.ContinuousStreamer.isNeedInput ( )
inherited
Returns
boolean flag to indicate whether more input is needed or not.

◆ noMoreData()

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

◆ read()

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
ninteger representing number of bytes to read.
Returns
byte array containing the bytes read.

◆ reserve()

int com.vertica.sdk.ContinuousStreamer.reserve ( int  size) throws UdfException
inherited
Parameters
sizeinteger 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.

◆ seek()

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
distancean integer indicating position to seek forward.
Returns
the actual distance the Streamer could seek

◆ setCs()

void com.vertica.sdk.ContinuousStreamer.setCs ( CoroutineState  cs)
inherited
Parameters
csused to set the Co-routine state

◆ setCurrentBuffer()

void com.vertica.sdk.ContinuousStreamer.setCurrentBuffer ( DataBuffer  currentBuffer)
inherited
Parameters
currentBufferused to set the currentBuffer of the ContinuousStreamer.

◆ setLastReservationSize()

void com.vertica.sdk.ContinuousStreamer.setLastReservationSize ( int  lastReservationSize)
inherited
Parameters
lastReservationSizeUsed to set the lastReservationSize of the ContinuousStreamer

◆ setNeedInput()

void com.vertica.sdk.ContinuousStreamer.setNeedInput ( boolean  needInput)
inherited
Parameters
needInputused to set the needInput flag of ContinuousStreamer.

◆ setPrev_reserved()

void com.vertica.sdk.ContinuousStreamer.setPrev_reserved ( int  prev_reserved)
inherited
Parameters
prev_reservedused to set the previous reservation size.

◆ setState()

void com.vertica.sdk.ContinuousStreamer.setState ( InputState  state)
inherited
Parameters
stateused to set the InputState of ContinuousStreamer.