Java SDK Documentation  23.4.0
com.vertica.sdk.SourceIterator Class Referenceabstract
Inheritance diagram for com.vertica.sdk.SourceIterator:
Inheritance graph
Collaboration diagram for com.vertica.sdk.SourceIterator:
Collaboration graph

Public Member Functions

final void cancelUDX (ServerInterface srvInterface)
 
abstract UnsizedUDSource createNextSource (ServerInterface srvInterface) throws UdfException
 
void destroy (ServerInterface srvInterface, NodeSpecifyingPlanContext planCtxt) throws UdfException
 
abstract int getNumberOfSources () throws UdfException
 
Integer getSizeOfSource (int sourceNum) throws UdfException
 
boolean isCanceled ()
 
void setup (ServerInterface srvInterface, NodeSpecifyingPlanContext planCtxt) throws UdfException
 

Protected Member Functions

void cancel (ServerInterface srvInterface)
 

Detailed Description

Constructs a set of Sources to be used by an IterativeSourceFactory.

createNextSource() will be called repeatedly until it returns NULL. Each resulting Source will be read to completion, and the contained data passed to the Filter and Parser.

Member Function Documentation

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

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
abstract UnsizedUDSource com.vertica.sdk.SourceIterator.createNextSource ( ServerInterface  srvInterface) throws UdfException
pure virtual

Create the next UDSource to process.

Should return NULL if no further sources are available for processing.

Note that the previous Source may still be open and in use on a different thread when this function is called.

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
Returns
a new Source instance corresponding to a new input stream
Exceptions
UdfExceptionUDF problem

Implemented in com.vertica.sdk.DefaultSourceIterator.

void com.vertica.sdk.SourceIterator.destroy ( ServerInterface  srvInterface,
NodeSpecifyingPlanContext  planCtxt 
) throws UdfException

Tear down this SourceIterator

Should perform clean-up

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
planCtxta plan context
Exceptions
UdfExceptionUDF problem
abstract int com.vertica.sdk.SourceIterator.getNumberOfSources ( ) throws UdfException
pure virtual
Returns
the total number of Sources that this factory will produce
Exceptions
UdfExceptionUDF problem

Implemented in com.vertica.sdk.DefaultSourceIterator.

Integer com.vertica.sdk.SourceIterator.getSizeOfSource ( int  sourceNum) throws UdfException
Parameters
sourceNumwhich source to query
Returns
the raw-data size of the sourceNum'th source that will be produced by createNextSource(). Should return vint_null if the size is unknown.

This value is used as a hint, and is used by the "load_streams" table to display load progress. If incorrect or not set, "load_streams" may contain incorrect or unhelpful information.

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

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

void com.vertica.sdk.SourceIterator.setup ( ServerInterface  srvInterface,
NodeSpecifyingPlanContext  planCtxt 
) throws UdfException

Set up this SourceIterator

Should perform setup that should not take place in the constructor due to the exception-handling semantics of constructors

Parameters
srvInterfacea ServerInterface object used to communicate with Vertica
planCtxta plan context
Exceptions
UdfExceptionUDF problem