Java SDK Documentation  24.2.0
com.vertica.sdk.ContinuousUDParser Class Referenceabstract
Inheritance diagram for com.vertica.sdk.ContinuousUDParser:
Inheritance graph
Collaboration diagram for com.vertica.sdk.ContinuousUDParser:
Collaboration graph

Classes

enum  CoroutineState
 

Public Member Functions

final void cancelUDX (ServerInterface srvInterface)
 
void deinitialize (ServerInterface srvInterface, SizedColumnTypes returnType)
 
final void destroy (ServerInterface srvInterface, SizedColumnTypes returnTypes)
 
void destroy (ServerInterface srvInterface, SizedColumnTypes returnType, SessionParamWriterMap udSessionParams) throws UdfException
 
ContinuousReader getContinuousReader ()
 
ContinuousRejecter getContinuousRejector ()
 
int getRecordsAcceptedInBatch ()
 
RejectedRecord getRejectedRecord ()
 
boolean getSeenEOB ()
 
ServerInterface getServerInterface ()
 
StreamWriter getStreamWriter ()
 
void increRecordsAcceptedInBatch ()
 
void initialize (ServerInterface srvInterface, SizedColumnTypes returnType)
 
boolean isCanceled ()
 
final StreamState process (ServerInterface srvInterface, DataBuffer input, InputState input_state) throws UdfException,DestroyInvocation
 
abstract void run () throws UdfException
 
void setRecordsAcceptedInBatch (int i)
 
void setSeenEOB (Boolean b)
 
void setStreamWriter (StreamWriter writer)
 
final void setup (ServerInterface srvInterface, SizedColumnTypes returnTypes) throws UdfException
 

Protected Member Functions

void cancel (ServerInterface srvInterface)
 

Protected Attributes

int recordsAcceptedInBatch
 
boolean seen_eob
 
StreamWriter writer
 

Member Function Documentation

◆ cancel()

void com.vertica.sdk.UDXObject.cancel ( ServerInterface  srvInterface)
protectedinherited

Cancel callback to be overridden by the UDX implementation. Called when the query running the UDX has been canceled.

  • This method will be invoked at most once per UDX object. Once a UDX object has been canceled, it will never be un-canceled.
  • This method may be called from a separate thread, concurrently with other methods of this UDX object (but never the constructor). Implementations must be thread-safe with all methods of this UDX.
  • This method will be invoked for either an explicit user cancel, or in the event of an error during query execution.
Parameters
srvInterfacea ServerInterface object used to communicate with Vertica

Referenced by com.vertica.sdk.UDXObject.cancelUDX().

◆ cancelUDX()

final void com.vertica.sdk.UDXObject.cancelUDX ( ServerInterface  srvInterface)
inherited

Cancel callback invoked when the query running the UDX has been canceled.

See cancel().

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica

◆ deinitialize()

void com.vertica.sdk.ContinuousUDParser.deinitialize ( ServerInterface  srvInterface,
SizedColumnTypes  returnType 
)

May optionally be overridden

Will be invoked during query execution, after run() has returned.

Parameters
srvInterfacea ServerInterface object.
returnTypea SizedColumnTypes object.

Referenced by com.vertica.sdk.ContinuousUDParser.destroy().

◆ destroy()

final void com.vertica.sdk.ContinuousUDParser.destroy ( ServerInterface  srvInterface,
SizedColumnTypes  returnTypes 
)

De-initialization to be done for ContinuousUDParser.

Note: Internally implemented for ContinuousUDParser. Do not override.

Parameters
srvInterfacea ServerInterface object.
returnTypesa SizedColumnTypes object.

◆ getContinuousReader()

ContinuousReader com.vertica.sdk.ContinuousUDParser.getContinuousReader ( )
Returns
returns ContinuousReader object of the ContinuousUDParser.

◆ getContinuousRejector()

ContinuousRejecter com.vertica.sdk.ContinuousUDParser.getContinuousRejector ( )
Returns
returns ContinuousRejector object of the ContinuousUDParser.

◆ getRejectedRecord()

RejectedRecord com.vertica.sdk.ContinuousUDParser.getRejectedRecord ( )
Returns
Returns information about the Rejected Record

◆ getServerInterface()

ServerInterface com.vertica.sdk.ContinuousUDParser.getServerInterface ( )
Returns
returns ServerInterface object of the ContinuousUDParser.

◆ initialize()

void com.vertica.sdk.ContinuousUDParser.initialize ( ServerInterface  srvInterface,
SizedColumnTypes  returnType 
)

May optionally be overridden

Will be invoked during query execution, prior to run() being called.

Parameters
srvInterfacea ServerInterface object.
returnTypea SizedColumnTypes object.

Referenced by com.vertica.sdk.ContinuousUDParser.setup().

◆ isCanceled()

boolean com.vertica.sdk.UDXObject.isCanceled ( )
inherited
Returns
true if execution was canceled.

Referenced by com.vertica.sdk.UDXObject.cancelUDX().

◆ process()

final StreamState com.vertica.sdk.ContinuousUDParser.process ( ServerInterface  srvInterface,
DataBuffer  input,
InputState  input_state 
) throws UdfException,DestroyInvocation

Override the built-in process() method with internal logic for ContinuousUDParser. Abstract away the state-machine interface by stuffing run() into a coroutine. Whenever run() wants more data than we have right now, context-switch out of the coroutine and back into process(), and go get whatever run() needs.

Note: Internally implemented for ContinuousUDParser. Do not override.

Parameters
srvInterfacea ServerInterface Object
inputa DataBuffer object.
input_statean InputState object.

◆ run()

abstract void com.vertica.sdk.ContinuousUDParser.run ( ) throws UdfException
abstract

Method exposed to user to write their custom code

User-implemented method that processes data. Called exactly once per ContinuousUDParser instance. It should read data using the reserve() and seek() (or read()) methods, and write data using the standard UDParser StreamWriter. It should return once it has either finished processing the input stream, or it (for whatever reason) wants to close the input stream and not process any further data.

run() should be very careful about keeping pointers or references to internal values returned by methods on the ContinuousUDParser class. Unless documentation explicitly indicates that it is safe to do so, it is not safe to keep such pointers or references, even for objects (such as the server interface) that one might otherwise expect to be persistent. Instead, call the accessor function for each use.

◆ setup()

final void com.vertica.sdk.ContinuousUDParser.setup ( ServerInterface  srvInterface,
SizedColumnTypes  returnTypes 
) throws UdfException

Initialization to be done for ContinuousUDParser.

Note: Internally implemented for ContinuousUDParser. Do not override.

Parameters
srvInterfacea ServerInterface object.
returnTypesa SizedColumnTypes object.

Member Data Documentation

◆ writer

StreamWriter com.vertica.sdk.UDParser.writer
protectedinherited

Writer to write parsed tuples to. Has the same API as PartitionWriter, from the UDT framework.